I am new to R. I meet a very strange issue. I read my data from MongoDB into R. The last column is incorrectly readed as structure.
Initially, it looks fine when I just view it.
When I use dput(head(meter_char))
:
structure(list(
x_NMI = c(90141L, 90165L, 90157L, 90085L, 90148L, 90093L),
Building = c("double story", "unit", "Double story house", "Double story house", "Double story house", "Double story house"),
`number of people` = c("5", "2", "3", "2", "6", "4"),
pool = c("no", "no", "No", "No", "No", "No"),
`type of AC` = c("Evap", "Evap", "Reverse cycle", "None", "Evaporative, Reverse cycle", "Reverse cycle"),
No = structure(list(` of AC` = c("1", "1", "", "None", "Three", "Three")), row.names = c(NA, 6L), class = "data.frame")), row.names = c(NA,
6L), class = "data.frame")
The last column (expected to be "No of AC") is corrupted. It should not be structure(list(
.
I think this is caused by "." in the cloume name. Is there a way to change the content of the last colume to just c("1", "1", "", "None", "Three", "Three"))
?
Thanks!