df_read_table {W4MRUtils}R Documentation

Data frame loading from a file.

Description

df_read_table Reads a data frame from a file and possibly convert integer columns to numeric. This function calls the built-in read.table() method and then W4MRUtils::df_force_numeric().

Usage

df_read_table(file, force_numeric = FALSE, ...)

Arguments

file

The path to the file you want to load. See read.table() documentation for more information.

force_numeric

If set to TRUE, all integer columns will be converted to numeric.

...

Parameter to transmit to the read.table function.

Value

The loaded data frame.

Examples

# Load a data frame from a file and convert integer columns
file_path <- system.file(
  "extdata",
  "example_df_read_table.csv",
  package="W4MRUtils"
)
str(W4MRUtils::df_read_table(
  file_path,
  sep = ",",
  force_numeric = TRUE,
  header=TRUE
))


[Package W4MRUtils version 1.0.0 Index]