Question: A list, a matrix and impute.knn for making data for SAMR
0
gravatar for John Herbert
10.1 years ago by
John Herbert90
John Herbert90 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]]
microarray impute • 603 views
ADD COMMENTlink modified 10.1 years ago by Elin Axelsson60 • written 10.1 years ago by John Herbert90
Answer: A list, a matrix and impute.knn for making data for SAMR
0
gravatar for Elin Axelsson
10.1 years ago by
Elin Axelsson60 wrote:
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 >
ADD COMMENTlink written 10.1 years ago by Elin Axelsson60
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@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 >
ADD REPLYlink written 10.1 years ago by John Herbert90
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 284 users visited in the last hour