当前位置: 首页 > 工具软件 > better_errors > 使用案例 >

learn from errors

越雨泽
2023-12-01

函数调用报错

select:unused argument

  1. click session -restart R                    (better)
  2. replace select with dplyr::select

dat <- read_csv(ahi-cesd.csv):Error in is.connection(x) : 找不到对象'ahi'

  • dat <- read_csv("ahi-cesd.csv") #该函数引用文件名时要加引号
  • 其他要加引号和不加引号的函数
c("id", "intervention")
filter(data, gender == "female")

select(all_dat, ahiTotal, cesdTotal, sex, age, educ, income, occasion, elapsed.days)

 

作图有误

if your graphs are looking weird this might be the reason

str(summarydata) #作图前观察数据类型

summarydata <- summarydata %>%
  mutate(sex = as.factor(sex),
         educ = as.factor(educ),
         income = as.factor(income)) #overwrite the data that is in the column sex with sex as a factor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 类似资料:

相关阅读

相关文章

相关问答