I have a table source that reads into a data frame. I know that by default, external sources are read into data frames as factors. I'd like to apply stringsAsFactors=FALSE
in the data frame call below, but it throws an error when I do this. Can I still use chaining and turn stringsAsFactors=FALSE
?
library(rvest)
pvbData <- read_html(pvbURL)
pvbDF <- pvbData %>%
html_nodes(xpath = `//*[@id="ajax_result_table"]`) %>%
html_table() %>%
data.frame()
data.frame(,stringsAsFactors=FALSE) <- Throws an error
I know this is probably something very simple, but I'm having trouble finding a way to make this work. Thank you for your help.