Title: | Text Generation from Data |
---|---|
Description: | Linguistic Descriptions of Complex Phenomena (LDCP) is an architecture and methodology that allows us to model complex phenomena, interpreting input data, and generating automatic text reports customized to the user needs (see <doi:10.1016/j.ins.2016.11.002> and <doi:10.1007/s00500-016-2430-5>). The proposed package contains a set of methods that facilitates the development of LDCP systems. It main goal is increasing the visibility and practical use of this research line. |
Authors: | Patricia Conde-Clemente [aut, cre], Jose M. Alonso [aut], Gracian Trivino [aut] |
Maintainer: | Patricia Conde-Clemente <[email protected]> |
License: | GPL (>= 2) | file LICENSE |
Version: | 1.0.2 |
Built: | 2024-11-24 06:52:44 UTC |
Source: | CRAN |
In general, CP corresponds with specific parts of the analyzed phenomenon at a certain degree of granularity. To create a computational model of the analyzed phenomenon, the designer analyzes the everyday use of natural language about the monitored phenomenon with the aim of identifying different parts (units of information or granules) based on his/her subjective perceptions. According with Zadeh (1996), a granule is a clump of elements which are drawn together by indistinguishability, similarity, proximity or functionality. The GLMP handles granules by using CPs.
cp(name, a, b = NULL, r = NULL)
cp(name, a, b = NULL, r = NULL)
name |
is the identifier of the CP. |
a |
is a vector |
b |
is a vector |
r |
is a vector |
The generated CP = list(a, w, r, b, wb)
where w
and wb
are vectors with the validity degrees (wi and wbi in [0,1]) of the linguistic expressions in a
and b
respectively.
These vectors are initialized with 0.
myCP <-cp("myCP", c("bad", "good", "very good")) myCP <- cp("myCP", c("bad", "good", "very good"), c("low", "moderate", "high")) myCP <- cp("myCP", c("bad", "good", "very good"), r=c(1,0.8,0.9)) myCP <- cp("myCP", c("bad", "good", "very good"), c("low", "moderate", "high"), c(1,0.8,0.9))
myCP <-cp("myCP", c("bad", "good", "very good")) myCP <- cp("myCP", c("bad", "good", "very good"), c("low", "moderate", "high")) myCP <- cp("myCP", c("bad", "good", "very good"), r=c(1,0.8,0.9)) myCP <- cp("myCP", c("bad", "good", "very good"), c("low", "moderate", "high"), c(1,0.8,0.9))
Data structure provides the GLMP input. It constructor receives the input values and the method that defines the data structure, i.e., the set of preprocesing techniques.
data_structure(input, method)
data_structure(input, method)
input |
is the input data. May be a vector, list or matrix with numbers. |
method |
is the function with the data preprocesing techniques needed to prepare the GLMP input. The method must have
one argument, the
|
The generated data_structure = list(input, method)
values <- matrix(c(34,11,9,32), ncol=2) my_method <- function (input){ output <- c(mean(input[,1]), mean(input[,2])) output } my_data_structure <- data_structure(values,my_method)
values <- matrix(c(34,11,9,32), ncol=2) my_method <- function (input){ output <- c(mean(input[,1]), mean(input[,2])) output } my_data_structure <- data_structure(values,my_method)
It is a generic function in charge of computing fuzzy membership degrees. Namely, it identifies the specific
membership function to consider and run the related method for computing the membership degree for a given
input value. It takes as input an object (trapezoid_mf
, triangle_mf
and fuzzy_partitions
) and the related input values
degree_mf(shape, input)
degree_mf(shape, input)
shape |
is the object ( |
input |
is the value to be assess. |
the membership degree for a given input values.
w <- degree_mf(triangle_mf(450,450,550),450) w <- degree_mf(fuzzy_partitions(triangle_mf(450,450,550), triangle_mf(450,550,600), trapezoid_mf(550,600,800,1000), triangle_mf(800,1000,1300), trapezoid_mf(1000,1300,1500,1500)),450)
w <- degree_mf(triangle_mf(450,450,550),450) w <- degree_mf(fuzzy_partitions(triangle_mf(450,450,550), triangle_mf(450,550,600), trapezoid_mf(550,600,800,1000), triangle_mf(800,1000,1300), trapezoid_mf(1000,1300,1500,1500)),450)
It is a constructor of fuzzy partitions, it defines a set of membership functions. It takes as input a set of
trapezoid_mf
or triangle_mf
or objects in the shape_mf class.
fuzzy_partitions(...)
fuzzy_partitions(...)
... |
are the diferent partitions, e.g., |
the (fuzzy_partitions <- list(...)
fuzzy_partitions(triangle_mf(450,450,550), triangle_mf(450,550,600), trapezoid_mf(550,600,800, 1000), triangle_mf(800,1000,1300), trapezoid_mf(1000,1300,1500,1500))
fuzzy_partitions(triangle_mf(450,450,550), triangle_mf(450,550,600), trapezoid_mf(550,600,800, 1000), triangle_mf(800,1000,1300), trapezoid_mf(1000,1300,1500,1500))
We define a fuzzy rule using the numbers 1 and 0. rule(0,0,1,0,0, 0,0,1,0,0, 0,0,1,0,0, 0,0,1)
This is an example of fuzzy_rule(0,0,1,0,0,1). In the fuzzy rule the number 1 means that the linguistic expression is included and the number 0 means that the linguistic expression is not included.
fuzzy_rule(...)
fuzzy_rule(...)
... |
the 0 and 1 that compose the fuzzy rule. |
the fuzzy_rule <- c(...)
# For example, the rule "IF CPtemp IS warm THEN CPcomfort IS very comfortable" #is coded as: fuzzy_rule(0,1,0,0,0,1) # Where, the first three values (0,1,0) correspond with the linguistic # expressions Atemp=(cold, warm, hot) that define the room temperature (CPtemp). # The last three values (0,0,1) are related to the linguistic expressions # Acomfort=(uncomfortable, comfortable and very comfortable) that define # the room comfort (CPcomfort). #
# For example, the rule "IF CPtemp IS warm THEN CPcomfort IS very comfortable" #is coded as: fuzzy_rule(0,1,0,0,0,1) # Where, the first three values (0,1,0) correspond with the linguistic # expressions Atemp=(cold, warm, hot) that define the room temperature (CPtemp). # The last three values (0,0,1) are related to the linguistic expressions # Acomfort=(uncomfortable, comfortable and very comfortable) that define # the room comfort (CPcomfort). #
It is a constructor of fuzzy rules, the arguments are the diferent fuzzy_rule
object.
fuzzy_rules(...)
fuzzy_rules(...)
... |
one or more |
fuzzy_rules <- list(...)
fuzzy_rules(fuzzy_rule(0,0,1, 0,0,1, 0,0,1), fuzzy_rule(1,0,0, 1,0,0, 1,0,0), fuzzy_rule(0,1,0, 0,1,0, 0,1,0))
fuzzy_rules(fuzzy_rule(0,0,1, 0,0,1, 0,0,1), fuzzy_rule(1,0,0, 1,0,0, 1,0,0), fuzzy_rule(0,1,0, 0,1,0, 0,1,0))
The function takes as input the path to a XML file that contains a LDCP system. Then it generates its corresponding in R code. This R code is stored in an output file. The output file path is another function parameter.
generate_code(input, output)
generate_code(input, output)
input |
is the XML source path file. E.g. "/folder/ldcp_system.xml". |
output |
is the R destination path file. E.g. "/folder/ldcp_system.R". |
If the process ends without error, the user will receive a message that indicates that the code has been generated successfully. Otherwise, the user will receive the detailed list of errors.
## Not run: generate_code('extdata/comfortableroom','comfortableroom') ## The code has been generated successfully
## Not run: generate_code('extdata/comfortableroom','comfortableroom') ## The code has been generated successfully
Granular Linguistic Model of Phenomena (GLMP) is a network of cp
and pm
objects.
that allows the designer to model computationally her/his own perceptions. The input data are introduced
into the model through 1PMs which interpret the input data and create CPs. Then, 2PMs take several CPs
as input and generate 2CPs. Of course, following the same scheme, is possible to add additional upper levels.
The glmp
constructor receive as arguments the list of pms and the method with the computational model.
glmp(pms, method)
glmp(pms, method)
pms |
is the list of |
method |
is the function with the glmp computational model. The method must have two arguments: the list of
|
The generated glmp = list(pm, method)
## Not run: glmp_method <- function(pm,input){ pm$pm_depth <- pm_infer(pm$pm_depth, input[1]) pm$pm_height <- pm_infer(pm$pm_height,input[2]) pm$pm_width <- pm_infer(pm$pm_width, input[3]) pm$pm_frame <- pm_infer(pm$pm_frame, list( pm$pm_depth$y, pm$pm_height$y, pm$pm_width$y) ) pm } my_glmp <- glmp(list(pm_depth = pm_depth, pm_height = pm_height, pm_width = pm_width, pm_frame = pm_frame), glmp_method) ## End(Not run)
## Not run: glmp_method <- function(pm,input){ pm$pm_depth <- pm_infer(pm$pm_depth, input[1]) pm$pm_height <- pm_infer(pm$pm_height,input[2]) pm$pm_width <- pm_infer(pm$pm_width, input[3]) pm$pm_frame <- pm_infer(pm$pm_frame, list( pm$pm_depth$y, pm$pm_height$y, pm$pm_width$y) ) pm } my_glmp <- glmp(list(pm_depth = pm_depth, pm_height = pm_height, pm_width = pm_width, pm_frame = pm_frame), glmp_method) ## End(Not run)
Make an inference with the fuzzy rules.
infer_rules(rules, operator, input)
infer_rules(rules, operator, input)
rules |
the set of fuzzy rules. |
operator |
the |
input |
is the list of validity degrees related to the input |
A vector that containd the result of the inference.
## In the example the input of the fuzzy rule correspond with two CPs and each CP has 3 ## linguistic variables, e.g, {"bad", "good", "very good"}. The output also ## correspond with a CP with 3 linguistic variables. infer_rules(fuzzy_rules(fuzzy_rule(0,0,1, 0,0,1, 0,0,1), fuzzy_rule(1,0,0, 1,0,0, 1,0,0), fuzzy_rule(0,1,0, 0,1,0, 0,1,0)), operator(min, max), list(c(0,0.5,0.5),c(0.5,0.5,0))) ## [1] 0.0 0.5 0.0
## In the example the input of the fuzzy rule correspond with two CPs and each CP has 3 ## linguistic variables, e.g, {"bad", "good", "very good"}. The output also ## correspond with a CP with 3 linguistic variables. infer_rules(fuzzy_rules(fuzzy_rule(0,0,1, 0,0,1, 0,0,1), fuzzy_rule(1,0,0, 1,0,0, 1,0,0), fuzzy_rule(0,1,0, 0,1,0, 0,1,0)), operator(min, max), list(c(0,0.5,0.5),c(0.5,0.5,0))) ## [1] 0.0 0.5 0.0
Linguistic Descriptions of Complex Phenomena (LDCP) is a technology focused on
modeling complex phenomena, interpreting input data and generating automatic
text reports customized to the user needs. #'
The ldcp
constructor receive as arguments: the data_structure
,
the glmp
and the report_template
.
ldcp(data, glmp, report)
ldcp(data, glmp, report)
data |
is the |
glmp |
is the |
report |
is the |
The generated system ldcp = list(data, glmp, report)
## Not run: my_ldcp <- ldcp(my_data,my_glmp,my_report)
## Not run: my_ldcp <- ldcp(my_data,my_glmp,my_report)
Execute the ldcp
system in order to obtain the linguistic report.
This method follows these three sequential steps 1) Data acquisition, 2) Interpretation and 3)
Report generation.
Data acquisition process gets the input data and prepares the data structure. Then, the data
are interpreted using the GLMP. The result is a set of computational perceptions (CP) that are valid to describe
these data. Finally, the report generation process generates a linguistic report using the report template
and the previous set of CPs.
ldcp_run(ldcp, input = NULL)
ldcp_run(ldcp, input = NULL)
ldcp |
is the |
input |
is the system input data. May be a vector, list, or matrix with numbers. It is a new input to the |
The ldcp
object that contains the execution results.
## Not run: my_ldcp <- ldcp_run(my_ldcp)
## Not run: my_ldcp <- ldcp_run(my_ldcp)
The operator defines the conjunction and disjunction functions used in the fuzzy rules. It takes as input parameters the function used to implement the conjunction, and the function used to implement the disjunction, e.g., "operator(min, max)", where min and max are functions defined by the R language that calculate the maximum and minimum, respectively, from a set of values received as input. Note that, we implicitly assign to the fuzzy implication operator (THEN) the function given for conjunction
operator(conjunction, disjunction)
operator(conjunction, disjunction)
conjunction |
is the method used to make the conjunction. |
disjunction |
is the method used to make the disjunction. |
the opertator
object my_op <- list(conjunction, disjunction)
.
operator <- operator(min, max)
operator <- operator(min, max)
Perception Mapping (PM) is used to create and aggregate cp
objects. Each PM receives
a set of inputs (cp
objects or numerical values) which are aggregated into a single CP.
pm(u = NULL, y, g, t = NULL)
pm(u = NULL, y, g, t = NULL)
u |
is a vector of n input |
y |
is the output |
g |
is an aggregation function employed to calculate w from the input |
t |
is a text generation algorithm which allows generating the sentences in |
The generated pm = list(u,y,g,t)
## Not run: cp_depth <- cp("cp_depth",c("far", "bit far", "good", "close", "very close")) g_depth <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(triangle_mf(450,450,550), triangle_mf( 450,550,600), trapezoid_mf(550,600,800, 1000), triangle_mf( 800,1000,1300), trapezoid_mf( 1000,1300,1500,1500)),u) y } pm_depth <- pm(y=cp_depth, g=g_depth) ########################### HEIGHT DEFINITION ########################################### cp_height <- cp("cp_height", c("high", "average high", "centered", "average low", "low")) g_height <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(trapezoid_mf(-1000,-1000,-600,-400), triangle_mf(-600,-400,0), trapezoid_mf(-400,0,200,400), triangle_mf(200,400,600), trapezoid_mf(400,600,1000,1000)),u) y } pm_height <- pm(y=cp_height, g=g_height) ########################### WIDTH DEFINITION ########################################### cp_width <- cp("cp_width", c("left", "average left", "centered", "average right", "right")) g_width <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(triangle_mf(-1000,-600,-400), triangle_mf(-600,-400,0), triangle_mf(-400,0,400), triangle_mf(0,400,600), triangle_mf(400,600,1000,1000)), u) y } pm_width <- pm(y=cp_width, g=g_width) ########################### FRAME DEFINITION ########################################### cp_frame <- cp("cp_frame", c("bad", "middle", "good")) g_frame <- function(u,y){ operator <- operator(min, max) y$w<- infer_rules(fuzzy_rules( fuzzy_rule(0,0,1,0,0, 0,0,1,0,0, 0,0,1,0,0, 0,0,1), fuzzy_rule(1,1,1,1,1, 1,1,1,1,1, 1,1,0,1,1, 1,0,0), fuzzy_rule(1,1,1,1,1, 1,0,0,0,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(1,0,0,0,1, 1,1,1,1,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(0,1,0,1,0, 0,1,0,1,0, 0,0,1,0,0, 0,1,0)), operator, list(u[[1]]$w,u[[2]]$w,u[[3]]$w)) y } t_frame <- function(y){ templates <- c("It has been taken a bad framed photo", "It has been taken a middle framed photo", "It has been taken a good framed photo") return( templates[which.max(y$w)]) } pm_frame <- pm(y=cp_frame, g=g_frame, t=t_frame) ## End(Not run)
## Not run: cp_depth <- cp("cp_depth",c("far", "bit far", "good", "close", "very close")) g_depth <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(triangle_mf(450,450,550), triangle_mf( 450,550,600), trapezoid_mf(550,600,800, 1000), triangle_mf( 800,1000,1300), trapezoid_mf( 1000,1300,1500,1500)),u) y } pm_depth <- pm(y=cp_depth, g=g_depth) ########################### HEIGHT DEFINITION ########################################### cp_height <- cp("cp_height", c("high", "average high", "centered", "average low", "low")) g_height <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(trapezoid_mf(-1000,-1000,-600,-400), triangle_mf(-600,-400,0), trapezoid_mf(-400,0,200,400), triangle_mf(200,400,600), trapezoid_mf(400,600,1000,1000)),u) y } pm_height <- pm(y=cp_height, g=g_height) ########################### WIDTH DEFINITION ########################################### cp_width <- cp("cp_width", c("left", "average left", "centered", "average right", "right")) g_width <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(triangle_mf(-1000,-600,-400), triangle_mf(-600,-400,0), triangle_mf(-400,0,400), triangle_mf(0,400,600), triangle_mf(400,600,1000,1000)), u) y } pm_width <- pm(y=cp_width, g=g_width) ########################### FRAME DEFINITION ########################################### cp_frame <- cp("cp_frame", c("bad", "middle", "good")) g_frame <- function(u,y){ operator <- operator(min, max) y$w<- infer_rules(fuzzy_rules( fuzzy_rule(0,0,1,0,0, 0,0,1,0,0, 0,0,1,0,0, 0,0,1), fuzzy_rule(1,1,1,1,1, 1,1,1,1,1, 1,1,0,1,1, 1,0,0), fuzzy_rule(1,1,1,1,1, 1,0,0,0,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(1,0,0,0,1, 1,1,1,1,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(0,1,0,1,0, 0,1,0,1,0, 0,0,1,0,0, 0,1,0)), operator, list(u[[1]]$w,u[[2]]$w,u[[3]]$w)) y } t_frame <- function(y){ templates <- c("It has been taken a bad framed photo", "It has been taken a middle framed photo", "It has been taken a good framed photo") return( templates[which.max(y$w)]) } pm_frame <- pm(y=cp_frame, g=g_frame, t=t_frame) ## End(Not run)
It call the g
function in order to make the inference,
i.e., map inputs u
to output y
.
pm_infer(pm, u = NULL)
pm_infer(pm, u = NULL)
pm |
is the |
u |
is the new |
the pm
obtained after calling g
.
cp_depth <- cp("cp_depth", c("far", "bit far", "good", "close", "very close")) g_depth <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(triangle_mf(450,450,550), triangle_mf( 450,550,600), trapezoid_mf(550,600,800, 1000), triangle_mf( 800,1000,1300), trapezoid_mf( 1000,1300,1500,1500)),u) y } pm_depth <- pm(y=cp_depth, g=g_depth) pm_depth <- pm_infer(pm_depth, 650)
cp_depth <- cp("cp_depth", c("far", "bit far", "good", "close", "very close")) g_depth <- function(u,y){ y$w <- degree_mf(fuzzy_partitions(triangle_mf(450,450,550), triangle_mf( 450,550,600), trapezoid_mf(550,600,800, 1000), triangle_mf( 800,1000,1300), trapezoid_mf( 1000,1300,1500,1500)),u) y } pm_depth <- pm(y=cp_depth, g=g_depth) pm_depth <- pm_infer(pm_depth, 650)
It is a set of pm
s that infer a multidimensional cp
.
pm_multidimensional(...)
pm_multidimensional(...)
... |
the set of |
The generated pm_multidimensional <- list(...)
It call the t
function in order to generate the linguistic
descriptions that better describe the output y
.
pm_report(pm)
pm_report(pm)
pm |
is the |
the description obtained after calling t
.
cp_frame <- cp("cp_frame", c("bad", "middle", "good")) g_frame <- function(u,y){ operator <- operator(min, max) y$w<- infer_rules(fuzzy_rules( fuzzy_rule(0,0,1,0,0, 0,0,1,0,0, 0,0,1,0,0, 0,0,1), fuzzy_rule(1,1,1,1,1, 1,1,1,1,1, 1,1,0,1,1, 1,0,0), fuzzy_rule(1,1,1,1,1, 1,0,0,0,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(1,0,0,0,1, 1,1,1,1,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(0,1,0,1,0, 0,1,0,1,0, 0,0,1,0,0, 0,1,0)), operator, list(u[[1]]$w,u[[2]]$w,u[[3]]$w)) y } t_frame <- function(y){ templates <- c("It has been taken a bad framed photo", "It has been taken a middle framed photo", "It has been taken a good framed photo") return( templates[which.max(y$w)]) } pm_frame <- pm(y=cp_frame, g=g_frame, t=t_frame) pm_report(pm_frame)
cp_frame <- cp("cp_frame", c("bad", "middle", "good")) g_frame <- function(u,y){ operator <- operator(min, max) y$w<- infer_rules(fuzzy_rules( fuzzy_rule(0,0,1,0,0, 0,0,1,0,0, 0,0,1,0,0, 0,0,1), fuzzy_rule(1,1,1,1,1, 1,1,1,1,1, 1,1,0,1,1, 1,0,0), fuzzy_rule(1,1,1,1,1, 1,0,0,0,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(1,0,0,0,1, 1,1,1,1,1, 0,0,1,0,0, 1,0,0), fuzzy_rule(0,1,0,1,0, 0,1,0,1,0, 0,0,1,0,0, 0,1,0)), operator, list(u[[1]]$w,u[[2]]$w,u[[3]]$w)) y } t_frame <- function(y){ templates <- c("It has been taken a bad framed photo", "It has been taken a middle framed photo", "It has been taken a good framed photo") return( templates[which.max(y$w)]) } pm_frame <- pm(y=cp_frame, g=g_frame, t=t_frame) pm_report(pm_frame)
The text generation algorithm contains the programming code capable of generating
the appropriate report to each specific user. Algorithms must select and order
the linguistic expressions to generate the text included in the report.
#'
The report_template
constructor receive as arguments the list of properties
and the method (programming code) capable of generating the appropriate report.
report_template(properties = NULL, method, description = NULL)
report_template(properties = NULL, method, description = NULL)
properties |
may be a vector, list or matrix with the user's needs,
preferences and goals. By default |
method |
is the function that generates the appropriate report. The method must have
two arguments: the list of properties and the list of pms:
|
description |
is the result of call the report template. By default is NULL |
The generated report_template= list(properties, method,description)
properties = NULL report_method <- function(properties,pm){ pm_report(pm$pm_frame) } my_report <- report_template(properties, report_method)
properties = NULL report_method <- function(properties,pm){ pm_report(pm$pm_frame) } my_report <- report_template(properties, report_method)
It is a constructor of trapezoidal shapes. They take as input the numerical values which define the anchor points in membership functions.
trapezoid_mf(a, b, c, d)
trapezoid_mf(a, b, c, d)
a |
the trapezoid point a. |
b |
the trapezoid point b. |
c |
the trapezoid point c. |
d |
the trapezoid point d. |
the (trapezoid_mf <- list(a,b,c,d))
trapezoid_mf(0, 1, 2, 3)
trapezoid_mf(0, 1, 2, 3)
It is a constructor of triangular shapes. They take as input the numerical values which define the anchor points in membership functions.
triangle_mf(a, b, c)
triangle_mf(a, b, c)
a |
the trapezoid point a. |
b |
the trapezoid point b. |
c |
the trapezoid point c. |
the (triangle_mf <- list(a,b,c))
triangle_mf(0, 1, 2)
triangle_mf(0, 1, 2)
The function takes as input the path to a XML file that contains a LDCP system. Then it validates the LDCP system.
validate_xml(xmlfile, schema = NULL)
validate_xml(xmlfile, schema = NULL)
xmlfile |
is the XML source path file. E.g. "/folder/ldcp_system.xml". |
schema |
is the ldcp schema path file. By default is "ldcpSchema.xsd". |
If the process ends without error, the user will receive the message that indicates that the XML is valid. Otherwise, the user will receive the detailed list of errors.
## Not run: validate_xml('extdata/comfortableroom.xml') ## The xml is valid
## Not run: validate_xml('extdata/comfortableroom.xml') ## The xml is valid
The function takes as input the path to a XML file that contains a LDCP system. Then it validates the LDCP system and generates its corresponding in R code. This R code is stored in an output file. The output file path is another function parameter.
xml2rldcp(input, output)
xml2rldcp(input, output)
input |
is the XML source path file. E.g. "/folder/ldcp_system.xml". |
output |
is the R destination path file. E.g. "/folder/ldcp_system.R". |
If the process ends without error, the user will receive two messages: one indicates that the XML is valid and the other indicates that the code has been generated successfully. Otherwise, the user will receive the detailed list of errors.
## Not run: xml2rldcp('extdata/comfortableroom.xml','comfortableroom.R') ## The xml is valid ## The code has been generated successfully
## Not run: xml2rldcp('extdata/comfortableroom.xml','comfortableroom.R') ## The xml is valid ## The code has been generated successfully