Skip to content

Precipitation data #413

@FelipeCarrillo

Description

@FelipeCarrillo

I wonder if this is a bug or data is not available after August 31, 2021. I am trying to download data from 2011 to 2021 but I only get half of 2021. See my script below:
library(rnoaa)

create a data frame for Prince William latitude and longitude

lat_lon_df <- data.frame(id = "pw",
lat = 60.690545,
lon = -147.097055)

find 10 closest monitors to Prince William

mon_near_pw <-
meteo_nearby_stations(
lat_lon_df = lat_lon_df,
lat_colname = "lat",
lon_colname = "lon",
var = "PRCP",
year_min = 2011,
year_max = 2021,
limit = 20,
)

mon_near_pw

#3,9,11,14 Get rainfall data from Cannery Creek, Esther Island, Cordova, and Port San Juan
pw_prcp_dat <-
meteo_pull_monitors(
monitors = mon_near_pw$pw$id[c(1,3,11,14)],
date_min = "2011-01-01",
date_max = "2021-12-31",
var = "PRCP"
)

final <- pw_prcp_dat %>%
pivot_wider(names_from= id,values_from=prcp) %>% data.frame()
head(final)
dim(final)

#Rename stations with more meaningful names
names(final)[2:5] <- c("cannery_creek","esther_island","cordova_n","sanjuan_chenega")
head(final)
tail(final)
#Get the total rainfall of the sound
final$total_prcp <- rowSums(cbind(final$cannery_creek, final$esther_island, final$cordova_n,final$sanjuan_chenega),na.rm=T)
dim(final)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions