I'm trying to upload an R Script as a file so that when it opens it runs automatically so that the output can be seen, however when I try it opens this and no sign of any output. I don't know if it's significant but the source function doesn't execute the code and just prints the file path? However source with echo does execute the code
I've tried ticking the source on save option but that doesn't seem to work. When I save the link and send it to myself via email to test it, it doesn't run. and when I specifically locate the path through 1. File 2. Source File it says 'path' does not exist. Even though its the exact one I could run and execute through source with echo on R Studio.
#activating package required to read excel dataset
library(readxl)
options(warn = -1)
#irrelevant cols skipped, remaining are classified as numeric or text
soccer_data <- read_excel("Downloads/soccer data.xlsx",
col_types = c("numeric", "text", "skip",
"skip", "skip", "skip", "numeric",
"numeric", "numeric", "numeric",
"numeric", "numeric", "numeric",
"numeric"))
#print statistical summary of data, and first and last 10 rows
summary(soccer_data)
head(soccer_data,10)
tail(soccer_data,10)
sum(complete.cases(soccer_data))