Description Usage Arguments Details Value Author(s) References Examples
Parsing csv, tab or xls(x) files at a specific directory path, genMore info generates a dataframe used to complete a DSPL bundle with a more complete concepts definition including description, url, etc..
1 2 | genMoreInfo(path, encoding = getOption("encoding"), sep = ";",
output = NA, action = "merge", dec = ".")
|
path |
String. Path to the folder where the tables are saved. |
encoding |
The encoding of the files to be parsed. |
sep |
The separation character of the tables in the 'path' folder. Currently supports introducing the following arguments: “,” or “;” (for .csv files), “\t” (for .tab files) and “xls” or “xlsx” (for Microsoft's excel files). |
output |
If defined, the place where to save the dataframe as tab file. Otherwise it returns a data frame object. |
action |
Tells the function what to do if there's a copy of the file. Available actions are “merge” and “replace”. |
dec |
String. Decimal point. |
If there isn't any output defined (NA
) the function returns a
dataframe containing concepts as observations. Using this, the user may add
more descriptive info about concepts. In turn it writes a tab file with the
dataframe described above. The user may recycle this file writing “append”
in the action
argument.
If no output
defined, genMoreInfo
returns a dataframe
with the following columns.
id |
XML id of the concept (autogenerated) |
label |
The label of the concept (autogenerated) |
description |
A brief description of the concept |
topic |
The topic of the concept |
url |
A URL for the concept where, for example, to get more info |
totalName |
A total name as specified by DSPL language (works for dimensional concepts) |
pluralName |
A total name as specified by DSPL language (works for dimensional concepts) |
George G. Vega Yon
Google Public Data Explorer: http://publicdata.google.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Getting the path where all the datasets are
path <- system.file("dspl-tutorial", package="googlePublicData")
info <- genMoreInfo(path) # This is a dataframe
# Setting the 5th concept as topic "Demographics"
info[5, "topic"] <- "Demographics"
# Generating the dspl file
ans <- dspl(path, moreinfo = info)
ans
## Not run:
# Parsing some xlsx files at "my stats folder" to gen a "moreinfo" dataframe
INFO <- genMoreInfo(path="my stats folder/", sep="xls")
# Rows 1 to 10 are about "Poverty" and rows 11 to 20 about "Education"
# So we fill the "topic" column with it.
INFO$topic[1:10] <- "Poverty"
INFO$topic[11:20] <- "Education"
# Finally, we build the DSPL ZIP including more info
dspl(path="my stats folder/", sep="xls", moreinfo=INFO)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.