read.tidy: Read csvs into tidy format

Description Usage Arguments Value

View source: R/read.tidy.R

Description

A convenience wrapper for read.csv which lowercases column names and removes punctuation (but leaves underscores). It also has an option to only read the csv if the object does not exist.

Usage

1
read.tidy(x = "clipboard", sep = "\t", ifexists = F, existsname, ...)

Arguments

x

the filename to load. Should be a csv. Defaults to reading from the clipboard.

sep

the field separator character. If x == 'clipboard', sep defaults to tab seperated files. Otherwise, it defaults to ',' to read csv data.

ifexists

should the function check if the object exists. Default = F

existsname

what object should the function look for, assuming ifexists = T. If ifexists == T and existname is not empty, the function will return the object with name = existsname.

...

Arguments passed on to utils::read.csv

header

a logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: header is set to TRUE if and only if the first row contains one fewer field than the number of columns.

quote

the set of quoting characters. To disable quoting altogether, use quote = "". See scan for the behaviour on quotes embedded in quotes. Quoting is only considered for columns read as character, which is all of them unless colClasses is specified.

dec

the character used in the file for decimal points.

fill

logical. If TRUE then in case the rows have unequal length, blank fields are implicitly added. See ‘Details’.

comment.char

character: a character vector of length one containing a single character or an empty string. Use "" to turn off the interpretation of comments altogether.

Value

Returns a data frame will lower cased names and all punctuation removed. If dplyr is already loaded, it returns a data frame as a tbl_df–otherwise, it returns a simple data frame.


crazybilly/muadc documentation built on March 6, 2021, 4:15 p.m.