Skip to content

how to enter a string value

3 messages · alen, Gerrit Eichner, William Dunlap

#
hi,


I want to know just enter a string value

entering a numeric value is make with the function scan () or scan (nmax =
..)

but it does not work for string

my goal is to enter three string: name and surname and date of birth

I try with this code but it shows me errors


print ("enter the name")
name <- scan (nmax = 1)
print ("enter the first name")
firstName <- scan (nmax = 1)
print ("enter the date of birth")
BirthDate <- scan (nmax = 1)




best regards

alen



--
View this message in context: http://r.789695.n4.nabble.com/how-to-enter-a-string-value-tp4649313.html
Sent from the R help mailing list archive at Nabble.com.
#
Alen, look at

?scan

and there particularly at the argument 'what'.

  Hth  --  Gerrit
On Mon, 12 Nov 2012, alen wrote:

            
#
1: A four word string.
Read 1 item
[1] "A four word string."
Please type a line> A line of text
[1] "A line of text"
A line of text.
[1] "A line of text."

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com