Skip to content

Commit

Permalink
finishing cruise and air tourism indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
CarissaGervasi-NOAA committed Oct 30, 2024
1 parent 2bb2a35 commit 5a208ac
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 8 deletions.
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

.Rproj.user

/.quarto/

.Rhistory
.Rhistory
index.aux
index.lof
index.log
index.lot
index.pdf
index.tex
index.toc
Binary file not shown.
Binary file removed Report_book_files/images/process_flow_chart.png
Binary file not shown.
Binary file removed indicator_objects/cruise.RData
Binary file not shown.
Binary file added indicator_objects/cruise_air_visitors.RData
Binary file not shown.
31 changes: 31 additions & 0 deletions indicator_processing/automated_download/EPA_water_quality.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Water quality indicator from the EPA water quality data portal: https://www.epa.gov/waterdata/TADA

if(!"remotes"%in%installed.packages()){
install.packages("remotes")
}

remotes::install_github("USEPA/EPATADA", ref = "develop", dependencies = TRUE, force = TRUE)

getwd() # find your working directory
TADA::TADA_GetTemplate() # download template to working directory

# uncomment below to review example dataset
# Data_Nutrients_UT <- TADA::Data_Nutrients_UT

EPATADA::TADA_GetTemplate()

dataset_0 = EPATADA::TADA_DataRetrieval(
startDate = "2020-06-22",
endDate = "null",
countycode = "null",
huc = "null",
siteid = "null",
siteType = "null",
characteristicName = "null",
characteristicType = "null",
sampleMedia = "null",
statecode = "PR",
organization = "null",
project = "null",
applyautoclean = TRUE
)
13 changes: 9 additions & 4 deletions indicator_processing/automated_download/cruise_air_visitors.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,31 +126,36 @@ print(USVI_air)




##########

all_years <- data.frame(Year = min(PR_cruise$Year, USVI_cruise$Year) : max(PR_cruise$Year, USVI_cruise$Year))

# Merge the data frames with the complete data frame to fill in missing years with NA
combined_df <- merge(all_years, PR_cruise, by = "Year", all.x = TRUE)
combined_df <- merge(combined_df, USVI_cruise, by = "Year", all.x = TRUE)
combined_df <- merge(combined_df, PR_air, by = "Year", all.x = TRUE)
combined_df <- merge(combined_df, USVI_air, by = "Year", all.x = TRUE)




# save as indicator object ----------------------
datdata <- all_years$Year
inddata <- data.frame(cbind(combined_df$Cruise_passengers.x, combined_df$Cruise_passengers.y))
inddata <- data.frame(cbind(combined_df$Cruise_passengers.x, combined_df$Cruise_passengers.y, combined_df$Air_passengers.x, combined_df$Air_passengers.y))
labs <- c("Cruise passengers" , "thousands of people", "Puerto Rico",
"Cruise passengers" , "thousands of people", "USVI")
"Cruise passengers" , "thousands of people", "USVI",
"Air passengers" , "thousands of people", "Puerto Rico",
"Air passengers" , "thousands of people", "USVI")
indnames <- data.frame(matrix(labs, nrow = 3, byrow = F))
inddata <- list(labels = indnames, indicators = inddata, datelist = datdata)
class(inddata) <- "indicatordata"

# plot and save ----------------------------------

ind <- inddata
plotIndicatorTimeSeries(ind, coltoplot = 1:2, plotrownum = 2, plotcolnum = 1, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.7, anom = "none", yposadj = 1)
plotIndicatorTimeSeries(ind, coltoplot = 1:4, plotrownum = 2, plotcolnum = 2, trendAnalysis = TRUE, dateformat = "%b%Y", sublabel = TRUE, widadj = 1, hgtadj = 0.7, anom = "none", yposadj = 1)

save(ind, file = "indicator_objects/cruise.RData")
save(ind, file = "indicator_objects/cruise_air_visitors.RData")

############################### END #############################

0 comments on commit 5a208ac

Please sign in to comment.