rcharts

R shiny app with rCharts

試著忘記壹切 提交于 2019-12-11 09:40:29
问题 I'm able to create this graph with rCharts: library(rCharts) X <- structure(list(Var1 = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), .Label = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"), class = "factor"), Var2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("control", "treatment1", "treatment2"),

rcharts weird numbers in the y axis

吃可爱长大的小学妹 提交于 2019-12-11 08:33:47
问题 The file to generate the graph can be downloaded from https://db.tt/hHYq0mSA. I'm sharing a link because dput generates a huge output. This is what I'm runing require(rCharts) dense<-readRDS("dense.RDS") nPlot(x = "minutes", y = "FBS", data = dense, type = "lineChart") This is what I get What are the numbers (63382626 and 67270968) in the Y axis? how can I make them go away? Thanks! 回答1: The strange digits are the final digits of the min and max of y > options(digits=12) > min(dense[,2]) [1]

Error while plotting data in rchart using HighChart

橙三吉。 提交于 2019-12-11 06:40:43
问题 I am reading data from file and plotting data using rchart/highchart but i am getting following Error. sampledata A B C 2 3 0 4 5 0 4 -3 1 -8 5 1 2 -3 2 -2 -5 2 12 3 3 -4 5 3 R Scitpt: require(devtools) install_github(’rCharts’ ,’ramnathv’) sampledata<-read.csv("data.csv",header=TRUE,sep="\t") h1 <- hPlot(x = sampledata[1,], y = sampledata[2,], data = sampledata, type = "scatter", group=sampledata[3,]) Error in .subset2(x, i, exact = exact) : invalid subscript type 'list' How can i plot

rCharts - Hide all series EXCEPT selected series from legend

不问归期 提交于 2019-12-11 04:37:54
问题 I like to do the reversal of the default logic. When I click on a series in the legend, I would like to hide all series except the selected one. I know I have to use JS for this. The solutions I found did not work for me. I found this solution but when I modify my code for R like this: legendItemClick = "#! function(event) { if (!this.visible) return false; var seriesIndex = this.index; var series = this.chart.series; for (var i = 0; i < series.length; i++) { if (series[i].index !=

Manually set point colors in rCharts + polychart

我的未来我决定 提交于 2019-12-10 23:47:03
问题 I try to build a chart using rCharts and polychart frontend: dtf <- data.frame(x=c(1, 2, 3, 4, 5), y=c(4, 5, 6, 3, 5), label=c('one', 'two', 'one', 'two', 'two')) color.mapping <- list(one='#ff2385', two='#229922') p2 <- rPlot(x='x', y='y', data=dtf, type='point', color='label') print(p2) I would like to have a control over the point colors by either using some sort of discrete mapping (like in the example above) or using some other logic. How is that done EDIT following the Ramnath's answer

Incorrect output sankey diagram when using shiny

那年仲夏 提交于 2019-12-10 23:38:25
问题 When I create a sankey diagram in a regular R session the output looks ok. The tooltip shows an arrow between the connections: require(rCharts) require(rjson) links <- matrix(unlist( rjson::fromJSON( file = "http://bost.ocks.org/mike/sankey/energy.json" )$links ),ncol = 3, byrow = TRUE) nodes <- unlist( rjson::fromJSON( file = "http://bost.ocks.org/mike/sankey/energy.json" )$nodes ) links <- data.frame(links) colnames(links) <- c("source", "target", "value") links$source <- sapply(links

No auto resize of yaxis of highcharts in shiny

家住魔仙堡 提交于 2019-12-10 23:00:10
问题 I would like to include a highchart plot that automatically resizes its y-axis when groups are selected or deselected into a shiny application. The following plot works fine in the viewer pane of Rstudio library(rCharts) dat <- data.frame(expand.grid(group = letters[1:3], x = letters[4:6]), y = c(0.1,1:8)) hPlot(x = "x", y = "y", groups = "group", data = dat, type = "line") but it does not work, when I include it into a shiny application: library(shiny) runApp(shinyApp( ui = fluidPage(

label above points with rChart

血红的双手。 提交于 2019-12-10 19:56:52
问题 I have a graph which i create with nPlot, i have two variable for X and Y axis and i want to add a third variable which i could see when I point my dots on the graph. For example, if a have X = age, Y = tall and Z = name, i want to be able to see changes of the tall depending on the age with the the name of the different person above dots. Here is an example : library(rCharts) age <- c(1:20) tall <- seq(0.5, 1.90, length = 20) name <- paste(letters[1:20], 1:20, sep = "") df <- data.frame(age,

Add Unique Links to all Data Points in Graph with rCharts

不羁的心 提交于 2019-12-10 19:04:28
问题 I'm using rCharts to create a scatterplot that displays ratings that I have calculated over time. I have more information for each individual data point (rating) and would like to have each data point on the graph link to a unique page with more information about that specific data point. For example: I would like to be able to hover over the first data point on the graph and click on it to go to a specific page (http://www.example.com/info?id=1) that provides more information about that

rCharts plot won't appear in shiny app using dimple.js

好久不见. 提交于 2019-12-10 13:01:08
问题 I came along with this problem, that rCharts plot won't show in my shiny app. I found this example which perfectly suits my needs. Even though this chart works perfectly while just plotting in R, in shiny it is an blank page. I am not sure what is wrong with it. Firstly, I am not sure if I am choosing right library in showOuput() , but I didn't find any better solution. I am trying to plot it more sophisticated app, however, I reproducing my simple app code below of server: server.R library