I’m working with a Qualtrics Survey dataset and for some reason the first three rows of each survey are kind of a jumbled mess that are a mix of long hand survey questions and shorthand variable names. The first row of the dataset is the shorthand variable names while I want to get rid of the next two.
I want to get rid of these rows because they kind of poison the datatype of the column casting everything as
chr. Is there a way I can keep the first row and remove the next two before the columns are cast as a specific data type? My code so far?
raw.file.path <- here::here("raw_data", "FDSCI 101 Attitude Survey vS14.csv") # I've used drop = 37 here to get rid of a column I don't need, # curious if there is a way to get rid of rows while keeping the first row as headers. raw.data <- import(raw.file.path, drop = 37, setclass = "tibble") # This removes the rows but the columns are already poisoned. raw.data %>% slice(3:n())
Any help would be greatly appreciated!