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
# To run this script on computer with R installed: | |
# Open the command line in the folder where the script is saved. | |
# Make sure it is saved as "arise-720-reg.csv" (Overwrite any old version of the file) | |
# At the prompt, run: | |
# | |
# Rscript arise-720-reg.csv | |
# | |
# If run for the first time, an internet connection may be rerquired to download required packages. | |
# | |
tidypack <- "tidyverse" |
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
# Socket connections | |
# Client side | |
# http://blog.corynissen.com/2013/05/using-r-to-communicate-via-socket.html | |
client <- function(){ | |
while (TRUE) { | |
con <- socketConnection(host = "localhost", port = 6011, blocking = TRUE, | |
server = FALSE, open = "r+") | |
f <- file("stdin") | |
open(f) |
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
.Rhistory |
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
# install-pssqlite.ps1 | |
# Copyright (c) 2018 Victor Ordu. All rights reserved. | |
# See LICENSE for details. | |
Write-Verbose "Checking for avaiablity of PSSQLite Module" | |
# Check if SQLite is (properly) installed | |
if(-not $ENV:Path.Contains('sqlite')) { | |
Write-Error "'sqlite3' does not exist or is not on system PATH." |
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
# Inspired by https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-covid-19-cases-worldwide | |
# System requirements: Recent version of R e.g. R-3.6.x (www.r-project.org) | |
# | |
# Running the script: | |
# 1. From the command line: Navigate to directory where script is saved and | |
# there run this command: | |
# Rscript covid-ecdc.R | |
# | |
# 2. From the R console: Call the `source()` function using the relative or |
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
# Why 'glue' and not 'paste' or 'sprintf' | |
# adapting the example | |
library(microbenchmark) | |
library(glue) | |
name <- "Fred" | |
age <- 30 | |
anniversary <- as.Date('1991-10-12') |
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
## -- Makefile -- ## | |
## | |
## MIT License | |
## | |
## Copyright (c) 2019 Victor Ordu | |
## | |
## -------------- ## | |
ROOTDIR = ./ | |
DWNDIR = $(ROOTDIR)downloads/ |
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
if (!requireNamespace("remotes")) | |
install.packages("remotes", repos = "https://cran.rstudio.com") | |
remotes::install_github("DevSolutionsLtd/AriseNg/ariseng") | |
library(ariseng) | |
fetch_settings() | |
fetch_dependencies() | |
DataEntry::DataEntry() |
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
# titanic.R | |
## An R Script on simple exploration of the Titanic dataset | |
## In RGui, to run an R script's line hold CTRL + R | |
## Download the dataset into the working directory | |
# Check the working directory, | |
getwd() |
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
# Converting Date Entries in a CSV file back to POSIX style (after being mucked up by MS Excel) | |
# Note: The first column is for Dates | |
Param( | |
[string]$file, | |
[switch]$Detailed | |
) | |
$tempfile = New-TemporaryFile |