Error: No Such Column using SQLDF

前端 未结 3 2000
时光说笑
时光说笑 2021-01-05 22:19

Below are the scripts

> library(sqldf)
> turnover = read.csv(\"turnover.csv\")
> names(turnover)
[1] \"Report.Date\"       \"PersID\"            \"S         


        
3条回答
  •  渐次进展
    2021-01-05 22:37

    You can also use

    library(sqldf)
    turnover <- read.csv("turnover.csv", header=TRUE, check.names=FALSE) #Leave Names Alone
    
    names(turnover) <- gsub(x = names(turnover),
                        pattern = " ",
                        replacement = "_")  # Replace Var Name blank with _
    

提交回复
热议问题