R Programming - Converting Strings to Numbers

I have a text file with 100 names that I am trying to concatenate to create a large single line using the following code. However, my output is showing me a number for each name instead of the actual names themselves.

It seems that when these names are converted to character using the paste function, they are converted to numbers. Any help would be greatly appreciated.

input=(read.csv("names.txt"))
final_output1 = paste(input, collapse = '')

      

+3


source to share


1 answer


The read.csv () function has a "stringAsFactors" argument that you can set to FLASE.



input <- read.csv("names.txt", stringsAsFactors=FALSE)

      

+2


source







All Articles