similar to: Apply and its friends

Displaying 20 results from an estimated 11000 matches similar to: "Apply and its friends"

2003 Jun 13
1
lars - lasso problem
hello I tried to use lars() but neither with my own data nor with the sample data it works. I get in both cases the following error prompt: > data(diabetes) > par(mfrow=c(2,2)) > attach(diabetes) > x<-lars(x,y) Error in one %*% x : requires numeric matrix/vector arguments > x<-lars(x,y, type="lasso") Error in one %*% x : requires numeric matrix/vector arguments
2005 Jul 13
2
Kronecker matrix product
Hi I want to write a little function that takes a matrix X of size m-by-n, and a list L of length "m", whose elements are matrices all of which have the same number of columns but possibly a different number of rows. I then want to get a sort of dumbed-down kronecker product in which X[i,j] is replaced by X[i,j]*L[[j]] where L[[j]] is the j-th of the "m" matrices. For
2002 Oct 28
1
RFC: no automatic updates of packages with major version chan ge
Is it possible to have a slightly more elaborate description, such as: BackwardCompatibleTo: x.x-x and if the new version is _not_ backward compatible, this would be the current version number? Just my $0.02... Andy -----Original Message----- From: Torsten Hothorn [mailto:Torsten.Hothorn@rzmail.uni-erlangen.de] Sent: Monday, October 28, 2002 7:25 AM To: ripley@stats.ox.ac.uk Cc:
2005 Dec 02
3
extracting rows of a dataframe
Hi look at the following session, in which I have a dataframe, and I want to extract the second row, without the first column. Everything works as expected until the last line, where I set the names of x to NULL, and get a non-desired object (I want c(4,3).). Three questions: (1) why is as.vector(a[2,-1]) not a vector? (2) How come setting names to NULL gives me bad weirdness? (3) Can I
2006 Feb 18
3
Bug in Sweave? -- scoping problem? (PR#8615)
I have found a strange scoping problem in Sweave. The following Rnw file doesn't produce the same output in Sweave as it does if I produce an R file using Stangle and execute that: \documentclass[12pt]{article} \begin{document} <<R>>= election <- data.frame(A=1:3, B=9:7, C=rep(0,3)) partytotal <- rep(0, ncol(election)) for (i in 1:ncol(election)) { partytotal[i] <-
2010 Apr 01
2
pdf files in loops
I need to make a bunch of PDF files of histograms. I tried gatelist = unique(mdf$ArrivalGate) for( gate in gatelist) { outfile = paste("../", airport, "/", airport, "taxiHistogram", gate, ".pdf", sep="") pdf(file = outfile, width = 10, height=8, par(lwd=1)) title=paste("Taxi time for Arrival Gate", gate, "by
2003 Aug 21
1
R is mentioned on Linux Today
Hi all, people who don't follow Linux Today regularly may want to check out: http://linuxtoday.com/developer/2003082000626OSSVDV My apologies if this is considered spam. Cheers, Berwin ========================== Full address ============================ Berwin A Turlach Tel.: +61 (8) 9380 3338 (secr) School of Mathematics and Statistics +61
2011 Aug 03
1
expand.gird with constraints?
Hi, R users, Here is an example. k <- c(1,2,3,4,5) i <- c(0,1,3,2,1) if k=1, then j=0 from i if k=2, then j=0, 1 from i if k=3, then j=0, 1, 2, 3 from i if k=4, then j=0, 1, 2 from i if k=5, then j=0, 1 from i so i'd like to create a list like below. > list k j 1 1 0 2 2 0 3 2 1 4 3 0 5 3 1 6 3 2 7 3 3 8 4 0 9 4 1 10 4 2 11 5 0 12 5 1 I tried expand.grid, but I
2008 Apr 14
4
&& and ||
Hello there, I got a small problem about logical calculation: we can get a sequene from a+b as below: > a<-c(1,2) > b<-c(3,4) > a+b [1] 4 6 but when the sequences are logical. (I want to get (True,False) && (True, True) ==> (True, False), but when I do as below. > e<-c(T,T) > f<-c(F,T) > e [1] TRUE TRUE > f [1] FALSE TRUE >
2006 Apr 14
5
vector-factor operation
I found myself wanting to average a vector [vec] within each level of a factor [Fac], returning a vector of the same length as vec. After a while I realised that lm1 <- lm(vec ~ Fac) fitted(lm1) did what I want. But there must be another way to do this, and it would be good to be able to apply other functions than mean() in this way. Cheers, Murray -- Dr Murray Jorgensen
2014 Jan 11
1
Fortran BLAS giving bad results
Hello r-devel, When compiling Fortran code containing BLAS functions and calling it using dyn.load, I am getting incorrect results. A small example with which I can reproduce the problem is below. I am running on OSX Mavericks (upgraded R, Xcode, etc per instructions on this list), but I do not think it is related since the check on my "blupsurv" package on r-forge seems to be showing
2010 Jul 20
1
Call to rgamma using .C causes R to hang
Hi, I've been trying to get this working for ages, but it causes R to hang. Here is my C code saved as test1.c # include <R.h> # include <Rmath.h> void test1 (double *x, double *result) { result[0] = rgamma(*x, 2.0); } This was compiled using R CMD SHLIB test1.c & loaded in R using: dyn.load("test1.dll") out <-
2006 Mar 14
1
Internal codes of the factor
Hello! I am writing some functions and I repeatedly acces internal factor codes. I figured out that internal codes are 1:n where 1 represents 1st level, 2 2nd level etc. This is not documented and I wonder if this is on purpose and subject to change or would be a good idea to add this to documentation for factor? I can prepair a pacth if this is accepted. -- Lep pozdrav / With regards,
2006 Apr 17
3
bounding box in PostScript
When a graph is saved as PostScript, the bounding box is often too big. A consequence is that when the graph is included in a LaTeX document, the spacing does not look good. Is this a recognized problem? Is someone working on it? Could I help? David
2006 Nov 13
1
"stem" does not give a correct answer (PR#9359)
Full_Name: Myung Geun Kim Version: 2.4.0 OS: Window XP Submission from: (NULL) (210.110.8.105) For the data c1 of size 14, stem provides the following result. ************************************************************** >c1 [1] 14 39 70 11 38 20 37 15 41 74 74 34 48 51 ZZangi>stem(c1) The decimal point is 1 digit(s) to the right of the | 0 | 145 2 | 04789 4 | 181 6 | 044
2005 Dec 23
1
how to specify dev.print target by a variable?
I want to do the following: DEVw=500 DEVh=350 fname="my_plot" dev.print(file=fname, device=FOO, width=DEVw, height=DEVh, bg="transparent") How do I do this such that I can specify FOO to be one of several choices? (GDD, PNG, postscript, etc.) If I make FOO a character variable, then "dev.print" complains. I tried a simpled "substitute" but
2006 Jun 01
1
"predict" function does not provide SE estimates for multivariate timeseries VAR models?
What can I do? Thanks a lot! [[alternative HTML version deleted]]
2006 Jul 23
1
How to pass eval.max from lme() to nlminb?
Dear R community, I'm fitting a complex mixed-effects model that requires numerous iterations and function evaluations. I note that nlminb accepts a list of control parameters, including eval.max. Is there a way to change the default eval.max value for nlminb when it is being called from lme? Thanks for any thoughts, Andrew -- Andrew Robinson Department of Mathematics and Statistics
2006 Jul 28
1
order() 'decreasing =' argument must be typed in full
## While in R v. 2.3.1 (the mid-July patch for Windows) ## on a Windows XP machine, this call to order() works fine... order(1:10,decreasing = TRUE) ## [1] 10 9 8 7 6 5 4 3 2 1 ## ...however, the argument name 'decreasing' ## must be typed in toto (note the missing 'g' ## in the following): > order(1:10,decreasin = TRUE) ## Error in order(na.last, decreasing, ...) :
2006 Oct 26
1
A faster way to calculate Trace?
I want to know how to get trace of product of matrices **faster** when the matrices are really big. Unfortunately the matrices are not symmetric. If anybody know how to get the trace of it, please help me. An example is as below. n <- 2500 a <- matrix(rnorm(n*n),n,n) b <- matrix(rnorm(n*n),n,n) tr1 <- sum(diag(a %*% b)) tr2 <- sum(diag(a %*% b %*% a %*% b)) Thanks, Yongwan Chun