This file contains hidden or 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: "Research pipeline" | |
output: | |
flexdashboard::flex_dashboard: | |
orientation: rows | |
theme: yeti | |
--- | |
```{r include=FALSE} | |
library(tidyverse) |
This file contains hidden or 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.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¬es=0' | |
#This returns an unexpected character | |
fromJSON(file=census_url) |
This file contains hidden or 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
#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 |
This file contains hidden or 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
#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) |