Getting 'unknown symbol' error when using separate() in R [closed] - r

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I have loaded a csv file into r called my_data. But some columns have multiple fields and I want to split them into separate new columns. When executing this command:
separate(data=my_data,col=totals,into=c("Visits" , "Hits", "Pageviews",
"TransactionRevenue", "NewVisits"),sep=”,”)
I get this error message:
Error: unexpected symbol in "separate(data=my_data,col=totals,into=c("Visits" , "Hits", "Pageviews", "TransactionRevenue”, "NewVisits"
I am trying to figure out what is wrong but with no success. Any help?

It looks like the sep= has smart quotes instead of straight quotes. Try changing it to
separate(data=my_data,col=totals,into=c("Visits" , "Hits", "Pageviews",
"TransactionRevenue", "NewVisits"),sep=",")

Related

Error: unexpected ',' in "df = read.csv(("/home/rstudio/IMDB_data.csv" ," [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
df = read.csv(("/home/rstudio/IMDB_data.csv" ,header=T ,fileEncoding='latin1', sep=",")[-2,])
I wrote the above R code to remove the second line in a file, however it is not working.
This process was already shown in a previous example here, But it's giving me error message unexpected : ','
This should work.
df = read.csv("/home/rstudio/IMDB_data.csv" ,header=T ,fileEncoding='latin1', sep=",")[-2,]

unexpected '}' in R Programming [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I trying to use following piece code in R Studio and I'm expecting a result that calculates b for 1:3 times.
for(b in 1:3){+cat(b,"+",b,"=",b+b, "\n")+}
However I keep getting an error:
Error: unexpected '}' in: "cat(b,"+",b,"=",b+b, "\n")+}"
Can anyone help please?
It expects something to add, but there is nothing to the right hand side of +.

Undefined Columns Selected (when using order function) [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have searched for answers to my question and can't seem to find any answer. I am trying to sort my data so that I can first sort by year of birth and then by last name. Here is my code:
ResidentsBD_99_2015_clean < ResidentsBD_99_2015_clean[order(ResidentsBD_99_2015_clean[, birthdate_year],
ResidentsBD_99_2015_clean[, "surname"],
decreasing = FALSE), ]
When I run this code, this is the error message that I recieve:
Error in `[.data.frame`(ResidentsBD_99_2015_clean, , birthdate_year) :
undefined columns selected
You might just be stuck with typos in your code. birthdate_year should be quoted. It also looks like you have a typo in the assign-operator (<-).
In a more general sense, I prefer ordering with dplyr.
library(dplyr)
ResidentsBD_99_2015_clean <- arrange(ResidentsBD_99_2015_clean, birthdate_year, surname)
From what I can see from your code, it might just be the missing - in the assignment and some small syntax problem. Try this:
ResidentsBD_99_2015_clean<- ResidentsBD_99_2015_clean[order(ResidentsBD_99_2015_clean$birthdate_year, ResidentsBD_99_2015_clean$surname),]

unable to find an inherited method for function ‘Summary’ for signature ‘"data.frame"’ [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I am new to r and am taking a basic course in which the identical code below is run without issue but when I try to run it I get the error below. Any help in resolving this would be much appreciated.
polling <- read.csv(file="C:/Users/njm3546/Desktop/xxx/PollingData.csv", header=TRUE, sep=",")
Summary(polling)
Error Message
unable to find an inherited method for function ‘Summary’ for signature ‘"data.frame"’
R is case sensitive and the function you need is summary (lowercase s).

render function not recognised in R Studio [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
Bit of a newbie for R, R Studio and Markdown but I am trying to use the render() function on my Rmd file and I get the following error:
Error: could not find function "render"
If I try to use the following I get this error:
markdown::render("MarkdownExample.Rmd")
Error: 'render' is not an exported object from 'namespace:markdown'
Still yesterday I could use the render fonction without any problem. Would anyone know what to do?
Thanks in advance
Shouldn't it be rmarkdown::render?

Resources