0 votes
1 view
in R Programming by (13.4k points)

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

1 Answer

0 votes
by (32.8k points)

You can format your code like this to resolve the error:

myfunction <- function() {

  y <- rnorm(100)

  mean(y)

}

Hope this answer helps you!

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...