R Plotly:parcoords plot中的错误
在使用parcoords plot时,我在R中使用plotly时遇到了非常奇怪的错误 例如,使用此处提供的示例: 而我的版本是plotly:R Plotly:parcoords plot中的错误,r,plot,rstudio,plotly,parallel-coordinates,R,Plot,Rstudio,Plotly,Parallel Coordinates,在使用parcoords plot时,我在R中使用plotly时遇到了非常奇怪的错误 例如,使用此处提供的示例: 而我的版本是plotly: 有人经历过同样的问题吗?有解决办法吗 问题出在Rstudio的查看器中。 我建议在代码中添加optionsviewer=NULL。 它禁用RStudio的内部查看器,并在浏览器中打开绘图 library(plotly) options(viewer=NULL) df <- read.csv("https://raw.githubusercont
有人经历过同样的问题吗?有解决办法吗 问题出在Rstudio的查看器中。 我建议在代码中添加optionsviewer=NULL。 它禁用RStudio的内部查看器,并在浏览器中打开绘图
library(plotly)
options(viewer=NULL)
df <- read.csv("https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv")
p <- df %>%
plot_ly(type = 'parcoords',
line = list(color = ~species_id,
colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'))),
dimensions = list(
list(range = c(2,4.5),
label = 'Sepal Width', values = ~sepal_width),
list(range = c(4,8),
constraintrange = c(5,6),
label = 'Sepal Length', values = ~sepal_length),
list(range = c(0,2.5),
label = 'Petal Width', values = ~petal_width),
list(range = c(1,7),
label = 'Petal Length', values = ~petal_length)
)
)
print(p)
问题出在Rstudio的查看器中。 我建议在代码中添加optionsviewer=NULL。 它禁用RStudio的内部查看器,并在浏览器中打开绘图
library(plotly)
options(viewer=NULL)
df <- read.csv("https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv")
p <- df %>%
plot_ly(type = 'parcoords',
line = list(color = ~species_id,
colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'))),
dimensions = list(
list(range = c(2,4.5),
label = 'Sepal Width', values = ~sepal_width),
list(range = c(4,8),
constraintrange = c(5,6),
label = 'Sepal Length', values = ~sepal_length),
list(range = c(0,2.5),
label = 'Petal Width', values = ~petal_width),
list(range = c(1,7),
label = 'Petal Length', values = ~petal_length)
)
)
print(p)
我最近在Linux机器上访问了RStudio服务器。。我在那里也犯了类似的错误。使用optionsviewer=NULL解决了这两种情况下的问题,谢谢!我最近在Linux机器上访问了RStudio服务器。。我在那里也犯了类似的错误。使用optionsviewer=NULL解决了这两种情况下的问题,谢谢!
> packageVersion('plotly')
[1] ‘4.7.1’
library(plotly)
options(viewer=NULL)
df <- read.csv("https://raw.githubusercontent.com/bcdunbar/datasets/master/iris.csv")
p <- df %>%
plot_ly(type = 'parcoords',
line = list(color = ~species_id,
colorscale = list(c(0,'red'),c(0.5,'green'),c(1,'blue'))),
dimensions = list(
list(range = c(2,4.5),
label = 'Sepal Width', values = ~sepal_width),
list(range = c(4,8),
constraintrange = c(5,6),
label = 'Sepal Length', values = ~sepal_length),
list(range = c(0,2.5),
label = 'Petal Width', values = ~petal_width),
list(range = c(1,7),
label = 'Petal Length', values = ~petal_length)
)
)
print(p)