Re: [R] Generating Progressively censored samples

2015-07-27 Thread LiuNing
try these:




dweibull(x, shape, scale = 1, log = FALSE)
pweibull(q, shape, scale = 1, lower.tail = TRUE, log.p = FALSE)
qweibull(p, shape, scale = 1, lower.tail = TRUE, log.p = FALSE)
rweibull(n, shape, scale = 1)



-- Original --
From:  Maram SAlem;marammagdysa...@gmail.com;
Date:  Mon, Jul 27, 2015 10:07 PM
To:  r-helpr-help@r-project.org; 

Subject:  [R] Generating Progressively censored samples



Dear All,

Is there some built-in function in R that can be used to generate
progressively censored sample from a certain distribution, for example, the
Weibull distribution? OR Do I have to write the code of the algorithm
myself?

Thanks for helping.
Maram Salem

[[alternative HTML version deleted]]

__
R-help@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.
[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Judging if a matrix contains any NA

2015-07-26 Thread LiuNing
 all(is.na(a)) [1] FALSE

 

 -- Original --
  From:  Steven Yen;sye...@gmail.com;
 Date:  Mon, Jul 27, 2015 09:10 AM
 To:  r-help mailing listr-help@r-project.org; 
 
 Subject:  [R] Judging if a matrix contains any NA

 

How do I judge if a matrix contain any NA or otherwise non-missing, 
non-numerical?
In the following, I would like to deliver ONE logical of TRUE or FALSE, 
rather than a 4 x 4 matrix containing TRUE or FALSE. Thank you.

  a-matrix(1:16,nrow=4)
  diag(a)-NA
  a
  [,1] [,2] [,3] [,4]
[1,]   NA59   13
[2,]2   NA   10   14
[3,]37   NA   15
[4,]48   12   NA
  is.na(a)
   [,1]  [,2]  [,3]  [,4]
[1,]  TRUE FALSE FALSE FALSE
[2,] FALSE  TRUE FALSE FALSE
[3,] FALSE FALSE  TRUE FALSE
[4,] FALSE FALSE FALSE  TRUE

__
R-help@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.
[[alternative HTML version deleted]]

__
R-help@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.