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
# Data file is as provided | |
data <- read.delim("data_02.txt",header=FALSE,sep=" ") | |
# Simple lsit to look up scores for Rock/Paper/Scissors | |
scores <- list(X=1, Y=2, Z=3) | |
# Look-up matrix for win/lose/draw conditions, R/P/S in rows/columns | |
WLD <- matrix(c(3,0,6, | |
6,3,0, | |
0,6,3),nrow=3) |
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
<html><head><title>Test Page</title> | |
<script type="text/javascript"> | |
// Example POST method implementation: | |
async function postData(url = '', data = {}) { | |
const response = await fetch(url, { | |
method: 'POST', // *GET, POST, PUT, DELETE, etc. | |
mode: 'no-cors', // no-cors, *cors, same-origin | |
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached | |
credentials: 'same-origin', // include, *same-origin, omit |
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
library(tidyverse) | |
library(plumber) | |
library(sf) | |
library(geojson) | |
register_serializer("geojson", serializer_geojson, verbose = TRUE) | |
#* @serializer geojson | |
#* @get /points | |
points <- function() { |
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
library(tickle) | |
x11(type = 'dbcairo', antialias = 'none') | |
dev.control(displaylist = 'inhibit') | |
df = data.frame(x=runif(10,-1,1),y=runif(10,-1,1),size=rep(1,10)) | |
size <- reactive_dbl(value=6) | |
rate <- reactive_dbl(value=10) |
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
# gdalinfo for a large, integer raster: | |
Driver: GTiff/GeoTIFF | |
Files: r_vegmax.tif | |
Size is 34269, 31580 | |
Coordinate System is: | |
PROJCS["unknown", | |
GEOGCS["unknown", | |
DATUM["Unknown_based_on_GRS80_ellipsoid", | |
SPHEROID["GRS 1980",6378137,298.2572221010042, |
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
remove_invalid_poly <- function(xx){ | |
to_fix=c() | |
for(i in 1:nrow(xx)){ | |
mn <- min(sapply(st_geometry(xx)[[i]], function(x) nrow(x[[1]]))) | |
if(mn < 4){ | |
to_fix <- c(to_fix,i) | |
} | |
} | |
for(fix_list in to_fix){ |
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
library(tidyverse) | |
library(purrr) | |
library(readxl) | |
library(jsonlite) | |
# Read your spreadsheet | |
input <- read_excel("Book1-2.xlsx") | |
# Take your column C and put it into a list, by interpreting the JSON | |
data <- map(input$context,fromJSON) |
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
library(tidyverse) | |
library(purrr) | |
# Make a list that looks a bit like yours | |
# It has two entries | |
# Each entry has two "normal fields (application, user) - which have different lengths | |
# And a third field "custom" which contains the weird, staggered dataframe | |
data <- list() |
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
deb https://qgis.org/ubuntu-ltr focal main | |
deb-src https://qgis.org/ubuntu-ltr focal main | |
deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ | |
deb-src https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/ |
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 you don't have them installed, install ggmap and ggplot2 packages | |
install.packages("ggmap") | |
install.packages("ggplot2") | |
# Load these packages | |
library(ggmap) | |
library(ggplot2) |