Learn R Programming

adapr (version 2.0.0)

Read: Read data and capture the file information within dependency object

Description

Read data and capture the file information within dependency object

Usage

Read(file.name = "data.csv", description = "Data file",
  read.fcn = guess.read.fcn(file.name), ...)

Arguments

file.name

name of file

description

description of data file

read.fcn

function for reading file

...

arguments to read function

Value

object read from file

Details

Main fuction for reading file data in projects. Wrapper function for Read.cap, automatically generates file information. Assumes file is in project "Data" directory. Use this in the body of the program. Guesses which function to use to read the file, but user can specify any function that given a file name returns an R object.

Examples

Run this code
# NOT RUN {
source_info <- create_source_file_dir("adaprHome","tree_controller.R")
write.csv(cars,file.path(source_info$data.dir,"test.csv"))
cardata <- Read("test.csv","cars dataframe",as.is=TRUE)
file.remove(file.path(source_info$data.dir,"test.csv"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab