Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save whizzalan/48de8480dde0f341706c40cbcb877d25 to your computer and use it in GitHub Desktop.
Save whizzalan/48de8480dde0f341706c40cbcb877d25 to your computer and use it in GitHub Desktop.

Crontab 部署 R 爬蟲時需要注意的地方

  1. rvest::html_table 需要 import methods,稍微查過僅有 {xml2} -> {testhat} -> {methods}
  2. (測試用),在blogger會變白色....

This thread might shed some light on it. It seems that in some contexts RSCRIPT doesn't load package::methods by default, whereas interactive sessions do load it by default. It seems that the "when" is not clear, but explicitly calling library(methods) for all RSCRIPT executions seems to be the safe bet: can use package interactively, but Rscript gives errors.

感謝 kyle大大 指導,釐清與magrittr無關

echo 'library(magrittr); tt <- list(a=1,b=2); tt %>% .[[1]]' > tt.R && Rscript tt.R

ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment