似乎许多用户都在尝试做我在这里也在尝试的事情。
我正在尝试做这些事情:
breaks=c(0, 3, 6, 9, 12)),y 轴在每个图上重复,并且 y 轴标签对于每个图重复和可自定义ggplot(mapping=aes(x=dist, fill=sex)) +
geom_histogram(data = cbind(move, panel = "A"), color="black", binwidth=10) +
geom_vline(data = cbind(move, panel = "A"), aes(xintercept=mean(dist)),
color="black", linetype="dashed", size=1)+
geom_histogram(data = cbind(settle_data, panel = "B"), color="black", binwidth=10) +
geom_vline(data = cbind(settle_data, panel = "B"), aes(xintercept=mean(dist)),
color="black", linetype="dashed", size=1)+
geom_histogram(data = cbind(recruit_data, panel = "C"), color="black", binwidth=10) +
geom_vline(data …Run Code Online (Sandbox Code Playgroud) 我一直在尝试为包含 7000 万条记录的数据集构建模型R。我尝试了所有可能的选项来构建模型,例如clustering使用ff库h2o(这会引发我的错误)bigmemory和biganalytics包。使用R我尝试过的选项,我无法处理如此庞大的数据。
您能否建议我除此之外的任何工作选项,以便我可以使用它来构建模型。我的笔记本电脑是 4GB RAM 和 64 位处理器。
首先,我已阅读以下帖子(R:保持前导零,然后再看一遍,还有这个,这个,或者这个。),但我的问题没有得到任何人的回答。
我尝试在该列中添加前导零ID。该文件是从excel导入的,我不知道如何上传到这里。可能无法向您复制该过程。
当我使用以下任何代码添加前导零时
formatC(data$col,width=5,format="s",flag="0")
sprintf("%05s",data$col)
gsub('\\s','0',data$col)
Run Code Online (Sandbox Code Playgroud)
它们都在字符串前给了我一个空格,而不是零。例如" 4097"
我还尝试减少任何空格trimws(sort$DlrNbr, which = c("both", "left", "right")),并重新尝试添加前导零,仍然失败。
你知道发生了什么事吗?任何见解都有帮助!
我有与此处发布的相同的问题,但问题仍然没有答案,我也遇到了同样的问题.
我在这里附上了我的数据样本.
我使用的R版本是3.4.2,dplyr的版本是0.7.4.
为了让每个人都加快速度......导入数据后,我会进行以下编辑:
#specify which species are predators (pp = 1) and prey (pp = 0)
d1 = d1 %>%
group_by(sps) %>% #grouped by species
mutate(pp=ifelse(sps %in% c("MUXX", "MUVI","MEME"), 1,0)) #mutate to specify predators as 1 and prey as 0
d1$datetime=strftime(paste(d1$date,d1$time),'%Y-%m-%d %H:%M',usetz=FALSE) #converting the date/time into a new format
head(d1) #visualize the first few lines of the data
d2 = d1 %>% filter(km %in% c("80")) #restricting the observations to just one location (km 80)
Run Code Online (Sandbox Code Playgroud)
现在问题出现的地方(NAs): …
r ×4
datetime ×1
dplyr ×1
facet ×1
ggplot2 ×1
h2o ×1
leading-zero ×1
r-bigmemory ×1
time-series ×1
whitespace ×1