diff --git a/PortalForecasts.R b/PortalForecasts.R index 09ed1930dc..4b41e50bcc 100644 --- a/PortalForecasts.R +++ b/PortalForecasts.R @@ -10,7 +10,7 @@ filename_suffix = 'forecasts' #The date this forecast model is run. Always today's date. forecast_date = Sys.Date() -PortalDataSummaries::download_observations() +portalr::download_observations() moons = get_moon_data() #Beginning and end of the forecast timeperiod diff --git a/PortalHindcasts.R b/PortalHindcasts.R index 2e84914c42..f394406239 100644 --- a/PortalHindcasts.R +++ b/PortalHindcasts.R @@ -1,7 +1,7 @@ library(dplyr) library(lubridate) library(readr) -library(PortalDataSummaries) +library(portalr) source('forecast_tools.R') source('models/model_functions.R') diff --git a/index.Rmd b/index.Rmd index 4abfd7862b..68f553adab 100644 --- a/index.Rmd +++ b/index.Rmd @@ -5,7 +5,7 @@ title: "Portal Forecast" ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(dplyr) -library(PortalDataSummaries) +library(portalr) source("forecast_tools.R") ``` @@ -14,9 +14,9 @@ source("forecast_tools.R") This is the forecast for next month's sampling of rodents at Portal. ```{r, echo=FALSE, message=FALSE, warning=FALSE} -obs_data = PortalDataSummaries::abundance() +obs_data = portalr::abundance() obs_data$total = rowSums(select(obs_data, -period)) -new_moon_file = PortalDataSummaries::FullPath('PortalData/Rodents/moon_dates.csv', +new_moon_file = portalr::FullPath('PortalData/Rodents/moon_dates.csv', '~') new_moons = read.csv(new_moon_file) obs_data_newmoon = inner_join(obs_data, new_moons, by = c("period" = "Period")) diff --git a/install-packages.R b/install-packages.R index 0ea5417bce..6eaaf7b7a8 100644 --- a/install-packages.R +++ b/install-packages.R @@ -7,7 +7,7 @@ if ("pacman" %in% rownames(installed.packages()) == FALSE) install.packages("pac pacman::p_load(devtools, dplyr, forecast, ggplot2, lubridate, readr, tidyverse, zoo, magrittr, rmarkdown, ltsa, parallel) -pacman::p_load_gh('weecology/PortalDataSummaries') +pacman::p_load_gh('weecology/portalr') # Manually install tscount from CRAN archive diff --git a/models/model_functions.R b/models/model_functions.R index d8ccf8894e..3451a8d2db 100644 --- a/models/model_functions.R +++ b/models/model_functions.R @@ -22,7 +22,7 @@ get_rodent_data <- function(moons, forecast_date, filename_suffix){ #################################################################################### #get Portal abundance data for the entire site and for control plots only. - controls=PortalDataSummaries::abundance(level="Treatment",type="Rodents",length="Longterm", incomplete = FALSE) + controls=portalr::abundance(level="Treatment",type="Rodents",length="Longterm", incomplete = FALSE) #Control plots #The total rodent count in each treatment @@ -36,7 +36,7 @@ get_rodent_data <- function(moons, forecast_date, filename_suffix){ select(-NewMoonDate,-CensusDate,-period,-Year,-Month) #All plots - all=PortalDataSummaries::abundance(level="Site",type="Rodents",length="all", incomplete = FALSE) + all=portalr::abundance(level="Site",type="Rodents",length="all", incomplete = FALSE) #The total rodent count across the entire site all$total = rowSums(all[,-(1)]) all=inner_join(moons,all,by=c("Period"="period")) @@ -51,7 +51,7 @@ get_rodent_data <- function(moons, forecast_date, filename_suffix){ ################################################################################### #get weather data get_weather_data <- function(moons, all, first_forecast_newmoon, last_forecast_newmoon){ - weather_data=PortalDataSummaries::weather("Monthly") %>% + weather_data=portalr::weather("Monthly") %>% ungroup() %>% left_join(moons, by=c('Year','Month'))