Super newbie with a basic question

I'm learning about pivot_longer and even though I'm copying the code exactly as stated in the video, my RStudio flags all my commas and some of the parenthesis. I'm not sure why. How do I fix this?

It works when I run it on the console, but on the top left window, I get all these messages

Welcome to the forum.

It is hard to tell from a screenshot but the problem may be coming from earlier code. Can you copy ALL your code and paste it here between

```

```

This will give us nicely formatted code to work with.

Is the data you are working with a generally available data set?

Based on the text highlighting, I would guess you have a mismatched double-quote above these lines of code. Green represents comments in your code, and black represents runnable code. You can see on line 97 that once you have the first " in front of wk, then the code highlighting goes back to being correct.

So somewhere above that, you can likely add a " and fix your code. As @jrkrideau points out, if you add your code here we could probably tell you where the problem is.

Best,
Randy

Also, hover over the orange dots with the x in them. They'll show you a (helpful?) error message. You'll probably see something like unexpected token '"`), which may be not so helpful if you're a "super newbie", but they point to where the code stops working. From there, work your way back to where it starts to become green. There's very likely half of pair of quotes "" there.

it says the problem is a ' , '

I do not think we can help without seeing your code.

Please copy it and paste it here between

```

```

probably not; its where your code starts to appear Green rather than Black - due to unbalanced string tokens; This will inevitably cause issues for the R interpreter to understand what you are telling it, and sure enough it will encounter a non-comprehendible ,(comma) which is following in the wake of that unbalanced string issue, but not be the true cause itself.

Your problem fundamentally is unbalanced string tokens, be they doubles (") or singles(') we cant see .

Advice is to go up to where you code mostly appears as black text, and identify where it mostly begins to be green text.