Mac - Text reading as "Character"

Hello,
I am very new to R. I have a mac running the latest software and am having an issue reading my csv data.

I have a file in both .csv and .txt format. I have some columns that say Yes or No, and other columns with some text without spaces. However, when I import it into R, it just says "Character".

My friend imported it in their PC with no issues, but they already had R installed. I'm wondering if this is a mac issue? Did I forget to install any packages?

Any help would be appreciated!

How are you importing the data? Please show the code.

Are you ending up with a character vector or with a data frame whose columns are characters?

My code is:

data<-read.table(file.choose(),header=T)
summary(data)

To your second question, I know the csv and text file show yes or no, or another word, but when I import it, instead of showing the actual word, everything that has characters (anything other than numbers) just shows "character". However, the headers show just fine (ie. Factor1)

What is the output of the summary function?

I had saved the data from some previous work I was doing to get factors scores for regression. So it shows the column heading, and some factor scores. Is this helpful?

So my code was:
##Combining loadings for 3 factors to the main dataset
data2<- cbind(data, factor$scores)
summary(data2)

and then i got results like this:

FacType2
Length:1640
Mode :character
Mode :character

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.