search for: maxl

Displaying 7 results from an estimated 7 matches for "maxl".

Did you mean: max
2018 Mar 29
0
Creating the right table from lapply list
Perhaps this toy example will help: ## example data output <- list(1:5, 1:7, 1:4) lens <- lapply(output, length) maxlen <- max(unlist(lens)) outputmod <- lapply(output, function(x, maxl) c(x, rep(NA, maxl-length(x))), maxl=maxlen) outputmat <- do.call(cbind, outputmod) write.csv(outputmat, na='') The idea is to pad the shorter vectors with NA (missing) before converting to a matrix structure. I...
2002 Mar 13
1
Commas in formatC
...ich could more or less just be inserted into at the end of formatC if any R-core guru were so inclined. "r" is the result so far, and "commas" is a logical flag: stp <- regexpr("[0-9]+", r); len <- attr(stp, "match.length") if (commas && (maxl <- max(len)) > 3) for (i in seq(3, maxl-1, 3)) r[len>i] <- paste(substring(r[len>i], 1, (stp+len-1-i)[len>i]), substring(r[len>i], (stp+len-i)[len>i]), sep=",") -- -- David Brahm (brahm@alum.mit.edu) -.-.-.-....
2018 Mar 28
3
Creating the right table from lapply list
Hello, I have no previous experience with R, but had to learn on the fly in the past couple of weeks. Basically, what I am trying to do is read a certain variable from a series of files and save it as csv-table. The variable has an hourly value for each month in a year for the past 20 years and has to be read for different geographical locations. So there will be 12 files per year (1 for each
2010 May 24
2
How to set parameters constraints in a function?
...4]); *kappa *<- exp(param[5]); for (i in 2:n) {psi[i] <- a0 + a1*x[i-1] + b1*psi[i-1]} lam <- gamma(kappa)/gamma(kappa+(1/alpha)) ll <- n*log(alpha/gamma(kappa))+kappa*alpha*sum(log(x))-n*kappa*alpha*log(lam)-kappa*alpha*sum(log(psi))-lam^(-alpha)*sum((x/psi)^alpha) return(list(maxl=-ll,vpsi=psi)) } Thanks in advance!! Cheers, Carol [[alternative HTML version deleted]]
2009 Oct 12
1
Help Error
...error comment? var=VAR(Canada,p=3,type="const") for (j in 1:nrow(com)) { mat=ma { for (i in 1:ncol(com)) { y=which(mat==com[j,i]) mat[y]=NA } z=which(mat!=0) mat[z]=0 hitt=SVAR(var , estmethod = "scoring", Amat = mat, Bmat = NULL,max.iter = 100, maxls = 1000, conv.crit = 1.0e-8) hit[j]=hitt$LR$statistic } } There will be an error comment,e.g. : Error in solve.default(BinvA) : Lapack routine dgesv: system is exactly singular" But I still want to continue to compute the SVAR.. How can I do it? Thanks for answering it.. Regards...
2004 Nov 21
3
Help with ooplot(gplots) and error bars
Dear All I am trying to graph a proportion and CI95% by a factor with ooplot (any other better solution ?) It works well until I try to add the confidence interval. this is the error message and and a description of the data: > dat1 PointEst TT1 1 3.6 TT2 2 5.0 TT3 3 5.8 TT4 4 11.5 TT5 5 7.5 TT5 6 8.7 TT7 7 17.4 > dat2
2001 Aug 22
1
@RSYNC EXIT / @RSYNC EOF
...buf[len] = 0; } unsigned char read_byte(int f) { unsigned char c; - read_buf(f,(char *)&c,1); + read_buf (f, (char *)&c, 1); return c; } @@ -560,10 +595,10 @@ void write_byte(int f,unsigned char c) write_buf(f,(char *)&c,1); } + + int read_line(int f, char *buf, int maxlen) { - eof_error = 0; - while (maxlen) { buf[0] = 0; read_buf(f, buf, 1); @@ -581,8 +616,6 @@ int read_line(int f, char *buf, int maxl *buf = 0; return 0; } - - eof_error = 1; return 1; } Index: proto.h =================================================================== RCS fi...