I hereby claim:
- I am pierreroudier on github.
- I am pierreroudier (https://keybase.io/pierreroudier) on keybase.
- I have a public key whose fingerprint is 4364 5A25 9729 B7B2 3E0E B585 923C 8CA0 4E71 2D37
To claim this, I am signing this object:
| library(sp) | |
| library(raster) | |
| library(ggplot2) | |
| # load example data | |
| data("meuse.grid", package = "sp") | |
| coordinates(meuse.grid) = ~x+y | |
| proj4string(meuse.grid) <- CRS("+init=epsg:28992") | |
| gridded(meuse.grid) = TRUE |
| coords <- structure(list(X = c(1821804.61206496, 1821804.53388462, 1821804.45241005, | |
| 1821804.37093547, 1821803.63766419, 1821803.06404773, 1821801.08230283, | |
| 1821799.67087991, 1821797.16404961, 1821795.58638206, 1821791.81131096, | |
| 1821790.27888289, 1821788.83451778, 1821787.47821557, 1821782.52296569, | |
| 1821780.66793137, 1821779.06061595, 1821775.68962231, 1821770.6783751, | |
| 1821769.31877881, 1821766.85059942, 1821765.23669656, 1821761.92741568, | |
| 1821760.40486898, 1821759.21481077, 1821756.92275687, 1821755.3220282, | |
| 1821753.54846811, 1821751.92468512, 1821750.53215511, 1821749.14621232, | |
| 1821744.7340796, 1821743.43290713, 1821741.17622498, 1821740.47502158, | |
| 1821738.71707379, 1821735.30241579, 1821733.5411775, 1821733.00292668, |
| library(sf) | |
| library(mapview) | |
| sf::st_layers('zzz.gpx') | |
| my_tracks_points <- sf::st_read('zzz.gpx', 'track_points') | |
| my_tracks_line <- sf::st_read('zzz.gpx', 'tracks') | |
| m1 <- mapview(my_tracks_line, map.types = "Esri.WorldImagery") | |
| m2 <- mapview(my_tracks_points, zcol = 'ele', legend = TRUE) |
| library(ggplot2) | |
| library(dplyr) | |
| # Creating dummy data | |
| d <- data.frame( | |
| x = rnorm(100,10,3) | |
| ) %>% | |
| mutate( | |
| y = jitter(x, factor = 800) - 5 * cos(x/10) | |
| ) |
| library(sf) | |
| library(dplyr) | |
| # A function that closes the polygons if | |
| # the first row of coordinates is different than | |
| # the last rows of coordinates | |
| add_first_row <- function(x) { | |
| if (!identical( | |
| as.numeric(x[1,]), | |
| as.numeric(x[nrow(x),]) |
I hereby claim:
To claim this, I am signing this object:
| # First, let's make up some dummy data | |
| # I assume your data is 3 columns: year, the x scale between 0 and 1, and some values | |
| library(plyr) | |
| df <- ldply(1995:2015, function(x) data.frame(year = x, x = seq(0,1, by = 0.1), values = rnorm(11))) | |
| # You can check if my assumptions about your data are correct: | |
| head(df) | |
| # The plotting code begins here |
| # I've been testing Hadley's last dev version of ggplot2 - my interest being mainly triggered | |
| # by the new and shiny geom_raster(), as I'm still convinced a mapping framework based on | |
| # ggplot2 would just be awesome to see (fast and easy production of very nice looking maps). | |
| # | |
| # Somehow I managed to test it using a simple coercition of the SpatialPixelsDataFrame objects | |
| # into data.frames, but for some reasons it seems to be handling the coordinates on a weird way. | |
| # | |
| # Is that a bug? | |
| # |