Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

keyRead

Read file after deducing file type from suffix.


Description

If the input is XLSX, sheets named "key" and "varlab" are imported if the exist. If input is CSV, then the key CSV file is imported and another file suffixed with "-varlab" is imported if it exists.

Usage

keyRead(file, ..., na.strings = c("\\s+"))

Arguments

file

name of file to be imported, including path to file. file name must end in "csv", "xlsx" or "rds"

...

additional arguments for read.csv or read.xlsx.

na.strings

Values to be converted to R missing symbol NA. Default is white space, "\s+".

Details

The variable lables are a named vector saved as an attribute of the key object.

Value

A data frame or matrix.

Author(s)

Paul Johnson <pauljohn@ku.edu>


kutils

Project Management Tools

v1.70
GPL-2
Authors
Paul Johnson [aut, cre], Benjamin Kite [aut], Charles Redmon [aut], Jared Harpole [ctb], Kenna Whitley [ctb], Po-Yi Chen [ctb], Shadi Pirhosseinloo [ctb]
Initial release
2020-04-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.