[R] Removing slected values from original vector and definning new vector with the rest?

Phil Spector spector at stat.berkeley.edu
Mon Sep 20 23:28:58 CEST 2010


Anan -
    If you actually want the indices, you can use

seq_along(sampWB)[-censidx]

    If you want the values themselves, then use

sampWB[-censidx]


 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu


On Mon, 20 Sep 2010, Halabi, Anan wrote:

>
> sampleSize <- 20
> shape.true <- 1.82
> scale.true <- 987
> sampWB <- rweibull(sampleSize, shape=shape.true, scale=scale.true)
> print(sampWB)
> censidx <- sample(1:length(sampWB), length(sampWB)*0.3)
> Censored.data <- sampWB[censidx]
>
>
> noncensidx <- defines the rest values of the vector which is not included at Censored.data?
>
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list