The last two only take the first element of the character vector to be used as the (single) text_field. We should raise a warning that only the first element is used.
library("readtext")
readtext("/Users/kbenoit/Dropbox/GitHub/quanteda/readtext/tests/data/csv/test3.csv", text_field = "colour")
## readtext object consisting of 2 documents and 2 docvars.
## # Description: data.frame [2 × 4]
## doc_id text text.1 number
## <chr> <chr> <chr> <int>
## 1 test3.csv.1 "\"orange\"..." The quick 0
## 2 test3.csv.2 "\"blue\"..." brown fox NA
readtext("/Users/kbenoit/Dropbox/GitHub/quanteda/readtext/tests/data/csv/test3.csv", text_field = "text")
## readtext object consisting of 2 documents and 2 docvars.
## # Description: data.frame [2 × 4]
## doc_id text colour number
## <chr> <chr> <chr> <int>
## 1 test3.csv.1 "\"The quick\"..." orange 0
## 2 test3.csv.2 "\"brown fox\"..." blue NA
readtext("/Users/kbenoit/Dropbox/GitHub/quanteda/readtext/tests/data/csv/test3.csv", text_field = c("text", "colour"))
## readtext object consisting of 2 documents and 2 docvars.
## # Description: data.frame [2 × 4]
## doc_id text colour number
## <chr> <chr> <chr> <int>
## 1 test3.csv.1 "\"The quick\"..." orange 0
## 2 test3.csv.2 "\"brown fox\"..." blue NA
readtext("/Users/kbenoit/Dropbox/GitHub/quanteda/readtext/tests/data/csv/test3.csv", text_field = c("colour", "text"))
## readtext object consisting of 2 documents and 2 docvars.
## # Description: data.frame [2 × 4]
## doc_id text text.1 number
## <chr> <chr> <chr> <int>
## 1 test3.csv.1 "\"orange\"..." The quick 0
## 2 test3.csv.2 "\"blue\"..." brown fox NA
The last two only take the first element of the character vector to be used as the (single)
text_field
. We should raise a warning that only the first element is used.