Description Usage Arguments Value Examples
View source: R/fread_fragmented.R
A convenience function, that wraps fread
from package data.table.
1 | fread_fragmented(x, stringsAsFactors = TRUE, ...)
|
x |
(character) Either a path to a file, a connection,
or literal data (either a single string or a raw vector). |
A data frame.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | ## Not run: \donttest{
# Contents of file "data-raw/CO_head.txt":
# Plant Type Treatment
# 1 Qn1 Quebec nonchilled
# 2 Qn1 Quebec nonchilled
# 3 Qn1 Quebec nonchilled
# conc uptake
# 1 95 16.0
# 2 175 30.4
# 3 250 34.8
fread_fragmented("data-raw/CO_head.txt")
## Plant Type Treatment conc uptake
## 1 Qn1 Quebec nonchilled 95 16.0
## 2 Qn1 Quebec nonchilled 175 30.4
## 3 Qn1 Quebec nonchilled 250 34.8
##
## Warning messages:
## 1: Missing column names filled in: 'X1' [1]
## 2: Missing column names filled in: 'X1' [1]
# These warning messages are expected.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rez <- read_fragmented_table(
" Plant Type Treatment
1 Qn1 Quebec nonchilled
2 Qn1 Quebec nonchilled
3 Qn1 Quebec nonchilled
conc uptake
1 95 16.0
2 175 30.4
3 250 34.8")
rez
# Plant Type Treatment conc uptake
# 1 Qn1 Quebec nonchilled 95 16.0
# 2 Qn1 Quebec nonchilled 175 30.4
# 3 Qn1 Quebec nonchilled 250 34.8
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.