There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
Agree with a comment or answer? Like () to up-vote the contribution!
In the introduction to R Syntax under “Calculations” I believe there is an error (unless I’m missing something). The error
Results in “500”
573 - 74 + 1
^ in the above, if we’re working with good old order of operations of “PEMDAS” addition should happen prior to subtraction. So it would be 74+1=75 and then 573-75=498
Or have I missed something?
I know this is a small detail but I became obssesed with it and I’m grateful for your thoughts…
Hello, I entered the following “25 * 4 + 9 / 3” under the notebook.Rmd but when I pressed “Run” I did not get a numeric result. Instead I got a message that says “Did you calculate the equation inside your R notebook?”…I thought notebook.Rmd was the R notebook…am I missing something?
Sorry, for replying so late, but I just noticed your post.
You’ve ignored the sign. 74 is a negative number. If you want to do the addition first, you have to add 1 to -74. That gives you -73. 573 - 73 = 500. Addition and subtraction is essentially a sum of a list of values. You have 3 values here: 573, -74, 1.
Sounds like you may have not entered your code in the correct space, or if you included the quotation marks like you show in your post, that would be an issue as well.
Your code should go where I’ve indicated in the screenshot.
Happy coding!
Apparently (and I’m guessing here), the spaces between the numbers and mathematical signs are important… I had the same issue you had, with same response of “did you calculate…”, and finally had to have code academy “solve for me”. The only difference I could find between what I entered and what code academy displayed were spaces between each value [ 25 * 4 + 9 / 3 ]… if this is what caused the issue, I would think, given that this course is for people with zero experience or background in coding and R, that it would be paramount to communicate the need to use a space… Hoping it only gets better from here.
Codecademy uses something called R Markdown to embed R code. It is basically a way to include commentary and explanations in the same place with your code, and all graphics that it produces. Researchers use it to make their analysis reproducible by other people, and for many other things!
The syntax '''{r} tells R Markdown that it should expect some R code to follow, and another ''' closes the code block. If you’re interested, here’s some info on code chunks from the manual:
Hello, I entered the following “25 * 4 + 9 / 3” under the notebook.Rmd but when I pressed “Run” I did not get a numeric result. Instead I got a message that says “Did you calculate the equation inside your R notebook?”…I thought notebook.Rmd was the R notebook…am I missing something?
This has been raised by few others - could you give me a step by step way how to solve it as I’m new to this and it’s quite frustrating - thank you.
I’ve got little to no experience using R. I’ve only dabbled in the Codecademy course. I found this link which you may find helpful. The short answer to your question though, is yes. The back ticks followed by {r} are are significant. The link explains using R with an html notebook.
Hello, I entered the following “25 * 4 + 9 / 3” under the notebook.Rmd but when I pressed “Run” I did not get a numeric result. Instead I got a message that says “Did you calculate the equation inside your R notebook?”…I thought notebook.Rmd was the R notebook…am I missing something?
Hi there, I also get the Error simlar to saying “Did you enter your code in the Notebook.RND area” and I enetered the code with correct spaces 25 * 4 - 9 / 3
I am a blind text to speech user, using Microsoft Edge and the Jaws screen reader. Jaws announces Notebook.rnd active and gives me an edit box saying “Code Edit Area” where I enter this code, but everytime I press on the Run Code button I get that error, and also thus can’t move onto the next page/step. Is there any space in that edit area I need to move to, they talk about an R block to enter the code, but as I said Jaws only gives me a normal edit box like all web sites with text entry boxes do. Any advise would be highly appreciated.
I ran this same equation in Rstudio and the spaces didn’t matter, whereas without the spaces it would not run on the “notebook.Rmd” version. I have no idea what going on there, but I agree there no way you can skip vital directions like including spaces or not. Its like a password, Is it case sensitive? There is a 100% difference there (if it is case sensitive)