Skip to content

get_weather index error #13

Description

@burnsmj

I am trying to pull weather data from 21 environments across 3-4 years and I keep getting the following output and error:
NASA POWER: Done!

Connecting to https://biogeo.ucdavis.edu/data/ using Hijmans 2021------------------------------------------------
trying URL 'https://biogeo.ucdavis.edu/data/diva/msk_alt/USA_msk_alt.zip'
Content type 'application/zip' length 20073726 bytes (19.1 MB)

downloaded 19.1 MB

Error in raster_alt[[which(names(raster_alt) %in% country[i])]] :
attempt to select less than one element in get1index

I have gotten this to work in the past with a different dataset, but after trying that dataset again I get the same error. Am I just entering information incorrectly? Or was there a change to the code that affects this?

The code I am using is:
locations = read_delim('~/Desktop/Grad_School/Research/Projects/Machine_Learning/Hybrid_Validation/Hybrid_Growing_Locations_Example.txt', delim = '\t')

weather = get_weather(env.id = locations$Symbol,
lat = locations$Latitude,
lon = locations$Longitude,
start.day = locations$Start_Date,
end.day = locations$End_Date,
country = locations$Country)

The data looks like:
Symbol Description Location State Longitude Latitude Start_Date End_Date Country
CI "Champaign, IL" Champaign IL -88.27710955 40.11463105 2016/05/15 2016/10/31 USA
UC "Union City, TN" Union City TN -89.04931885 36.42821818 2016/05/15 2016/10/31 USA
MO "Miami, MO" Miami MO -93.22394385 39.32094822 2016/05/15 2016/10/31 USA
YA "Princeton, IN" Princeton IN -87.57779641 38.35376049 2016/5/15 2016/10/31 USA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions