Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

Receiving error: unused argument () in R while using a package from GitHub

I have to download data from a webpage https://nsidc.org/data/g02158. Now, I found a package in GitHub repository to do the same. Link to GitHub Package:https://github.com/jpshanno/nohrsc

First, I tried running the following code:

install.packages("remotes")
library(remotes)
remotes::install_github("jpshanno/nohrsc")
library(nohrsc)
rasters <- 
  nsa_get_snodas(region="North America", product = c("snow water equivalent", "snow melt"),
                 start.date = "2016-04-01",
                 end.date = "2016-04-03",
                 path = "snodas")

The error I received was:

Error in region %in% c("CONUS", "North America") : 
  object 'region' not found
Called from: region %in% c("CONUS", "North America")

Now, referring to the base function defined in https://github.com/jpshanno/nohrsc/blob/master/R/nsa_get_snodas.R, I made the following change in code:

library(nohrsc)

rasters <- 
  nsa_get_snodas(region="North America", product = c("snow water equivalent", "snow melt"),
                 start.date = "2016-04-01",
                 end.date = "2016-04-03",
                 region = "North America",
                 path = "snodas")

But, I again received error:

Error in nsa_get_snodas(region = "North America", product = c("snow water equivalent",  : 
  unused argument (region = "North America")
question from:https://stackoverflow.com/questions/65865779/receiving-error-unused-argument-in-r-while-using-a-package-from-github

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After working together, the OP and I solved the problem. There is a Windows binary available for the package that worked as expected. The installation notes have been edited to move the Windows Installation note to the top.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...