Error message about username when using plotly r package offline [closed] - r

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I'm trying to begin using plotly for R, but I'm having trouble with an error about username. When I try to execute the following code...
test=ggplot(diamonds,aes(x=diamonds$carat,y=diamonds$price))+geom_point()
test2=plotly(test)
plotly(test)
...I get the error message:
Storing 'username' as the environment variable 'plotly_username'
Error in Sys.setenv(plotly_username = username) :
wrong length for argument
I thought plotly's R package was available for use without a username via htmlwidgets. As far as I can tell, I'm using the latest version of plotly, ggplot, and htmlwidgets. What am I doing wrong?

You have to use ggplotly()
So,
test <- ggplot(diamonds,aes(x = carat,y = price))+ geom_point()
ggplotly(test)

Related

R sommer package - version out of date message [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
Using the sommer package quite extensively I often get messages telling my version is out of date even though I'm using the latest version of the package. This can be especially annoying when using sommer in some sort of loop.
Is there a way to avoid these messages?
Hi BartJan welcome to SO!
Have you tried calling the library with quietly = TRUE?
library(sommer,quietly = TRUE)
If that doesn't work, you can make R suppress all messages and warnings:
suppressMessages(suppressWarnings(require(xyz)))

unable to find an inherited method for function ‘Summary’ for signature ‘"data.frame"’ [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I am new to r and am taking a basic course in which the identical code below is run without issue but when I try to run it I get the error below. Any help in resolving this would be much appreciated.
polling <- read.csv(file="C:/Users/njm3546/Desktop/xxx/PollingData.csv", header=TRUE, sep=",")
Summary(polling)
Error Message
unable to find an inherited method for function ‘Summary’ for signature ‘"data.frame"’
R is case sensitive and the function you need is summary (lowercase s).

render function not recognised in R Studio [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
Bit of a newbie for R, R Studio and Markdown but I am trying to use the render() function on my Rmd file and I get the following error:
Error: could not find function "render"
If I try to use the following I get this error:
markdown::render("MarkdownExample.Rmd")
Error: 'render' is not an exported object from 'namespace:markdown'
Still yesterday I could use the render fonction without any problem. Would anyone know what to do?
Thanks in advance
Shouldn't it be rmarkdown::render?

ggplot y labels missing on windows [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
In running a knitr report I noticed that ggplot2 produces a graph without y-ticks/labels on Windows, but does on my Linux/Rstudio install.
The following codes shows the issue for me.
df=data.frame(pos=seq(1,10),data=seq(10,1,-1))
ggplot(data=df, aes(x=pos,y=data))+
scale_y_discrete(breaks=seq(1,10,2))+
geom_line()
Here are the graphs that I get:
Windows
Linux
The breaks show if I remove the scale_y_discrete function call, however I need it for formatting my output.
Is this an environmental issue? A configuration issue?

working directory with spaces in R [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I am having the problem that when I use setwd() with a path that includes spaces (e.g. setwd("C:/Users/Name/My Documents/") I get the error message
"cannot change working directory"
I am a bit suprised that I did not find much about this here or on google - so it must either be a rare error or everyone knows about it I reckon. Either way, is there a why to work around it?
I am using Windows 7 and R version 3.0.2.
R cannot setwd into a directory that it doesn't have 'x' (execute) permission for.
This should work, but if really needed, you can use the function shortPathName.
> shortPathName("C:/Program Files (x86)/Adobe/")
[1] "C:\\PROGRA~2\\Adobe\\"
I can replicate your error if I just copy and paste
setwd("C:/Users/Name/My Documents/")
to console as is. The problem is that R cannot find the specified path. I believe that you should replace "Name" with your username...
If I replace "Name" with my username, it works as expected.

Resources