【问题标题】:I'm getting an error "object Installs not found"?我收到错误“找不到对象安装”?
【发布时间】:2019-05-18 11:24:41
【问题描述】:
library(dplyr)
playstore <- read.csv("googleplaystore.csv")

str(playstore)      
class(playstore)

playstore <- tbl_df(playstore)

head(playstore)

class(Installs)

【问题讨论】:

  • 从这段代码中,Installs 的唯一第一个实例是在尝试查找其类时。你的意思是class(playstore$Installs)
  • @NelsonGon 实际上,我试图过滤安装次数超过 10000 的应用程序 - filter(select(playstore, App, Installs, Rating), Installs 在 Ops.factor(Installs, 10000) 中:'>' 对因素没有意义我也将“安装”的数据类型从因素更改为数字。
  • 我们无法有效地帮助您,因为您的问题不包括可重现的示例。似乎 Installs 列被读取为因素(可能是因为它具有非数字外观的行)但我们无法确定,因为我们无权访问您的文件
  • 向您的问题添加示例数据、预期输出和/或当前输出和代码。使用dput(head(playstore)) 并将其添加到您的问题中。

标签: r


【解决方案1】:

创建了一些虚拟数据并提出了解决方案。

library(tidyverse)
playstore<-data.frame(AppName=c("DBC","BCD","ECD"),Installs=c(1500,250,100))
playstore %>% 
  mutate(Installs=as.numeric(Installs),AppName=as.factor(AppName)) %>% 
  filter(Installs>1000)

这会产生:

 AppName Installs
1     DBC     1500

【讨论】:

  • 如果您觉得它有帮助,请随时接受它作为答案,干杯!
猜你喜欢
  • 2018-12-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-07-27
  • 2017-10-01
  • 2018-12-19
  • 2015-09-30
相关资源
最近更新 更多