We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's create example files:
csv1 <- data.frame( doc_id = c("doc1", "doc2"), text = c("Lorem ipsum", "dolor sit amet"), docvar1 = c("A", "B"), docvar2 = c("C", "D"), stringsAsFactors = FALSE ) csv2 <- csv1[1, ] write.csv(csv1, file = "/tmp/csv1.csv", row.names = FALSE) write.csv(csv2, file = "/tmp/csv2.csv", row.names = FALSE)
For csv1.csv doc_id and text are sourced correctly:
> readtext::readtext("/tmp/csv1.csv", docid_field = "doc_id", text_field = "text") readtext object consisting of 2 documents and 2 docvars. # Description: df[,4] [2 × 4] doc_id text docvar1 docvar2 <chr> <chr> <chr> <chr> 1 doc1 "\"Lorem ipsu\"..." A C 2 doc2 "\"dolor sit \"..." B D
For csv2.csv doc_id is based on filename:
> readtext::readtext("/tmp/csv2.csv", docid_field = "doc_id", text_field = "text") readtext object consisting of 1 document and 2 docvars. # Description: df[,4] [1 × 4] doc_id text docvar1 docvar2 <chr> <chr> <chr> <chr> 1 csv2.csv "\"Lorem ipsu\"..." A C
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Let's create example files:
For csv1.csv doc_id and text are sourced correctly:
For csv2.csv doc_id is based on filename:
The text was updated successfully, but these errors were encountered: