I am trying to clean up my data by applying the following codes:
Manuf <- lapply(Manuf, gsub, pattern ='%', replacement ='')
Manuf <- lapply(Manuf, gsub, pattern='\\$', replacement ='')
I noticed the moment I applied the code, it turned my data into values. (from data with 366 observation with 14 variables, to values of list of 14).This caused a problem when I applied this code to designate columns to from characters to numeric.
Manuf[, c(4:7,13:14)] <- sapply(Manuf[, c(4:7,13:14)], as.numeric)
It returned an error of "incorrect number of dimensions" How do I avoid my database from changing to List when replacing the character? Any suggestions?