Some functions for exporting data from R and pems.utils.
exportPEMS(pems, file = "tempfile", file.writer = write.table,
sep = "\t", ...)exportPEMS2TAB(pems, file = "tempfile", file.writer = write.table,
sep = "\t", ...)
exportPEMS2TAB(pems, file = "tempfile", file.writer = write.table,
sep = "\t", ...)
#exportPEMS2Excel
#currently disabled
exportPEMS2...() functions generate export file from pems data.
(A required object) The object to export from R, typically a data.frame or
pems object.
(Character) The name of the file to create when exporting data. This can be
'clipboard', to export to the clipboard assuming the clipboard buffers are not
exceeded.
(Various arguments) file.writer is the R function used to create the export file.
sep is the separator argument passed to file.writer.
(Optional) Other arguments, handling varies. For exportPEMS2... functions, these typically
passed to exportPEMS or from there to the assigned file.writer.
Karl Ropkins
Currently, exportPEMS... functions overwrite without warnings.
By default, exportPEMS2TAB and exportPEMS2CSV export the data component of a supplied
pems object, to tab-delimited .txt and comma-delimited .csv files,
respectively. file sets the file name (default tempfile).
These are typically used in form:
exportPEMS2...(pems, file, ...)
By default, they make the following associated modifications:
If file extensions are not included in file, they add .txt and .csv
extensions to tab-delimited and comma-delimited files, respectively. The argument
tidy.file=FALSE can be used to disable this modification.
Time stamps, if identified, are exported in "DD/MM/YYYY HH:MM:SS.x" format. Handling can be
altered using time.stamp, time.format and tz arguments like
import2PEMS or disabled using tidy.time.stamp=FALSE.
Data-series units can also be added to exported file column names in form name(units)
by adding the argument units="add.to.names".
References in preparation.
See import2PEMS, etc. for importing data into pems.utils.
###########
##example 1
###########
#making a comma-delimited copy of pems.1
if (FALSE) {
exportPEMS2CSV(pems.1, "pems.example")
dir()
}
Run the code above in your browser using DataLab