bivariate-maps-ggplot2-sf icon indicating copy to clipboard operation
bivariate-maps-ggplot2-sf copied to clipboard

Fails to rename: object 'X02.relief.ascii' not found

Open asifm opened this issue 6 years ago • 1 comments

Hi, I'm not sure if I'm missing something simple, but the index.Rmd file is failing at line 250–255. I'm running it within a freshly downloaded repo. R version is 3.5.3 (64-bit) but I'm on Windows, not Linux -- I don't know if that has anything to do with this error. Please find the traceback below as well.

Code that fails

# read in raster of relief
relief <- raster("input/02-relief-ascii.asc") %>%
  # hide relief outside of Switzerland by masking with country borders
  mask(country_geo) %>%
  as("SpatialPixelsDataFrame") %>%
  as.data.frame() %>%
  rename(value = `X02.relief.ascii`)

Traceback

Error in .f(.x[[i]], ...) : object 'X02.relief.ascii' not found
15. .f(.x[[i]], ...)
14. map(.x[sel], .f, ...)
13. map_if(quos, is_symbol, eval_tidy, data)
12. vars_rename_eval(quos, .vars)
11. tidyselect::vars_rename(names(.data), !!!quos(...))
10. rename.data.frame(., value = X02.relief.ascii)
9. rename(., value = X02.relief.ascii)
8. function_list[[k]](value)
7. withVisible(function_list[[k]](value))
6. freduce(value, `_function_list`)
5. `_fseq`(`_lhs`)
4. eval(quote(`_fseq`(`_lhs`)), env, env)
3. eval(quote(`_fseq`(`_lhs`)), env, env)
2. withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
1. raster("input/02-relief-ascii.asc") %>% mask(country_geo) %>% as("SpatialPixelsDataFrame") %>% as.data.frame() %>% rename(value = X02.relief.ascii)

asifm avatar Jan 03 '20 22:01 asifm

Hi, I had the same issue. Problem was solved for me when I made sure, that the package plyr is not loaded.

Chyvan avatar Mar 06 '20 08:03 Chyvan