Jim
Yes that is helpful. Everything goes inside the function
Jeff
-Original Message-
From: Jim Lemon
Sent: Wednesday, August 30, 2023 10:54 PM
To: Jeff Reichman
Cc: r-help@r-project.org
Subject: Re: [R] How to create an R input
HI Jeff,
This might give you a start.
add_stuff
To: r-help@r-project.org
Subject: [R] How to create an R input
[External Email]
R Help
Trying to figure out how to create a simple program that will as the user from
a value input and simply add 5 units to that value then ask the user for
another value and add 45 units to it and on and on
HI Jeff,
This might give you a start.
add_stuff<-function(x) {
x<-xinc<-NA
finished<-FALSE
while(is.na(x))
x<-as.numeric(readline("What number do you want to start? "))
while(is.na(xinc) || !finished) {
xinc<-as.numeric(readline("What number do you want to add? "))
if(is.numeric(xinc)) x
R Help
Trying to figure out how to create a simple program that will as the user
from a value input and simply add 5 units to that value then ask the user
for another value and add 45 units to it and on and on. Then how does one
exit the loop of program?
# Create a function called `add_fi
4 matches
Mail list logo