I am trying to create a workbook in Kaggle with the code I wrote in RStudio. It worked just fine in RStudio but then when I try to run it in Kaggle I keep getting this message. Idk if I have to make my content in RStudio into a markdown file first? Here is the dataset:
So, below is the code to change the ActivityDate from a character to a date and a column for weekday.
class(activity2$ActivityDate) activity2 <- activity2 |> mutate("ActivityDate" = mdy(ActivityDate), Weekday = wday(ActivityDate, label = TRUE)) class(activity2$ActivityDate) print(activity2$Weekday) class(sleep$SleepDay) sleep <- sleep |> mutate("SleepDay" = as.Date(SleepDay, format = "%m/%d/%Y %H:%M:%S")) class(sleep$SleepDay) head(sleep, 3) head(activity2, 3)
This is the Error I keep getting. I have tried wrapping ActivityDate and SleepDate in "" but get the same error. I have also tried taking the '>' out after the pipe but get an error. Any ideas on how to fix this? I cant move forward without it being fixed.
Error in parse(text = x, srcfile = src): :5:25: unexpected '>'
5: activity2 <- activity2 |>