Reference object of class
This is a class which inherits from class
datastream and which can be used to read in a stream
from a file. A number of file readers have been implemented, namely
See the examples.
The name how the stream is labelled
The function to use to read in the file.
optional character vector of column to overwrite the column names of the data read in with in
The file to read in. See e.g.
parameters passed on to
A class of type
datastream_file which contains
The function to use to read in the file
A connection to the file
A character vector of column names to overwrite the column names with in
get_points(n) Get data from a datastream object.
integer, indicating the number of instances to retrieve from the datastream
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
mydata <- iris mydata$Species[2:3] <- NA ## Example of a CSV file stream myfile <- tempfile() write.csv(iris, file = myfile, row.names=FALSE, na = "") x <- datastream_csv(file = myfile, na.strings = "") x x$get_points(n=10) x x$get_points(n=10) x x$stop() ## Create your own specific file stream write.table(iris, file = myfile, row.names=FALSE, na = "") x <- datastream_file(description="My file defintion stream", FUN=read.table, file = myfile, header=TRUE, na.strings="") x$get_points(n=10) x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.