I doing an exerise on RStudio [https://www.slideshare.net/thoi_gian/iris-data-analysis-with-r][1]
tried below command im getting Error: unexpected symbol in "Scatter plot"
Scatter plot plot(iris, col=iris$Species) legend(7,4.3,unique(iris$Species),col=1:length(iris$Species),p ch=1) Lattice library Ggplot2 library
You have copied too much text from the slideshare slide, and as a result you are getting the error because that is not proper syntax. The following should work:
data(iris)
plot(iris, col=iris$Species)
Related
I'm trying to make scatter chart, but error message occurs and can't knit.
{r}
ggplot
(railgun,aes(smile, voteshare)) geom_point()
Then [ Error: unexpected ',' in "(railgun,"] came out.
https://www.rstudio.com/wp-content/uploads/2015/04/ggplot2-cheatsheet.pdf
I referred to left side of page, but it won't work.
I know [,] is the wrong spot, but how can I replace other things?
I frequently get the following warning message when using Plots.jl:
WARNING: No strict ticks found
What does this mean?
MWE: plot(x->1/x,0,1)
If I run:
library(ggplot2)
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
bp<-ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
geom_boxplot()
bp
I see the error: Error in grDevices::col2rgb(colour, TRUE) : invalid RGB specification.
If I run the identical code on my other computer, I get the expected plot. I am guessing that some plotting parameter is the culprit, but I have no idea how to find it. What's going wrong?
The computer that behaves strangely is Mac OS X 10_11_3 running R 3.2.2 via RStudio 0.99.489
Sorry I am late, but the problem is that the function alpha is masked form ggplot2, that's why if you restart R and happen to call alpha after sourcing psych but before ggplot2 it works.
Anyway, the way to solve it is to make explicit that we want the psych function:
reliability = psych::alpha(df)
Restarting R was sufficient to fix the weird behavior. Obviously should have tried that before posting...
Hi im a real self teaching R newbie:
I'm following a GWR tutorial here
but already on first page my code fails at
colours = c(“dark blue”, “blue”, “red”, “dark red”)
Creates a colour palette and at spplot
spplot(map, “Nocars”, cuts=quantile(Nocars), col.regions=colours)
Error: unexpected input in "colours = c(�"
and the same for spplot
Error: unexpected input in "spplot(Nocars, �"
Could you please help, im sure its something silly.
I've created a custom plotting function for a scatterplot with error bars on multiple series using rCharts. I successfully embedded said plot in a shiny application. The first time it shows everything works fine:
However, if I try to update the plot (e.g. by changing some input) the plot does not change and I get the following JS error message on the browser's console:
TypeError: 'undefined' is not a function (evaluating 'this[b].destroy()')
The strange thing is that if I check the plot object (p) it seems fine, e.g. I can plot it in Rstudio and also get a viable html page from it. I guess the problem is somehow that the old plot cannot be removed properly.
I use rCharts v. 0.4.5 and shiny 0.10.2.1 and I have uploaded an example shiny app to github:
https://github.com/mlist/highcharts_scatterplot_example
As extra dependency you will need to install the packages rjson and foreach. You can then run the app with
runGitHub(repo="mlist/highcharts_scatterplot_example")
```
Use renderChart2 rather then renderChart. Replace output$testPlot with :
output$testPlot <- renderChart2({
p <- highcharts.scatterplot.plate(data.frame(seq(1:nrow(iris)),iris[,2], input$error, iris[,5]))
return(p)
})
You can try the change at:
shiny::runGitHub(repo="johndharrison/highcharts_scatterplot_example")