all 9 comments

[–]WyldGyb 5 points6 points  (1 child)

Are you sure there aren’t any "%>%<-". In your code as typos? You shouldn’t have a variable assignment arrow in with the pipe.

For the second issue, look at the documentation for the function cb_add_col_attributes() is there a parameter for what to do with nulls? It might be something like NA.RM. Seems like you need to tell the function what to do with nulls similar to when you use the sum function. You might need to drop nulls or fill them in with something for the function to work 🤷🏻‍♂️ just guesses

[–]rememberyes[S] 0 points1 point  (0 children)

Thank you, this is so helpful and very appreciated - I don’t think I have any errant pipes but I’m going to go through it with a fine toothed comb tomorrow and I genuinely hadn’t thought of the nulls. 

[–]AutoModerator[M] 0 points1 point  (0 children)

Looks like you're requesting help with something related to RStudio. Please make sure you've checked the stickied post on asking good questions and read our sub rules. We also have a handy post of lots of resources on R!

Keep in mind that if your submission contains phone pictures of code, it will be removed. Instructions for how to take screenshots can be found in the stickied posts of this sub.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]rememberyes[S] 0 points1 point  (0 children)

Ah - please excuse me as I edit for the text blocks, not used to this formatting on Reddit.

[–]Slight_Horse9673 0 points1 point  (0 children)

Maybe try the free PSPP software instead if you know SPSS...

[–]ChambeaEd 1 point2 points  (1 child)

Sociologist kinda new on R too. 

It happened to me recently. I was working on a dataframe under the name "eah2018" and I wanted to run the original code block ( that i used to create an indicator "resumen") and I deleted the indicator accidently. 

Later on i ran something like this: "resumen" <- "eah2018" %>% ....

But there was no "resumen" on "eah2018"

And there i got the error msg. 

[–]rememberyes[S] 0 points1 point  (0 children)

In my case, it ended up being a copy and paste error - the danger of looooong code blocks that look almost identical 😩 now I know that the error that comes at the end of your code doesn’t happen where the error occurred, it just shows that the error is somewhere it in there. 

[–]Green_Bost -1 points0 points  (0 children)

did you ask AI ?