I'm launching a simple function inside a project in RStudio for R3.4.0 for Windows 10.
#' TestPlotly
#' @export
#' @importFrom plotly plot_ly
#' @importFrom graphics layout
#' @importFrom magrittr "%>%"
TestPlotly=function()
{
plot_ly(x = 1:10, y = 1:10,type="scatter",mode="lines") %>%
layout(
xaxis = list(title="tr"),
yaxis = list(title="ts")
)
}
I get:
Error in layout(., xaxis = list(title = "tr"), yaxis = list(title = "ts")) :
unused arguments (xaxis = list(title = "tr"), yaxis = list(title = "ts"))
9.
function_list[[k]](value)
8.
withVisible(function_list[[k]](value))
7.
freduce(value, `_function_list`)
6.
`_fseq`(`_lhs`)
5.
eval(quote(`_fseq`(`_lhs`)), env, env)
4.
eval(quote(`_fseq`(`_lhs`)), env, env)
3.
withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
2.
plot_ly(x = 1:10, y = 1:10, type = "scatter", mode = "lines") %>%
layout(xaxis = list(title = "tr"), yaxis = list(title = "ts")) at TestPlotly.R#11
1.
TestPlotly::TestPlotly()
But when I launch under RGui:
library(plotly)
plot_ly(x = 1:10, y = 1:10,type="scatter",mode="lines") %>%
layout(
xaxis = list(title="tr"),
yaxis = list(title="ts")
)
Everything works fine
NB: this time I get a different result under the package, ie no graphics at all, where as the last time I tried, I got graphics without titles on the axis. This why I am asking a similar question this time The question was: R plotly plot_ly function: axis titles don't appear when I call plotly inside a project