NWTlter / NWT_climate_infilling

Code repository for climate infilling project
1 stars 1 forks source link

Error in getAmeriflux(): "attempt to set an attribute on NULL" #10

Closed milesalanmoore closed 11 months ago

milesalanmoore commented 11 months ago

https://github.com/NWTlter/NWT_climate_infilling/blob/d51695277c3fc4655042807b4612c874ff7f8a3c/daily_met/v1_example_scripts/1_prepare_climate_data.R#L60

I am keeping track of things as I run through this for the first time. Possible some of these are user error...

For some reason when I run getAmeriflux() in 1_prepare_climate_data.R an error is returns at https://github.com/NWTlter/NWT_climate_infilling/blob/d51695277c3fc4655042807b4612c874ff7f8a3c/daily_met/R/prep_data_functions.R#L159

Error in names(fluxfiles) <- stringr::str_extract(fluxfiles, pattern = "US-NR[0-9]") : 
  attempt to set an attribute on NULL

However, if I step into the function for debugging, the error does not appear. I tried modifying line 159 to instead use stats::setNames()and received a similar error. Putting a pin in this for now.