[BioC] A list, a matrix and impute.knn for making data for SAMR

John Herbert j.m.herbert at bham.ac.uk
Tue Aug 11 14:14:35 CEST 2009


Hello Elin.
Thanks very much for solving my problem, it helps a lot. I knew it would
be simple, just like me :-).
Actually, that is very useful advice as I was wondering if it told you
somewhere what it returned. 
I should read more thoroughly before posting, sorry. 

Kind regards,

John.

-----Original Message-----
From: Elin Axelsson [mailto:elin at ebi.ac.uk] 
Sent: 11 August 2009 13:06
To: John Herbert
Cc: bioconductor at stat.math.ethz.ch
Subject: Re: [BioC] A list, a matrix and impute.knn for making data for
SAMR

Hi John,

if you look in ?impute.knn under the "value" section you will see that 
function returns 3 things; the data matrix, the rng.seed and the 
rng.state. It's returned as list, as you noticed, if you want the data 
matrix you simply write
imputed_data$data.

Hope this helps,

Elin

John Herbert wrote:
> Dear Bioconductors,
>
> Please can you help me with small annoying problem. 
>
>  
>
> I want to impute a matrix that has 4 columns of data. Using the
> impute.knn package returns me a list not a matrix. 
>
>  
>
> Using as.matrix to return the data returned from impute.knn does not
> give me the same matrix structure as I began with?
>
> It must be a simple answer?
>
>  
>
> My code:
>
>  
>
> library(impute);
>
> imputed_data <- impute.knn(normalised_data, k=5);
>
>  
>
>   
>> dim(normalised_data)
>>     
>
> [1] 43376     4
>
>   
>> dim(imputed_data)
>>     
>
> NULL
>
>   
>> class(normalised_data)
>>     
>
> [1] "matrix"
>
>   
>> class(imputed_data)
>>     
>
> [1] "list"
>
>  
>
> Why does impute.knn not return the data as you would sensibly think it
> would, ie in the same format as your microarray data?
>
> Please tell me if I am missing something or the solution?
>
>  
>
> Thanks a lot for any help. 
>
>  
>
> Kind regards,
>
>  
>
> John.
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
http://news.gmane.org/gmane.science.biology.informatics.conductor
>   



More information about the Bioconductor mailing list