Message-ID: <AF118DFF-489C-41FE-8177-D863B3FDD96E@comcast.net>
Date: 2008-12-24T14:26:35Z
From: David Winsemius
Subject: Using 'cat' on data frame
In-Reply-To: <73f827b50812232335k6e405dd8k1d843b8db701a7b1@mail.gmail.com>
On Dec 24, 2008, at 2:35 AM, Gundala Viswanath wrote:
> Dear all,
>
> I have the following data frame:
>
>> raw.count
> Var1
> Freq
> 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 707
> 2 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC 14
> 3 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT 3
>
> But why when printint it using 'cat', it doesn't print
> the desired string "AAA" ?
>
>> cat(raw.count$Var1, "\n")
> 1 2 3
>
> What's wrong with my cat command above.
"What's wrong" is that Var1 is a factor rather than a character
vector. Veslot's answers provide the proper method for dealing with
that situation.
--
David Winsemius
>
>
>
>
> - Gundala Viswanath
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.