read_phx: to more easily read data with a 2nd row with units common to...

Description Usage Arguments Details Value Examples

View source: R/readers.R

Description

to more easily read data with a 2nd row with units common to phx data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
read_phx(
  data,
  skip = 0,
  header = TRUE,
  sep = "auto",
  stringsAsFactors = FALSE,
  has_units = FALSE,
  fread = TRUE,
  data.table = FALSE,
  ...
)

Arguments

data

the name of the csv

skip

rows to skip before header row

header

logical value indicating whether the file contains the names of variables as it's first line

sep

field separator character. With fread defaults to 'auto', else defaults to ","

stringsAsFactors

logical value whether to include string columns as factors

has_units

logical value whether has a units row below the header (eg phx nlme data)

fread

logical value. Use fread from data.table for much faster reading

data.table

logical value. When using fread, whether to return data.table (TRUE) or data.frame (FALSE)

...

additional arguments to read.csv functions

Details

helpful function to handle situations where the second row is a units row as often seen with phoenix-style datasets

Value

data frame of read-in csv

Examples

1
2
3
4
5
## Not run: 
read_phx("example.csv")
read_phx("example.csv", skip = 1) # will ignore 1st line, good for comment lines

## End(Not run)

PKPDmisc documentation built on April 14, 2020, 5:49 p.m.