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

Elin Axelsson elin at ebi.ac.uk
Tue Aug 11 14:05:54 CEST 2009


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