gge-ucd / R-DAVIS

Repo for WEBSITE of R for Data Analysis & Visualization in Science, a quarter long course oriented for graduate students in Ecology at UC Davis
https://gge-ucd.github.io/R-DAVIS/
Other
28 stars 13 forks source link

automatic installation of R packages #41

Closed mikoontz closed 5 years ago

mikoontz commented 6 years ago

There are lots of required packages in order to build the website. I'm currently going through the process of building the site, seeing which package is not yet installed, installing that package, then building again. Is there an easy, automated way to do this?

MCMaurer commented 6 years ago

I'd like to try this out, how are you building the site locally? I've never tried doing it before.

MCMaurer commented 6 years ago

Working on this, starting by running grep -r 'library(' R-DAVIS/ and finding all the package names, now I'm just trying to pull them all out

mikoontz commented 6 years ago

Oh, that's a good idea! Here's how to build:

  1. Once you've pulled the latest website version to your machine (make sure it has Ryan's updated .RProj without the WebsitePath line), go to the "Build" tab in the "Environment/History/Git/Build" pane of RStudio.
  2. Under "More" click "Clean all" to remove all derived files from the directory.
  3. Then click "Build website" and all of the .Rmd and .yml etc. will be rendered into html in the docs folder and the site should build. You should be able to open the index.html file to view the site.
ryanpeek commented 6 years ago

I'm merging all patches now and will rebuild and push new updated version up shortly. We could add some initial list of packages which sits in the README (or associated file) that folks can check and use to see if it's installed, if not, then install?

ryanpeek commented 6 years ago

here's a list of packages I've pulled to add to the README (along with a few sentences describing how to build site locally). Can you all (@mikoontz @MCMaurer) take a look and see if you have any others I'm missing?


ggplot2
tidyr
readr
dplyr
purrr
emojifont
viridis
mapdata
maps
measurements
gapminder
broom
gutenbergr
tidytext
patchwork
cowplot
hexbin
geosphere
ggmap
ggthemes
magrittr
leaflet
plotly
knitr```
MCMaurer commented 6 years ago

I had to install emo with devtools::install_github("hadley/emo") as well.

ryanpeek commented 6 years ago

yea I switched that out for emojifont since it does the same thing and doesn't require devtools...

mikoontz commented 6 years ago

@MCMaurer, how does @ryanpeek's list match with yours?

MCMaurer commented 6 years ago

After running grep -horE 'library\(.*?\)' R-DAVIS/ | sed 's/library//g; s/[()]//g; s/\'//g; s/"//g' | grep -Eo '^\w+' | sort | uniq I got this list:

broom
cowplot
dplyr
emojifont
gapminder
geosphere
ggmap
ggplot2
ggthemes
gutenbergr
hexbin
knitr
leaflet
lubridate
magrittr
mapdata
maps
measurements
patchwork
plotly
purrr
readr
tidyr
tidytext
tidyverse
viridis

Looks like it matches Ryan's!

nistara commented 5 years ago

Hey guys, thanks for this great resource for us non-ecology folks too! I'm trying to build the site locally as well and the above shell script somehow didn't work work me. Was able to get the packages with similar versions of it below:

grep -horE 'library\(.*?\)' . | sed 's/library//g; s/[()]//g; s/"//g' | sed "s/\'//g" | grep -Eo '^\w+' | sort | uniq 
# or
grep -horE 'library\(.*?\)' . | sed 's/library//g; s/[()]//g; s/"//g' | grep -Eo '^\w+' | sort | uniq
ryanpeek commented 5 years ago

Thanks Nistara! We probably need to go through and clean up some of the package dependencies a bit...some of these we could probably get away without or simplify the content a bit. But you're sed options seem spot on, I tried this and got a list that seems to match up well.

R

On Fri, Dec 7, 2018 at 6:16 PM Nistara notifications@github.com wrote:

Hey guys, thanks for this great resource for us non-ecology folks too! I'm trying to build the site locally as well and the above shell script somehow didn't work work me. Was able to get the packages with similar versions of it below:

grep -horE 'library(.?)' . | sed 's/library//g; s/[()]//g; s/"//g' | sed "s/\'//g" | grep -Eo '^\w+' | sort | uniq grep -horE 'library(.?)' . | sed 's/library//g; s/[()]//g; s/"//g' | grep -Eo '^\w+' | sort | uniq

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gge-ucd/R-DAVIS/issues/41#issuecomment-445421870, or mute the thread https://github.com/notifications/unsubscribe-auth/AFl9sM7Y1FLRHuRwPnK1dNHMh8yfmH1Gks5u2yD8gaJpZM4X-U_L .

--

"When we try to pick out anything by itself, we find it hitched to everything else in the universe."John Muir (My First Summer in the Sierra, 1911) ----------------------------------------------------- Ryan Peek, PhD! Ecologist Center for Watershed Sciences, UC Davis ryanpeek.github.io http://ryanpeek.github.io @riverpeek 530.754.5351

-----------------------------------------------------