23.06.2015 Views

Package 'Hmisc' - R

Package 'Hmisc' - R

Package 'Hmisc' - R

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

44 csv.get<br />

Arguments<br />

file<br />

lowernames<br />

datevars<br />

the file name for import.<br />

set this to TRUE to change variable names to lower case.<br />

character vector of names (after lowernames is applied) of variables to consider<br />

as a factor or character vector containing dates in a format matching dateformat.<br />

The default is "%F" which uses the yyyy-mm-dd format.<br />

datetimevars character vector of names (after lowernames is applied) of variables to consider<br />

to be date-time variables, with date formats as described under datevars<br />

followed by a space followed by time in hh:mm:ss format. chron is used to<br />

store such variables. If all times in the variable are 00:00:00 the variable will be<br />

converted to an ordinary date variable.<br />

dateformat<br />

fixdates<br />

for cleanup.import is the input format (see strptime)<br />

for any of the variables listed in datevars that have a dateformat that<br />

cleanup.import understands, specifying fixdates allows corrections of<br />

certain formatting inconsistencies before the fields are attempted to be converted<br />

to dates (the default is to assume that the dateformat is followed<br />

for all observation for datevars). Currently fixdates=’year’ is implemented,<br />

which will cause 2-digit or 4-digit years to be shifted to the alternate<br />

number of digits when dateform is the default "%F" or is "%y-%m-%d",<br />

"%m/%d/%y", or "%m/%d/%Y". Two-digits years are padded with 20 on the<br />

left. Set dateformat to the desired format, not the exceptional format.<br />

comment.char a character vector of length one containing a single character or an empty string.<br />

Use ’""’ to turn off the interpretation of comments altogether.<br />

autodates<br />

allow<br />

charfactor<br />

sep<br />

skip<br />

vnames<br />

labels<br />

Set to true to allow function to guess at which variables are dates<br />

a vector of characters allowed by R that should not be converted to periods<br />

in variable names. By default, underscores in variable names are converted to<br />

periods as with R before version 1.9.<br />

set to TRUE to change character variables to factors if they have at least two<br />

characters in an observation but have fewer than n/2 unique values<br />

field separator, defaults to comma<br />

number of records to skip before data start. Required if vnames or labels is<br />

given.<br />

number of row containing variable names, default is one<br />

number of row containing variable labels, default is no labels<br />

... arguments to pass to read.csv other than skip and sep.<br />

Details<br />

csv.get reads comma-separated text data files, allowing optional translation to lower case for<br />

variable names after making them valid S names. Original possibly non-legal names are taken to<br />

be variable labels if labels is not specified. Character or factor variables containing dates can be<br />

converted to date variables. cleanup.import is invoked to finish the job.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!