如何在R中修复:选择函数错误:未使用的参数

时间:2019-10-27 22:25:41

标签: r dataframe dplyr

运行代码时,我总是遇到相同的错误,我不知道自己在做什么错

# I upload these packages because I need to work with my data base, join some databases 
library(tidyverse)
library(fitdistrplus)
library(MASS)
library(survival)
#these are my data frames 
df41 = read.table("2014_1.csv",sep=";",header=T)
df42 = read.table("2014_2.csv",sep=";",header=T)
df43 = read.table("2014_3.csv",sep=";",header=T)
df44 = read.table("2014_4.csv",sep=";",header=T)
df51 = read.table("2015_1.csv",sep=";",header=T)
df52 = read.table("2015_2.csv",sep=";",header=T)
df53 = read.table("2015_3.csv",sep=";",header=T)
df54 = read.table("2015_4.csv",sep=";",header=T)
df61 = read.table("2016_1.csv",sep=";",header=T)
df62 = read.table("2016_2.csv",sep=";",header=T)
df63 = read.table("2016_3.csv",sep=";",header=T)
df64 = read.table("2016_4.csv",sep=";",header=T)
df71 = read.table("2017_1.csv",sep=";",header=T)
df72 = read.table("2017_2.csv",sep=";",header=T)
df73 = read.table("2017_3.csv",sep=";",header=T)
df74 = read.table("2017_4.csv",sep=";",header=T)
df81 = read.table("2018_1.csv",sep=";",header=T)
df82 = read.table("2018_2.csv",sep=";",header=T)
df83 = read.table("2018_3.csv",sep=";",header=T)
df84 = read.table("2018_4.csv",sep=";",header=T)
df91 = read.table("2019_1.csv",sep=";",header=T)
#some tests that im doing with my data frames
names(df41)
names(df42)
names(df41) == names(df42)
str(df41)
summary(df41)
names(df41)
#Here, I choose the columns "POTENCIA_BRUTA_MWH" and "CONCENTRACION_PORCENTAJE_CO2" and then I filter them with the values distinct of 0 or NA
df41_n = df41 %>% select(c("POTENCIA_BRUTA_MWH","CONCENTRACION_PORCENTAJE_CO2")) %>%
    filter(POTENCIA_BRUTA_MWH != 0 | POTENCIA_BRUTA_MWH != is.na(df41),CONCENTRACION_PORCENTAJE_CO2 != 0 | CONCENTRACION_PORCENTAJE_CO2 != is.na(df41))
summary(df41_n$POTENCIA_BRUTA_MWH)
summary(df41_n$CONCENTRACION_PORCENTAJE_CO2)

当我运行代码时,在df41_n行中,它们总是向我显示该错误:

df41_n = df41 %>% select(c("POTENCIA_BRUTA_MWH","CONCENTRACION_PORCENTAJE_CO2")) %>%
    +     filter(POTENCIA_BRUTA_MWH != 0 | POTENCIA_BRUTA_MWH != is.na(df41),CONCENTRACION_PORCENTAJE_CO2 != 0 | CONCENTRACION_PORCENTAJE_CO2 != is.na(df41))
  

select(。,c(“ POTENCIA_BRUTA_MWH”,“ CONCENTRACION_PORCENTAJE_CO2”)中的错误)   选择错误(c(“ POTENCIA_BRUTA_MWH”,“ CONCENTRACION_PORCENTAJE_CO2”))

但是这些行:

summary(df41_n$POTENCIA_BRUTA_MWH)
summary(df41_n$CONCENTRACION_PORCENTAJE_CO2)

效果很好,所以,我不知道我在做什么错

0 个答案:

没有答案