HakaiInstitute / jsp-time-series-report

Juvenile salmon program annual time series
0 stars 7 forks source link

Error in logit(percent/100) : could not find function "logit" #20

Closed jclgan closed 5 years ago

jclgan commented 5 years ago

https://github.com/HakaiInstitute/jsp-time-series/blob/28013b6ff4119a3c30edacc5440f615a33b191f9/scripts/data_wrangle.Rmd#L381

Error occurs even after loading package hakaisalmon

In the Examples section of the pkgdown document for log_cumul_abund:

date <- 110:190
n <- rnorm(81, mean = 100, sd = 20)
df <- dplyr::tibble(date, percent)
#> Error in eval_tidy(xs[[i]], unique_output): object 'percent' not found
df <- df %>% mutate(percent == cumsum(n / sum(n) * 100))
#> Error in mutate(., percent == cumsum(n/sum(n) * 100)): could not find function "mutate"
log_cumul_abund(df$date, df$percent)
#> Error in logit(percent/100): could not find function "logit"
Br-Johnson commented 5 years ago

logit is from the car package. I think it's a hidden dependency of hakaisalmon I'll add this bug to the hakaisalmon repo