Skip to content

Instantly share code, notes, and snippets.

@magic-lantern
Last active September 29, 2021 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magic-lantern/e32e4bed76bd5873d334087b4eff5bff to your computer and use it in GitHub Desktop.
Save magic-lantern/e32e4bed76bd5873d334087b4eff5bff to your computer and use it in GitHub Desktop.
# can either run this via command-line
# mkdir ~/tmp
# or run this R command
tmpdir <- paste(path.expand("~"), "/tmp", sep="")
dir.create(tmpdir, showWarnings = FALSE)
# setup custom tmpdir - in Eureka default tmpdir will not allow some packages to install properly
cat(paste("TMPDIR=", tmpdir, sep=""), file="~/.Renviron", sep="\n")
# command line tool bq is used to run sql files. Needs to be configured to use same version
# of sql as used in bigquery console
bigquery_settings <- file("~/.bigqueryrc", open = "a")
cat("
[query]
--use_legacy_sql=false
[mk]
--use_legacy_sql=false
", file = bigquery_settings, sep="\n")
close(bigquery_settings)
#
#
# Make sure you first allow CRAN and Github by using the Eureka Limited Internet App
# install remotes package so renv will work
# Wait about 5 - 10 minutes before proceeding. If cannot download from CRAN/Github, wait a few more minutes
#
# Eureka has available a command-line tool to enable outbound internet. These lines will
# open the necessary destinations if those tools are available.
# Input is required, so run these separately in a terminal (either in RStudio 'Terminal' tab
# or the 'Terminal' application in the NoMachine GUI Desktop):
#
# eureka-internet-CRAN-Bioconductor
# eureka-internet-GitHub.com
#
install.packages("remotes")
# quit R and start new R session with project
# lastly follow instructions in console to setup renv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment