Unexpected symbol error

Hi, I tried to enter code as follow:

ret_df_1 <- mutate_all(ds_cls_1[,‐1], cal_return)
ret_df_1 <- mutate(ret_df_1, Date= ds_cls_1$Date) %>% select(Date, everything()) ret_df_1; head(ret_df_1,3); tail(ret_df_1,3)

But it said there is unexpected symbol in "ret_df_1 <- mutate(ret_df_1, Date= ds_cls_1$Date) %>% select(Date, everything()) ret_df_1", I can't figure where's the unexpected symbol is.

Maybe ret_df_1 should be on its own line, it's just there after a closing bracket.
P.s. when posting code here if you use 3 backticks and r all together without stars it will format the code a bit nicer.

```r
select(Date, everything()) ret_df_1;

When I separate it another error occurs: object 'ret_df_1' not found. :slightly_frowning_face:

At which point does it error ?

ret_df_1; head(ret_df_1,3); tail(ret_df_1,3)
Error: object 'ret_df_1' not found

and immediately before that, this :

ret_df_1 <- mutate(ret_df_1, Date= ds_cls_1$Date) %>% select(Date, everything())

ran without errors ?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.