Back
myfunction <- function(y){ y <- rnorm(100) mean(y) }myfunction()[1] 0.05248908dir()[1] "myfunction.R"source("myfunction.R")Error in source("myfunction.R") : myfunction.R:2:3: unexpected symbol 1: 2: R version
myfunction <- function(y){
y <- rnorm(100)
mean(y)
}
myfunction()
[1] 0.05248908
dir()
[1] "myfunction.R"
source("myfunction.R")
Error in source("myfunction.R") : myfunction.R:2:3: unexpected symbol 1: 2: R version
I just started learning R programming, any help will be appreciated.. thank you
You can format your code like this to resolve the error:
myfunction <- function() { y <- rnorm(100) mean(y)}
myfunction <- function() {
Hope this answer helps you!
31k questions
32.8k answers
501 comments
693 users