Thanks for all your help. I found adding the 'stringsAsFactors' condition
solved the problem.
On 1 June 2010 17:09, Joris Meys wrote:
> Hi Jessica,
>
> this tells me that your text is saved as a factor.
> Try :
> names <- read.csv(file="Names.csv",stringsAsFactors=F)
>
>
> Cheers
> Joris
>
> O
Hi Jessica,
this tells me that your text is saved as a factor.
Try :
names <- read.csv(file="Names.csv",stringsAsFactors=F)
Cheers
Joris
On Tue, Jun 1, 2010 at 11:04 AM, Jessica Queree
wrote:
> My issue relates to adding text to a matrix and finding that the text is
> converted to a number.
>
Jessica,
Two further comments:
1. When you read your data, your character vectors are
stored as factors; is that what you want?
2. You may be better off using a list.
-Peter Ehlers
On 2010-06-01 7:47, Sarah Goslee wrote:
On Tue, Jun 1, 2010 at 5:04 AM, Jessica Queree
wrote:
My issue re
On Tue, Jun 1, 2010 at 5:04 AM, Jessica Queree
wrote:
> My issue relates to adding text to a matrix and finding that the text is
> converted to a number.
>
A matrix can only hold one type of data. Since you started with character,
that's what you get.
A dataframe can hold different types of data
My issue relates to adding text to a matrix and finding that the text is
converted to a number.
This is the section of code I'm having trouble with:
# First, I load in a list of names from a .csv file to 'names'
names <- read.csv(file("Names.csv"))
# Then I define a matrix which will be p
5 matches
Mail list logo