使用子集并选择时出现错误

时间:2019-06-06 21:17:23

标签: r subset

我正在使用子集并选择从数据框中提取列。我的代码很简单,但是会发生错误。

names(df7)
df7 <- subset(df7, select = -c("Parameter.Code", "Time.Local", "Date.GMT", "Time.GMT", "Sample.Measurement"))

下面是结果和错误。

names(df7)
 [1] "Latitude"            "season.x"            "AOT40_1"             "count1"              "count_full"         
 [6] "AOT40_2"             "State.Code"          "County.Code"         "Site.Num"            "Parameter.Code"     
[11] "POC"                 "Longitude"           "Datum"               "Parameter.Name"      "Date.Local"         
[16] "Time.Local"          "Date.GMT"            "Time.GMT"            "Sample.Measurement"  "Units.of.Measure"   
[21] "MDL"                 "Uncertainty"         "Qualifier"           "Method.Type"         "Method.Code"        
[26] "Method.Name"         "State.Name"          "County.Name"         "Date.of.Last.Change" "AOT40"              
[31] "season.y"

df7 <- subset(df7, select = -c("Parameter.Code", "Time.Local", "Date.GMT", "Time.GMT", "Sample.Measurement"))
Error in -c("Parameter.Code", "Time.Local", "Date.GMT", "Time.GMT", "Sample.Measurement") : 
  invalid argument to unary operator

任何想法?

0 个答案:

没有答案