library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.1.4, proj.4 4.9.3
library(spData)
library(tmap)
tm_shape(nz) +
tm_polygons() +
tm_compass(position = c("left", "top")) +
tm_scale_bar()
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
#------------------------------------------------------------ | |
# REVOLUTION ANALYTICS WEBINAR: INTRODUCTION TO R FOR DATA MINING | |
# February 14, 2013 | |
# Joseph B. Rickert | |
# Technical Marketing Manager | |
# | |
# BIG DATA with RevoScaleR | |
# | |
# Copyright: Revolution Analytics |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>index</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
<style type="text/css"> | |
body { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leafletmap</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js?2"></script> | |
<style type="text/css"> | |
body { |
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
#' A qml create function | |
#' | |
#' This function creates QGIS-like xml object with random colors based on a group variable | |
#' @param obj an object of class SpatialPolygonDataFrame or data.frame | |
#' @param group a grouping variable (colname from obj) | |
#' @param alpha an alpha value (0-1) | |
#' @param colors a character vector with colors (hex colors) | |
#' | |
#' @return xml object | |
#' |
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(sp) | |
library(sf) | |
library(tidyverse) | |
g = SpatialGrid(GridTopology(c(0, 0), c(1, 1), c(3, 3))) | |
p = as(g, "SpatialPolygons") %>% | |
st_as_sf() %>% | |
mutate(id = row_number()) %>% | |
as("Spatial") |
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
#' Shannon's Evenness Index | |
#' | |
#' @description Evenness of patch types (classes) in the landscape | |
#' | |
#' @param landscape Raster* Layer, Stack, Brick or a list of rasterLayers. | |
#' @return tibble | |
#' | |
#' @examples | |
#' lsm_l_shei(landscape) | |
#' lsm_l_shei(landscape_stack) |
library(gganimate)
#> Loading required package: ggplot2
library(ggplot2)
ggplot(diamonds, aes(cut, carat)) +
geom_point(col = "red") +
geom_boxplot() +
transition_layers(layer_length = 1, transition_length = 1)
#> Error in `$<-.data.frame`(`*tmp*`, ".phase", value = "raw"): replacement has 1 row, data has 0
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(sf) | |
library(dplyr) | |
library(spData) | |
str(nz) | |
# change class for one column | |
nz2 = nz %>% | |
mutate(Land_area = as.factor(Land_area)) |
- blog post "Persistent config and data for R packages" - https://blog.r-hub.io/2020/03/12/user-preferences/#not-so-temporary-files3 - https://twitter.com/ma_salmon/status/1295031507648753664
- ceramic - https://github.com/hypertidy/ceramic - https://twitter.com/mdsumner/status/1295185950385950721
- sen2r - https://github.com/ranghetti/sen2r - https://twitter.com/JamesPDuffy/status/1295114112855412737
- tidycensus - https://github.com/walkerke/tidycensus - https://twitter.com/StatSteph/status/1295305125049905154
- datastorr - https://github.com/ropenscilabs/datastorr - https://twitter.com/noamross/status/1295450860118515713
- portalr - https://github.com/weecology/portalr/ - https://twitter.com/Hao_and_Y/status/1295033319386562561
- rdataretriever - https://github.com/ropensci/rdataretriever - https://twitter.com/henrykironde/status/1295084398421966849
- rgbif - https://github.com/ropensci/rgbif - https://twitter.com/BrentPease1/status/1295062968808476672
- bowerbird - https://github.com/ropensci/bowerbird -
OlderNewer