r-highcharter

Programmatically create tab and plot in markdown

别来无恙 提交于 2020-12-23 11:05:13
问题 I'm trying to create a dynamic number of tabs in my rmd with some content inside. This one doesn't help. Something like this: --- title: "1" output: html_document --- ```{r } library(highcharter) library(tidyverse) iris %>% dplyr::group_split(Species) %>% purrr::map(.,~{ # create tabset for each group ..1 %>% hchart("scatter", hcaes(x = Sepal.Length, y = Sepal.Width)) }) ``` 回答1: You can set results = 'asis' knitr option to generate the tabs in the map function using cat . Getting Highcharter

Grouped categories for a highcharter heatmap in R

北城余情 提交于 2020-07-22 05:44:10
问题 I'd like to create a heat map using the highercharter package and the open source gapminder dataset in R. However, I'm having difficulty creating an axis with grouped labels. Here is some code on creating a heat map from the highcharter documentation: nyears <- 5 df <- expand.grid(seq(12) - 1, seq(nyears) - 1) df$value <- abs(seq(nrow(df)) + 10 * rnorm(nrow(df))) + 10 df$value <- round(df$value, 2) ds <- list_parse2(df) hc <- highchart() %>% hc_chart(type = "heatmap") %>% hc_title(text =

Use highcharter inside a function

一世执手 提交于 2020-07-19 04:23:51
问题 How do I use highcharter::hchart inside a function? Here is a simple line graph using the hchart function. library(tidyverse) library(lubridate) library(highcharter) library(nycflights13) flights_2 <- flights %>% mutate(dep_mo = ymd(str_c(year, month, "01", sep = "-"))) %>% group_by(dep_mo) %>% summarize(arr_delay = mean(arr_delay, na.rm = TRUE)) hchart(flights_2, type = "line", hcaes(x = dep_mo, y = arr_delay), name = "Average Arrival Delay") When I try to write a function to create the same

Use highcharter inside a function

蹲街弑〆低调 提交于 2020-07-19 04:23:12
问题 How do I use highcharter::hchart inside a function? Here is a simple line graph using the hchart function. library(tidyverse) library(lubridate) library(highcharter) library(nycflights13) flights_2 <- flights %>% mutate(dep_mo = ymd(str_c(year, month, "01", sep = "-"))) %>% group_by(dep_mo) %>% summarize(arr_delay = mean(arr_delay, na.rm = TRUE)) hchart(flights_2, type = "line", hcaes(x = dep_mo, y = arr_delay), name = "Average Arrival Delay") When I try to write a function to create the same

How to change the color of marker-points dynamically based on y-position

£可爱£侵袭症+ 提交于 2020-06-29 04:16:23
问题 I have below interactive plot using highchart js library in R library(highcharter) hchart(data.frame('Date' = seq(Sys.Date(), Sys.Date() - 10, by = '-1 day'), 'Value' = sample(c(-1, 1), 11, replace = T), 'variable' = 'aa') %>% mutate(color = ifelse(Value < 0, "#41c83b", "#E0245E")), "line", zIndex = 1, opacity = 0.9, hcaes(x = Date, y = Value, group = variable), zones = list(list(value = 0, color = hex_to_rgba("#41c83b", 1)), list(color = hex_to_rgba("#E0245E", 1))), marker = list(fillColor =

Customize bubble map with highcharter

纵饮孤独 提交于 2020-05-15 09:27:05
问题 The bounty expires in 2 days . Answers to this question are eligible for a +50 reputation bounty. Damien Dotta is looking for a more detailed answer to this question. Could someone help me to implement this excellent jsfiddle in a "shiny" application with the highcharter package ? https://jsfiddle.net/BlackLabel/nr1y47a9/ I started writing something like this but there are still some problems ... Here's the result : https://pasteboard.co/J7qWN7v.png library(highcharter) library(httr) library

R - leaflet - highcharter tooltip

泄露秘密 提交于 2020-05-11 14:45:53
问题 I want to include a highcharter plot in my leaflet popup. With help from this post Iam able to include a sparkline plot. However, due to my lack of html skills I dont know how to modify the code to work with highcharter . This answer on SO (example from answer) is exactly what I want. I just dont know how to implement in in R . library(leaflet) library(tidyverse) library(htmlwidgets) library(htmltools) library(sparkline) library(highcharter) # Step 1 convert htmlwidget to character

How to get series highlight on hover in highcharter?

限于喜欢 提交于 2020-04-14 10:05:40
问题 Highcharts has this neat feature when hovering over a bar in a column chart, the entire series is highlighted, best seen live here: In the R wrapper highcharter this does not work, why? library(highcharter) library(tidyverse) hc <- highchart() %>% hc_chart(type = "column") %>% hc_xAxis(categories = c('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')) %>% hc_add_series(name = "John", data = c(5, 3, 4, 7, 2)) %>% hc_add_series(name = "Jane", data = c(2, -2, -3, 2, 1)) %>% hc_add_series(name =

How to get series highlight on hover in highcharter?

若如初见. 提交于 2020-04-14 10:00:33
问题 Highcharts has this neat feature when hovering over a bar in a column chart, the entire series is highlighted, best seen live here: In the R wrapper highcharter this does not work, why? library(highcharter) library(tidyverse) hc <- highchart() %>% hc_chart(type = "column") %>% hc_xAxis(categories = c('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')) %>% hc_add_series(name = "John", data = c(5, 3, 4, 7, 2)) %>% hc_add_series(name = "Jane", data = c(2, -2, -3, 2, 1)) %>% hc_add_series(name =

Setting Heat Map Color range as per given Sequence in hcharter

有些话、适合烂在心里 提交于 2020-04-10 04:01:27
问题 Here I am trying to create a heat map using highcharter::hcharter() where less than -1 should be one color (pink), -1 to 1 should be transparent or white color, and greater than +1 should be another color (violet). Presently I have written code using hchart() and used color_stops to change the color format. But this works really well when data is centered to 0, but when it isn't centered to 0 let say from -5 to +7.5 white/transparent color would be shifted to 1 as shown in the image below. a1