Re: [R] Double Roop

2015-06-30 Thread Peter Maclean via R-help
 Hi EverybodyI am trying to make an object with  length(a) * length(b) element  using a double loop. But I am getting the last part only.  A simple script is a <- c("A-AA", "B-BB", "C-CC") b    <- seq(1, 5) pre <- NULL post <- NULL page <- NULLfor(j in 1:length(a)) {    for(i in 1:length(b)){  

Re: [R] Eye Diagram from a Topic Model

2015-07-25 Thread Peter Maclean via R-help
Is it possible to reproduce the eye-diagram described here from the topic model/ https://github.com/ouzor/eyediagram/blob/master/example.R and shown here: https://github.com/ouzor/eyediagram/blob/master/example/ExampleEyeDiagram.pdf The code do not work in processing as suggested by the author

Re: [R] Recover value from boot and quantile function

2015-10-29 Thread Peter Maclean via R-help
#This may be trivia for some but I am running several bootstraps and #I would like to create a table/data frame with original mean, std.error from the #x.boot object and confidence intervals from x.quant object. The boot and quantifile function do not show how. library(boot) x <- rgamma(100,2

Re: [R] Fixing Parameters in maxLik

2015-11-14 Thread Peter Maclean via R-help
Is there a way in maxLik to fix/constraint a parameter to fall within a certain range ? For example I want sigma to be always between 1.98 and 2.02 library(maxLik) loglik <- function(param) { mu <- param[1] sigma <- param[2] ll <- -0.5*N*log(2*pi) - N*log(sigma) - sum(0.5*(x - mu)^2/sigma