How to write multiple string (names) in R?

Asked

Viewed 44 times

-1

For example I want to write a second name
nome<-c[scan("")]

#insirindo uma sequencia de numeros
  idade<-scan()
  1: 45
  2: 65
  3: 12
  4: 32
  5: 23
  6: 78
  7: 87
  8: 98
  9: 12
  10: 555
  11:    #tecle enter para parar
 #verificando valores 
 idade
 [1] 1: 45 65 12 32 23 78 87 98 12 555

1 answer

0

You actually want to create a vector?!

nome <- c("a", "b", "c", "d")
  • is a string array like in the example : age<-scan()

  • You want to turn this into a data frame?

  • I think I got : name<-scan(what = Character())

  • I tested here, I saw no difference as to the structure. The use of the scan, From what I’ve seen, it only gives you the opportunity to type in your words of interest on the console, but if you do this and you do View(nome) you can see that this is the same result using the c for vector breeding.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.