Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominik Vogel DominikVogel

View GitHub Profile
@DominikVogel
DominikVogel / here_in_CodeOcean.markdown
Last active May 3, 2021
Use R package here in Code Ocean
View here_in_CodeOcean.markdown

Using the here R package in Code Ocean

here package: https://cran.r-project.org/web/packages/here/index.html

Challenge: Code is run in code subfolder. here things this is the base folder. Subsequent stuff breaks

Solution: Create empty .here file in root directory using Post-Install Script:

  1. Go to Environment -> Post-Install Script -> Edit Post-Install Script
  2. Add touch .here in a new lie at the end of the file
@DominikVogel
DominikVogel / specific_rtweet_token.R
Created Jun 25, 2020
Use specific rtweet token / use token with RScript
View specific_rtweet_token.R
# rtweet tries to automatically detect a token for the Twitter API
# This fails when you run the script from the command line with RScript
# If you have multiple tokens, this script also helps selecting the right token
# Code inspired by https://github.com/samzipper/SkeeterStream/blob/master/TestLookupUsers.R
# Requirements:
# You need to have set up a token with rtweet
# More info: https://rtweet.info/articles/auth.html
# Assumption token is stored at /home/username/