Re: [R] Converting Data Types

From: Edward Wijaya <ewijaya_at_gmail.com>
Date: Wed, 21 May 2008 11:27:16 +0900

Hi Mark,

Doesn't seem to work.

x <- unclass(samples)
print (x)

It prints this instead

$V1
[1] 103.9

$V2
[1] 88.5

$V3
[1] 242.9

$V4
[1] 206.6

$V5
[1] 175.7

$V6
[1] 164.4

attr(,"row.names")
[1] 1

And it gives the same error for dgamma function.

On Wed, May 21, 2008 at 11:22 AM, <markleeds_at_verizon.net> wrote:
> unclass or should work , I think. so
>
> nonames<-unclass(samples)
>
>
>
> On Tue, May 20, 2008 at 10:16 PM, Edward Wijaya wrote:
>
>> Hi,
>>
>> How can I convert the matrices to list.
>>
>> For example I have this snippet:
>>
>> samples<-mymatrix[1,]
>> print(samples)
>>
>> which prints:
>>
>> V1 V2 V3 V4 V5 V6
>> 1 103.9 88.5 242.9 206.6 175.7 164.4
>>
>>
>> How can I convert the object "samples" such that it prints:
>> [1] 103.9 88.5 242.9 206.6 175.7 164.4
>>
>> The reason I ask this because I can't use the former
>> "samples" object with this function:
>>
>> llgm <- dgamma(samples, scale=1, shape=2, log = TRUE)

>>
>> which gives this error:
>> e 1374Error in dgamma(x, shape, scale, log) :
>> Non-numeric argument to mathematical function
>>
>> Regards,
>> Edward
>>
>> ______________________________________________
>> 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.
>



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. Received on Wed 21 May 2008 - 02:34:53 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 21 May 2008 - 03:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive