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
--- | |
title: 'How do I interpret R code in YAML?' | |
author: Jeff Hollister | |
output: | |
pdf_document: | |
fig_caption: yes | |
keep_tex: yes | |
number_sections: yes | |
html_document: null | |
word_document: null |
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
--- | |
name: bob | |
title: example collapse bug | |
date: today | |
--- | |
```{r} | |
#test of the collapse | |
``` |
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
extract_spatial<-function(in_spatial,over_poly=NULL,plot_result=FALSE){ | |
plot(in_spatial) | |
message("Select at least 3 points to define the extent") | |
coords<-locator() %>% | |
data.frame() | |
poly<-rbind(coords,coords[1,]) %>% | |
Polygon() %>% list() %>% | |
Polygons(ID=1) %>% list() %>% | |
SpatialPolygons(proj4string=CRS(proj4string(in_spatial))) | |
idx<-over(poly,in_spatial,returnList=TRUE) %>% unlist() |
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
#load libraries | |
library(jsonlite) | |
library(geojsonio) | |
library(sp) | |
library(lawn) | |
library(rgeos) | |
#create pt | |
pt<-minify('{ | |
"type": "Feature", |
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
devtools::install_github('jhollist/quickmapr') | |
devtools::install_github('ropensci/spocc') | |
install.packages('rgeos') | |
library("quickmapr") | |
library("spocc") | |
library("rgeos") | |
data(lake) | |
## sp bbox to poly | |
bbox_to_sp <- function(sp) { |
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
devtools::install_github("jhollist/quickmapr") | |
devtools::install_github("ropensci/spocc") | |
install.packages("rgeos") | |
library("quickmapr") | |
library("spocc") | |
library("rgeos") | |
library("magrittr") | |
data(lake) | |
## sp bbox to poly |
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(shiny) | |
library(dplyr) | |
library(DT) | |
dat<-data.frame(letters=c(rep("A",15),rep("B",5),rep("C",5))) | |
server<-shinyServer(function(input, output) { | |
#Returns filtered data | |
output$dat_false <- renderDataTable(dat,filter = "top",server = FALSE) | |
#Returns just the currently (?) visible values in the mainPanel |
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
> devtools::test() | |
Loading tidytext | |
Testing tidytext | |
Corpus tidiers: .. | |
dictionary tidiers: | |
LDA tidiers: ................................. | |
Counting pairs: W.......W..W..WW... | |
Sparse casters: ................1 | |
Sparse tidiers: ...... | |
tf-idf calculation: ........... |
OlderNewer