This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Written by Chris Brown at Griffith Uni | |
#Tips for setting up R packages on windows 10 | |
I recommend installing packages to your local drive, not the shared network drive. Though R will default to the network drive (which is "\\\\staff\..."), so some knowledge is required to overcome this. | |
You could also ask IT to bind a letter to your network drive. I've read that works (see here: https://github.com/r-lib/devtools/issues/353) | |
Here's the steps I followed to install packages: | |
Create a shortcut to R on desktop. | |
Right click it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Ask user for sudo password (to be used when needed) | |
read -s -p "Enter Password for sudo: " sudoPW | |
# update CRAN repository below if needed | |
REPO="'https://cran.rstudio.com/'" | |
# Based on the instructions on Dean Attali's website: | |
# https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/#user-libraries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Simulate data | |
# | |
a <- 2 | |
x <- seq(0, 1, length.out = 100) | |
n <- length(x) | |
sigma <- 0.5 | |
set.seed(42) | |
lny <- rnorm(n, mean = a*x, sd = sigma) | |
y <- exp(lny) |