In the book A first course in statistical programming with R by W. John Braun and Duncan J. Murdoch, there's an exercise asking :
Use a text editor to create a file consisting of the line. Save it to a file called
c(64, 38, 97, 88, 24, 14, 14, 104, 83)
randomdata <- c(64, 38, 97, 88, 24, 14, 14, 104, 83)
Source the fileinto R and confirm the
1) Yes you did it right.
2) You simply have to use
source to execute all the codes lines that are in your file. In this case:
source('randomdata') (assuming you created it in your working directory).
Note: it's better to name your file