Skip to content

Instantly share code, notes, and snippets.

sjkiss

Block or report user

Report or block sjkiss

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sjkiss
sjkiss / stats_can_help.R
Created Jan 16, 2019
Error in Statistics Canada's Web Data Service
View stats_can_help.R
#install.packages('rjson')
library(rjson)
#This is the sample URL from your web data help page.
census_url<-'https://www12.statcan.gc.ca/rest/census-recensement/CPR2016.json?lang=E&dguid=2016A000011124&topic=1&notes=0'
#This returns an unexpected character
fromJSON(file=census_url)
View chemicals_management_scrape.R
#Load two libraries
library(xml2)
library(rvest)
#Paste the digit 1 thru 12 into the base URL to create 12 separate URLs, one each for a batch
urls<-lapply(seq(1,12, 1), function(x) paste('http://www.chemicalsubstanceschimiques.gc.ca/challenge-defi/batch-lot-',x,'/index-eng.php', sep=''))
#Check
urls
#read the html code from each batch home page
@sjkiss
sjkiss / package_install
Last active Aug 29, 2015
Install key packages for LSIRM
View package_install
#Packages to be installed
to.install<-c('car', 'plotrix', 'psych')
#Determine Uninstalled Packages
new.packages <- to.install[!(to.install %in% installed.packages()[,"Package"])]
#If the number of uninstalled packages is non-zero, install uninstalled packages
if(length(new.packages)) install.packages(new.packages)
You can’t perform that action at this time.