[R] missing data in R

Jim Lemon drjimlemon at gmail.com
Sun Aug 2 01:16:58 CEST 2015


Hi Asena,
If you already have microarray data, you can simply change some of the
existing values to NA (datum Not Available). Say you have a toy 10x10
array containing absolute (initial) values:

array_values<-matrix(sample(0:400,100,TRUE),nrow=10)
# create a 10% missing array
array_values_10<-array_values
array_values_10[sample(1:100,10)]<-NA
# next a 20% missing array
array_values_20<-array_values
array_values_20[sample(1:100,20)]<-NA
# and so on

This is possible because a matrix can be indexed as though it was a vector.

Jim


On Sat, Aug 1, 2015 at 10:21 PM, asena ayça özdemir
<a.aycaozdemir at hotmail.com> wrote:
> Hello Mr. FeldesmanI am a master student in biostatistic
> my thesis about missing values in microarray data, but ý can't create any values.
> ý want to create %10, %20,...%90 missing values for all colums in microarray data set .
> Can you help me any code?
>
> thank you for your attention.
>
>
> Asena Ayça ÖzdemirMersin University Biostatistics
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list