write.xarf: Data Output to XARF

Description Usage Arguments Details Examples

Description

Function saves a data.frame like objct to XARF format. More details on format can be found in https://bitbucket.org/realKD/realkd/wiki/model/data/xarf.

Usage

1
2
write.xarf(x, dbID, file = "", dbDescription = NULL,
  attrDescription = NULL)

Arguments

x

the data.frame to be written

dbID

a unique identifier of the dataset

file

either a character string naming a file or a connection open for writing. "" indicates output to the console.

dbDescription

a list specifying the description of the dataset

attrDescription

a vector of descriptions for every attribute

Details

The function takes the dataset and writes it to file file. The names of the rows are written as the name attribute. The attributes are written in the order given in attrDescription. If an attribute is missing from attrDescription, it is written at the end of the dataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
write.xarf(mtcars, file="",
  "mtcars",
  dbDescription=list(
    title="Motor Trend Car Road Tests",
    version="1.0.0",
    source="Basic R dataset 'mtcars'"),
  attrDescription=list(
    list(id="mpg",name="Miles/(US) gallon",type="real",description="The distance in miles a car can go with a single gallon of petrolium"),
    list(id="cyl",name="Number of cylinders",type="integer"),
    list(id="disp",name="Displacement (cu.in.)")
  ))

AlekseyBuzmakov/XARF documentation built on May 8, 2019, 1:42 p.m.