rkclement / studyGroup

A group for the Middlebury community to learn, skill-share, and work collaboratively on coding and open research.
http://rkclement.github.io/studyGroup/
Other
0 stars 1 forks source link

Example Question #5

Open rkclement opened 7 years ago

rkclement commented 7 years ago

This is an Example Question

I'm trying to figure out how to solve one of the supplemental questions from chapter 2. What's wrong with my code?

Using ```r at the beginning and ``` at the end of your code, you can insert code as below:

# Ask for a positive number and return a vector of all the numbers 
# between 1 and the input.

ask <- function() {
  z <- readline("enter a positive number: ")
  z <- as.numeric(z)
  return(1:z)
}
ask()

I've tried running this and it doesn't seem to work!

rkclement commented 7 years ago

Hm. Works for me! Have you tried using print(1:z) rather than return(1:z)?

jalbertmidd commented 7 years ago

Testing

rkclement commented 7 years ago

Test succesful!