I used to run the extract function from raster package without any problem. However, recently I receive an error message and it does not work for me. When I run the extract function to extract stacked rasters along with my data points I receive the following error.

EHFextract <- extract(Stack_Rasters, Points_data, sp = 1, method = "simple")

  Error in .doExtract(x, i, ..., drop = drop) : 
  unused arguments (sp = TRUE, method = "simple") 

closed as unclear what you're asking by Spacedman, nmtoken, Jochen Schwarze, Mark Ireland, Dan C Dec 10 '18 at 17:14

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • The error is telling you exactly what the problem is, check your arguments. If it was a namespace conflict then the error would indicate an incorrect object class. – Jeffrey Evans Dec 10 '18 at 5:51
  • Show us what summary(Stack_Rasters) and summary(Points_data) produce - otherwise we're guessing. – Spacedman Dec 10 '18 at 8:43

Could be a conflict between two packages with a function with the same name. To avoid this problem use:

EHFextract <- raster::extract(Stack_Rasters, Points_data, sp = 1, method = "simple")
  • Thanks for the answers: I added raster:: to the extract function and it works perfect now. – BabakK Dec 11 '18 at 1:40
  • @BabakK you are welcome. You can accept the answer if you want – aldo_tapia Dec 11 '18 at 1:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.