library(targets)
meta_pattern <- tar_meta(son_files)
meta_branches <- tar_meta(all_of(meta_pattern$children[[1]]))Total number of branches:
library(targets)
meta_pattern <- tar_meta(son_files)
meta_branches <- tar_meta(all_of(meta_pattern$children[[1]]))Total number of branches:
| library(Rvision) | |
| X <- 1920 | |
| Y <- 1080 | |
| corners_screen <- matrix(c(0, Y, | |
| X, Y, | |
| X, 0, | |
| 0, 0), | |
| ncol = 2, byrow = TRUE) |
| library(ggplot2) | |
| library(dplyr) | |
| library(extrafont) | |
| # | |
| # extrafont::font_import("~/Downloads/") | |
| CHANEWEI <- "Chalet-NewYorkNineteenEighty" | |
| # Download data | |
| url <- "https://apitransporte.buenosaires.gob.ar/ecobici/gbfs/stationInformation" |
| library(metR) | |
| library(data.table) | |
| library(ggplot2) | |
| proj <- "+proj=lcc +lon_0=-60 +lat_1=-0 +lat_2=-40" | |
| topo <- GetTopography(ConvertLongitude(-85), | |
| 330, lat.north = 14, lat.south = -58, | |
| resolution = 2/60) |> |
| library(ggplot2) | |
| library(units) | |
| library(sf) | |
| world <- rnaturalearth::ne_countries(returnclass = "sf", scale = 10) |> | |
| st_transform(crs = "+proj=moll") | |
| # Make a hexagonal grid | |
| size <- 1000000 |
| total <- 116653684*1024 # change your total dir size here | |
| folder_size <- function() { | |
| system('du -s "[folder]"', intern = TRUE) %>% # change your dest folder here | |
| strsplit(split = "\t", fixed = TRUE) %>% | |
| .[[1]] %>% | |
| .[1] %>% | |
| as.numeric() | |
| } |
| # This is now available into ggpercentogram. | |
| # https://github.com/eliocamp/ggpercentogram/ | |
| StatQuantileBin <- ggplot2::ggproto("StatQuantileBin", ggplot2::StatBin, | |
| default_aes = ggplot2::aes(x = ggplot2::after_stat(density), y = ggplot2::after_stat(density), weight = 1), | |
| compute_group = function(data, scales, | |
| binwidth = NULL, bins = 30, breaks = NULL, trim = 0, | |
| closed = c("right", "left"), pad = FALSE, | |
| flipped_aes = FALSE, | |
| # The following arguments are not used, but must | |
| # be listed so parameters are computed correctly |
| #' Smooths a 2D field | |
| #' | |
| #' @param x,y Vector of x and y coordinates | |
| #' @param value Vector of values | |
| #' @param kx,ky Proportion of components to keep in the x and | |
| #' y direction respectively. Lower values increased the smoothness. | |
| #' | |
| #' @examples | |
| #' library(ggplot2) | |
| #' # Creates a noisy version of the volcano dataset and applies the smooth |
| # Define the directory where to save the plot data | |
| knitr::opts_chunk$set(plot_data_dir = "plot-data2") | |
| save_plot_data <- function(plot, label = "plot", dir = NULL) { | |
| # If the user didn't set up a dir explicitly, don't do anything | |
| if (is.null(dir)) { | |
| return(invisible(NULL)) | |
| } | |
| if (!dir.exists(dir)) { |
| library(magrittr) | |
| library(ggplot2) | |
| library(rgl) | |
| library(plotly) | |
| set.seed(42) | |
| # Cantidad de puntos por grupos | |
| N <- 20 | |
| # Localización de los grupos |