1.2.export.data: exporting PEMS data

Description Usage Arguments Details Value Warning Note Author(s) References See Also Examples

Description

Some functions for exporting data from R and pems.utils.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

Arguments

pems

(A required object) The object to export from R, typically a data.frame or pems object.

file

(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.

file.writer, sep

(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.

Details

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".

Value

exportPEMS2...() functions generate export file from pems data.

Warning

Currently, exportPEMS... functions overwrite without warnings.

Note

exportPEMS2Excel is curently disabled.

These are very crude functions in the most part because they are rarely used. Suggestions for helpful improvements would be very welcome.

Author(s)

Karl Ropkins

References

References in preparation.

See Also

See import2PEMS, etc. for importing data into pems.utils.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
###########
##example 1 
###########

#making a comma-delimited copy of pems.1

## Not run: 
exportPEMS2CSV(pems.1, "pems.example")
dir()

## End(Not run)

pems.utils documentation built on April 25, 2021, 9:07 a.m.