read: @title Read a data.frame from disk into memory

Description Usage Arguments Details Examples

View source: R/basetools.R

Description

Read a file of various format and return a data.frame. The function try to identify the file structure in order to call the appropriate specific command Currently accepted extension are : csv, dta, rec, rda

Usage

1
read(filename = "", factorise = FALSE, lowercase = FALSE, label = NULL, ...)

Arguments

filename

Name of file to be read. Type is defined by extension

factorise

Indicate if character variable should be read as factor. If false, the default The column is read as character without transformation. Further transformation can be done with factor base function or with epiorder function.

lowercase

If TRUE, variable names are set to lowercase otherwise they are not changed

label

Label to be added as attribute to data.frame. This label will be used as description

...

other standard read options

Details

For csv files the first line is analysed to identify the separator. Accepted separator are , or ;

@return The data.frame is returned (and should be assign to a variable)

Examples

1
2
3
4
5
fil <- tempfile(fileext = ".data")
cat("TITLE extra line", "2 3 5 7", "", "11 13 17", file = fil,
sep = "\n")
df <- read(filename=fil)
unlink(fil) # tidy up

gdesve/epifield documentation built on Jan. 23, 2022, 10:03 a.m.