Skip to content

Commit

Permalink
Rename Portal data processing package
Browse files Browse the repository at this point in the history
The name was just updated for the package
  • Loading branch information
ethanwhite committed Jul 26, 2017
1 parent ea0a0dd commit 9392d6a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion PortalForecasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion PortalHindcasts.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
library(dplyr)
library(lubridate)
library(readr)
library(PortalDataSummaries)
library(portalr)
source('forecast_tools.R')
source('models/model_functions.R')

Expand Down
6 changes: 3 additions & 3 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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")
```

Expand All @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion install-packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions models/model_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"))
Expand All @@ -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'))

Expand Down

0 comments on commit 9392d6a

Please sign in to comment.