'Additional information needed in summarise(nAlive = n())?
this is my first post and I am fairly new to R so please have patience and ask for any other info needed. I will be as thorough as I can.
So, I have a question about this set of code
Alive<- JulyData%>%
filter(!is.na(Lice))%>%
group_by(Cage, Species)%>%
summarise(nAlive=n())
Do I need to include anything in the line summarise(nAlive = n()) or is this perfectly acceptable? The n() seems like it is lacking something but I am not sure.
I am trying to count the number of alive specimens grouped by cage and species.
Here is the full code I am working with for reference:
library(readxl)
library(tidyverse)
library(lme4)
library(car)
library(emmeans)
JulyData<- read_excel("~/R/Cage Data Final 2016 EMV 1.20.xlsx", sheet="7.1.2016")
str(JulyData)
summary(JulyData$Lice)
AllCages<- distinct(JulyData, Cage, Species)
AllCages$nStart<- rep(10,nrow(AllCages))
Alive<- JulyData%>%
filter(!is.na(Lice))%>%
group_by(Cage, Species)%>%
summarise(nAlive=n())
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
