load_csv | R Documentation |
Reads CSV files containing more than one column of data. It automatically detects common separators (i.e., comma, semicolon, tab), while allowing users to specify encoding and decimal separators as required.
load_csv(filepath, dec = ".", encoding = getOption("encoding"))
filepath |
A string specifying the path to the CSV file (.csv extension). |
dec |
A character specifying the decimal separator to use. Default is "." (period). |
encoding |
A string specifying the encoding of the file. Default is the native
system encoding set by |
A data frame containing the data from the CSV file.
# file path
fpath <- system.file("extdata", "data_ex.csv", package="qPRAentry")
# Load a CSV file
df <- load_csv(fpath)
head(df) # value as character
# Load a CSV file with comma separated decimals
df <- load_csv(fpath, dec = ",") # value as numeric
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.