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?
Related
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 8 days ago.
Improve this question
In R studio, I entered the following code:
summary(chickwts)
attach (chickwts)
barplot(chickwts$weight,main="Individual Weights,ylab="Weight")
Am using R 4.2.2 for Windows in R Studio environment. Code was from a course in TGC called "Learning Statistics, Concepts and Applications in R". Error message says comma the problem but this is the code that the course give. Am not sure how to proceed to get the barplot.
Any help appreciated.
I used the code the course gave, and it didn't work.
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 1 year ago.
Improve this question
I updated to R 4.1.0 yesterday (19 May 2021) and initially everything was working fine, I just needed to reinstall all of my User Library packages. Now I am unable to make a simple ggplot.
library(ggplot2)
Cars <- mtcars
ggplot(Cars, aes(x = mpg, y = hp)) +
geom_point()
The ggplot line causes a whole bunch of [21263:21263:20210520,162145.598752:ERROR elf_dynamic_array_reader.h:61] tag not found (see picture).
Looking around, this error is usually associated with nvidia graphics drivers. I have a GeForce2 with what I think is the newest driver (460) but even when I switch to my native Intel graphics driver I get the same error. Has anyone else experienced this yet? Should I revert back to R 3.6.3?
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)
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
Im taking an R programming class that is using the package "matplot" for a demo. I cant find "matplot" in CRAN so i'm assuming it has been replaced/deleted/changed. Is there another package that replaced it?
There is a matplot function within the graphics library. Here's an example from the documentation:
require(grDevices)
matplot((-4:5)^2, main = "Quadratic")
Also, matplot is a plotting library for PHP. Perhaps your instructor could help clarify what is expected.
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 7 years ago.
Improve this question
I am returning to some old code where I had used the following syntax:
y[df$myvar %between% c(1,100)]
but get the error
could not find function "%between%"
This code used to work, and I have updated R in the mean time. any thoughts?
As Pascal pointed out, you should load the package data.table first:
library(data.table)
Then you'll be able to use it.