r

Create hexagonal grid over city and associate with lon / lat points (in R)

允我心安 提交于 2021-02-09 08:34:19
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Create hexagonal grid over city and associate with lon / lat points (in R)

懵懂的女人 提交于 2021-02-09 08:33:32
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Difference between AUPRC in caret and PRROC

南笙酒味 提交于 2021-02-09 08:33:26
问题 I'm working in a very unbalanced classification problem, and I'm using AUPRC as metric in caret. I'm getting very differents results for the test set in AUPRC from caret and in AUPRC from package PRROC. In order to make it easy, the reproducible example uses PimaIndiansDiabetes dataset from package mlbench: rm(list=ls()) library(caret) library(mlbench) library(PRROC) #load data, renaming it to 'datos' data(PimaIndiansDiabetes) datos=PimaIndiansDiabetes[,1:9] # training and test set.seed(998)

Create hexagonal grid over city and associate with lon / lat points (in R)

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-09 08:33:13
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Difference between AUPRC in caret and PRROC

蓝咒 提交于 2021-02-09 08:32:47
问题 I'm working in a very unbalanced classification problem, and I'm using AUPRC as metric in caret. I'm getting very differents results for the test set in AUPRC from caret and in AUPRC from package PRROC. In order to make it easy, the reproducible example uses PimaIndiansDiabetes dataset from package mlbench: rm(list=ls()) library(caret) library(mlbench) library(PRROC) #load data, renaming it to 'datos' data(PimaIndiansDiabetes) datos=PimaIndiansDiabetes[,1:9] # training and test set.seed(998)

R ggplot: How can I create conditional labeling for a continuous axis ticks

*爱你&永不变心* 提交于 2021-02-09 08:31:55
问题 I would like to conditionally alter the color/face/etc of a continuous tick mark label using logic instead of hard coding. For example: library(tidyverse) library(viridis) xx=rpois(1000,lambda = 40) y=density(xx,n=3600,from=0) ggplot(data.frame(x = y$x, y = y$y), aes(x, y)) + geom_line() + geom_segment(aes(xend = x, yend = 0, colour = y)) + scale_color_viridis() + labs(y='Density',x='Count',colour='Density')+ geom_vline(xintercept=40,color='red') + scale_x_continuous(breaks=c(0,40,seq(25,100

R ggplot2 using ..count.. when using facet_grid

半世苍凉 提交于 2021-02-09 08:31:11
问题 I am using R studio in Ubuntu, with standard updated R and ggplot2 I try to create a histogram in ggplot, and to separate the data by groups. I need the plot's y axis to say the frequency of each bin in the subgroup that was split by the facet grid. for example if i have two entries in the data a group 1 1 2 2 I need to use facet_grid to split by group, and then to show that a has one bar for 1 that is 100% percent of the examples in group 1 and vice versa. I found out that the way to do it,

R ggplot: How can I create conditional labeling for a continuous axis ticks

邮差的信 提交于 2021-02-09 08:30:29
问题 I would like to conditionally alter the color/face/etc of a continuous tick mark label using logic instead of hard coding. For example: library(tidyverse) library(viridis) xx=rpois(1000,lambda = 40) y=density(xx,n=3600,from=0) ggplot(data.frame(x = y$x, y = y$y), aes(x, y)) + geom_line() + geom_segment(aes(xend = x, yend = 0, colour = y)) + scale_color_viridis() + labs(y='Density',x='Count',colour='Density')+ geom_vline(xintercept=40,color='red') + scale_x_continuous(breaks=c(0,40,seq(25,100

R ggplot: How can I create conditional labeling for a continuous axis ticks

こ雲淡風輕ζ 提交于 2021-02-09 08:30:27
问题 I would like to conditionally alter the color/face/etc of a continuous tick mark label using logic instead of hard coding. For example: library(tidyverse) library(viridis) xx=rpois(1000,lambda = 40) y=density(xx,n=3600,from=0) ggplot(data.frame(x = y$x, y = y$y), aes(x, y)) + geom_line() + geom_segment(aes(xend = x, yend = 0, colour = y)) + scale_color_viridis() + labs(y='Density',x='Count',colour='Density')+ geom_vline(xintercept=40,color='red') + scale_x_continuous(breaks=c(0,40,seq(25,100

R ggplot: How can I create conditional labeling for a continuous axis ticks

久未见 提交于 2021-02-09 08:30:16
问题 I would like to conditionally alter the color/face/etc of a continuous tick mark label using logic instead of hard coding. For example: library(tidyverse) library(viridis) xx=rpois(1000,lambda = 40) y=density(xx,n=3600,from=0) ggplot(data.frame(x = y$x, y = y$y), aes(x, y)) + geom_line() + geom_segment(aes(xend = x, yend = 0, colour = y)) + scale_color_viridis() + labs(y='Density',x='Count',colour='Density')+ geom_vline(xintercept=40,color='red') + scale_x_continuous(breaks=c(0,40,seq(25,100