'Error Message: R script error. Error: unexpected symbol in: "# Epilog - Auto Generated # setwd" Execution halted

Any help on this error message in R-script? Im running this in Power BI

Error Message: R script error. Error: unexpected symbol in: "# Epilog

  • Auto Generated # setwd" Execution halted

my r-script:

library(ggplot2)

dataset$`From`<-as.POSIXct(dataset$`From`,format="%Y-%m-%dT%H:%M:%OS")
dataset$`To`<-as.POSIXct(dataset$`To`,format="%Y-%m-%dT%H:%M:%OS")

ggplot(dataset,aes(x=datetime_start, y=dataset$`Room`, color=(Person) +
  geom_segment(aes(x=From,xend=To,yend=dataset$`Room`),size=15) +
  scale_colour_discrete(guide=guide_legend(override.aes=list(size=10))) +
ggtitle("Room reservations for building X") + xlab("") + ylab("") + theme_bw()

Image of error



Solution 1:[1]

Solved the issue with the code below.

library(ggplot2)

dataset$From<-as.POSIXct(dataset$From,format="%Y-%m-%dT%H:%M:%OS")
dataset$To<-as.POSIXct(dataset$To,format="%Y-%m-%dT%H:%M:%OS")

ggplot(dataset, aes(From,Room,colour=Person))+
geom_segment(aes(x=From,xend=To,yend=dataset$Room),size=10)+
ggtitle("START/STOP")

Solution 2:[2]

I ran into a similar Issue

library(ggplot2)

 ggplot( aes_(dataset$index,dataset$Qty)+
   geom_point()+
   geom_path()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 lukas jarmolowski
Solution 2 ChepeMike25