Closed paigekouba closed 3 years ago
@paigekouba, can you paste in your code or point us to where your Rmd file is? It would help to be able to track down what is happening. I have a few guesses, but to be sure, just paste a link in here or the copy and paste the bits from your raw Rmd file into a comment be sure to surround things in three back ticks so your code will be formatted nicely ("```"):
# code formats nicely
some_code <- mean(some_numbers)
Sure! I ended up just starting a new Rmd file and I am not having the same problem. I'm not sure why that worked because I think I typed all the code out the same. Here is how it looked in the first document (which still is giving that error). It couldn't even get past the first command, I think.
library(tidyverse)
library(viridis)
library(plotly)
glimpse(storms)
view(storms)
ggplotly(
ggplot(data=storms)+
geom_jitter(aes(x=wind,y=pressure, fill=category), pch=21, alpha=0.5)+
scale_fill_viridis_c()+
theme_bw()+
labs(title="Storm Pressure v. Wind Speed", x = "Wind Speed (mph)", y = "Pressure")
)
https://github.com/gge-ucd/r-davis-in-class-paigekouba/blob/master/script/week9_assignment_PVK.Rmd
Here is the link to the full Rmd. I saved my completed code as week9_assignment_PVK2
Hi @paigekouba,
I think I see the problem...when you insert a code chunk, the quickest and easiest way is to click on the "Insert" button at the top of the Rmd and insert a R chunk, or use a keyboard shortcut like Cmd + Option + i
on a mac or Ctrl + Alt + i
on windows. The result should always look like this, note the single set of squiggly brackets and the three backticks on either end of the chunk:
```{r}
x = 1:12
summary(cars)
Now, if you are goin to add arguments like `echo=TRUE` inside your code chunk, they need to go in the same set of curly brackets. Furthermore, it's a good idea to name your code chunks as well (no spaces, no hyphens, no underscores). So something like this:
````python
```{r MyCodeChunk, warning=FALSE, message=FALSE, echo=FALSE}
x = 1:12
summary(cars)
It looks like the code chunk you have has some extra curly braces and an extra `r` bit, which is throwing your computer off when it tries to interpret things, and it's defaulting to the "bash/sh" option, which won't work anyway because it's `R` code (I think based on your error message).
*Code chunk from your Rmd*
````python
```{r} {r, warning=FALSE, message=FALSE, echo=FALSE}
library(tidyverse)
library(viridis)
library(plotly)
## more code below but truncated for this example
See the difference? Hopefully this helps...
Hi @ryanpeek @MarthaWohlfeil @MCMaurer , I was working on the assignment yesterday and it was running smoothly and I had gotten to the point of producing the graph for the storms data set. It needed some fine-tuning, but it was definitely a graph.. When I opened it up again today, my code chunk for that question is giving me this error message: /bin/sh: r}: command not found
It doesn't happen in the Rmd I made in class, and I can't see anything different about the code. Did I break R?