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
| db2se create_srs testdb -srsName NZTM -srsID 2193 -xScale 500 -yScale 500 -xMin 900000 -xMax 1.8014399E13 -yMin 4000000 -yMax 1.8014403E13 -zMin 0 -zMax 9.0071993E15 -mMin 0 -mMax 9.0071993E15 -coordsysName \"NZGD_2000_NEW_ZEALAND_TRANSVERSE_MERCATOR\" -description 'SRS NZTM' |
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
| // Assumes you've installed | |
| // * the free IBM docker db2 edition | |
| // * ibm_db for node: https://github.com/ibmdb/node-ibm_db | |
| // Brings back multiple records as well. Found on the net can't remember where - oh, lots of js docs here: https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md | |
| import * as db2 from 'ibm_db'; | |
| let cn: string = "DRIVER={DB2};DATABASE=testdb;HOSTNAME=127.0.0.1;UID=db2inst1;PWD=password;PORT=50000;PROTOCOL=TCPIP"; | |
| db2.open(cn, function(err: any, conn: any){ | |
| if (err) return console.log(err); | |
| conn.query('select 1 from sysibm.sysdummy1', function (err: any, data: any) { |
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
| remove.packages("rlang") | |
| remove.packages("tibble") | |
| rlangUrl <- "https://cran.r-project.org/bin/windows/contrib/4.0/rlang_1.0.2.zip" | |
| install.packages(rlangUrl, repos=NULL, type="binary") | |
| tcltkUrl <- "https://cran.r-project.org/bin/windows/contrib/4.0/tcltk2_1.2-11.zip" | |
| install.packages(tcltkUrl, repos=NULL, type="binary") | |
| knitrUrl <- "https://cran.r-project.org/bin/windows/contrib/4.0/knitr_1.38.zip" |
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
| tcltkUrl <- "https://cran.r-project.org/bin/windows/contrib/4.0/tcltk2_1.2-11.zip" | |
| install.packages(tcltkUrl, repos=NULL, type="binary") | |
| # tkplotUrl <- "https://cran.r-project.org/bin/windows/contrib/4.0/tcltk2_1.2-11.zip" | |
| # install.packages(tkplotUrl, repos=NULL, type="binary") | |
| # library(tkplot) | |
| knitrUrl <- "https://cran.r-project.org/bin/windows/contrib/4.0/knitr_1.38.zip" | |
| install.packages(knitrUrl, repos=NULL, type="binary") |
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
| ################################################################################## | |
| # Import school locations | |
| # Import some areas | |
| # Join counts | |
| # write out | |
| library(readxl) | |
| library(writexl) | |
| library(sf) |
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
| library(tidyverse) | |
| library(readr) | |
| library(ggmap) | |
| library(ggplot2) | |
| library(readxl) | |
| library(plotly) | |
| library(here) | |
| library(httr) |
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
| library(readr) | |
| library(stringr) | |
| library(stringi) | |
| em <- read_csv("C:/somewhere/some.csv") | |
| em$Time <- paste( | |
| paste(str_sub(em$`Date & Time`, 7, 10), str_sub(em$`Date & Time`, 4, 5), str_sub(em$`Date & Time`, 1, 2), sep="/"), | |
| str_sub(em$`Date & Time`, -8), sep = " " | |
| ) |
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
| # refer to https://gis.stackexchange.com/questions/110117/counting-number-of-points-in-polygon-using-r/270479#270479 | |
| # for original code example | |
| # Load libraries ---------------------------------------------------------- | |
| library(raster) | |
| library(sf) | |
| library(dplyr) | |
| # Get sample data --------------------------------------------------------- |
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
| ################################################################################## | |
| # Import liquor licencing data, geocode and plot | |
| # Plot on a NZ map | |
| # Show a regional view - some demographics eg population density at SA2 | |
| # Import the public NZ Police aggregated crime data | |
| # Look at crime harm regional cf liquor outlet distribution | |
| # | |
| library(readxl) | |
| library(rgdal) |
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
| (* | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Questionnaire type="referee"> | |
| <Section id="referee" label="Your details"> | |
| <Section id="identity" label="Identity"> | |
| <Input id="name" label="Referee name"> | |
| <Input id="firstName" label="First name">Douglas</Input> | |
| <Input id="middleName" label="Middle name">Neil</Input> | |
| <Input id="surname" label="Surname">Adams</Input> | |
| </Input> |