Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# use cases | |
# as a calculator | |
x + 1 | |
# to assign variables | |
x = 5 | |
# calculation w/ variables | |
x + 5 |
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
R --vanilla < "filename.R" # you see output on screen | |
Rscript filename.R # no output, unless explicitly "print"-ed | |
R -e "unlink(*.*)" # executes one R command | |
R -e "rmarkdown::render('filename.Rmd', output_file='../paper/output/filename.pdf')" | |
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
# FINAL CODE | |
import requests | |
from bs4 import BeautifulSoup | |
# Define the URL and user-agent header | |
url = 'https://www.coolblue.nl/tweedekans-product/2191236' | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' | |
'(KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' | |
} |
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
# Setup/initialization | |
library(tidyverse) | |
## Wipe any downloaded files before | |
unlink('*.zip') | |
unlink('*.csv') | |
## Download raw data | |
download.file('https://github.com/hannesdatta/course-dprep/raw/master/content/docs/tutorials/data-preparation/data_without_duplicates.zip', 'data.zip') |
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
--- | |
title: "dPrep Tutorial" | |
output: html_document | |
date: "2023-02-16" | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# This is the R Bootcamp - demo (written by Hannes) | |
1+1 | |
cat("Hello!") | |
name <- 'Hannes' | |
dir.create('data') | |
dir.create('data_output') | |
dir.create('documents') |
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
# Setup | |
# Make selenium and chromedriver work for Untappd.com | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from webdriver_manager.chrome import ChromeDriverManager | |
#driver = webdriver.Chrome() | |
driver = webdriver.Chrome(ChromeDriverManager().install()) |
NewerOlder