PRISM data, error in subscript out of bounds

I downloaded the 'PRISM' package to R. I am following this SDM workshop: https://griffithdan.github.io/pages/outreach/SDM-Workshop-OSU-FALL2017.pdf

When I run this line of code:

env.present <- stack(list.files(path = "data/ENV-Present/",

  •                             full.names = TRUE,
    
  •                             pattern = ".tif"))
    

I get this error:
Error in x[[1]] : subscript out of bounds

I’m using this workshop and it says “We need some environmental data to associate with our occurrence data. In this case, you already have a basic set of environmental data already available from PRISM (http://prism.oregonstate.edu). This includes layers for a DEM, MAT, MAP, Tmin, and Tmax.”

BUT it says that you can access the data using the “prism” R package. So I have that prism R package downloaded.

I have Prism downloaded into R and I followed some steps via the "Download and plot PRISM data" website (won't allow me to attach). It saves the prism data by: prism_set_dl_dir("~/prismtmp")

It saved it via this pathway: C:\Users\Name\Documents\prismtmp\

I've tried to doing it several ways:

env.present <- stack(list.files(path = "C:/Users/Name/Desktop/Setophaga.virens/prism_set_dl_dir(/prismtmp)",

  •                             full.names = TRUE,
    
  •                             pattern = ".tif"))
    

Error in x[[1]] : subscript out of bounds

env.present <- stack(list.files(path = "C:/Users/Name/Desktop/Setophaga.virens/prism",

  •                             full.names = TRUE,
    
  •                             pattern = ".tif"))
    

Error in x[[1]] : subscript out of bounds

How do I just call to the prism r package?
I just don’t know how to change that function to access the data from the prism r package.

How do I fix this?
Thank you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.