similar to: silent recycling in logical indexing

Displaying 20 results from an estimated 10000 matches similar to: "silent recycling in logical indexing"

2018 Jan 04
3
silent recycling in logical indexing
Hmm. Chuck: I don't see how this example represents incomplete/incommensurate recycling. Doesn't TRUE replicate from length-1 to length-3 in this case (mat[c(TRUE,FALSE),2] would be an example of incomplete recycling)? William: clever, but maybe too clever unless you really need the speed? (The clever way is 8 times faster in the following case ...) x <- rep(1,1e6)
2009 Feb 12
5
Extending each element in a list, or rbind()-ing arrays of different length without recycling
Hi, I'm trying to take a matrix such as [,1] [,2] [,3] [,4] [,5] [1,] 2 7 2 7 9 [2,] 10 10 6 8 6 [3,] 1 9 7 2 0 and generate a new matrix which contains only the unique values in each row: [,1] [,2] [,3] [,4] [,5] [1,] 2 7 9 NA NA [2,] 10 6 8 NA NA [3,] 1 9 7 2 0 My problem is that I can use
2017 Dec 13
0
Add vectors of unequal length without recycling?
Without recycling you would get: u <- c(10, 20, 30) u + 1 #[1] 11 20 30 which would be pretty inconvenient. (Note that the recycling rule has to make a special case for when one argument has length zero - the output then has length zero as well.) Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Dec 12, 2017 at 9:41 PM, Maingo via R-help <r-help at r-project.org> wrote:
2017 Dec 13
4
Add vectors of unequal length without recycling?
I'm a newbie for R lang. And I recently came across the "Recycling Rule" when adding two vectors of unequal length. I learned from this tutor [ http://www.r-tutor.com/r-introduction/vector/vector-arithmetics ] that: """""" If two vectors are of unequal length, the shorter one will be recycled in order to match the longer vector. For example, the
2004 Aug 19
2
text(x, y, labels) - recycling problems and RFC (PR#7084)
I didn't get any feedback on this posting, so I will commit my proposal to recycle the coordinates (x,y) to the length of 'labels' if the latter is longer (instead of silently dropping the extra labels[] entries). Martin Maechler >>>>> "MM" == Martin Maechler <maechler@stat.math.ethz.ch> >>>>> on Tue, 13 Jul 2004 18:22:05 +0200
2015 Apr 16
2
Recycling directories and backup performance. Was: Re: rsync --link-dest won't link even if existing file is out of date (fwd)
rsync folks, Henri Shustak <henri.shustak at gmail.com> wrote: > LBackup always starts a new backup snapshot with an empty directory. I > have been looking at extending --link-dest options to scan beyond just > the previous successful backup to (failed backups / older backups). > However, there are all kinds of edge cases which are worth considering > with such a changes. At
2014 Sep 15
2
Backup scripts - recycling old backup directories (Kevin Korb)
Kevin, Thanks for the reply and interest in this topic. Comments below. Regards Rob. > I did consider that but rejected it for 2 reasons... > > 1. Backup run time. We have a 4 hour window to run backups at night. > Using recycled directories significantly extended the backup run > time. The deletion time is eliminated but frankly, we have the other > 20 hours of the day
2006 Feb 28
2
lines() and recycled colours
Hi ?lines says For 'type = "h"', 'col' can be a vector and will be recycled as needed. Why doesn't lines() recycle colours for other types? If I type > plot(0:1,0:1,type="n") > lines(runif(11),runif(11),col=c("red","green")) > then all ten lines are red, with no warning given. Is there a reason why
2008 Aug 27
1
ifelse() fill order and recycling rules [Sec=Unclassified]
Hi all, Using R v2.7.1, platform i386-pc-mingw32 Can someone please shed some light on the behaviour of ifelse() for me? My intent is to calc relative proportions of z$b, at the same time subsetting z$b based on z$a. I could attack the problem other ways (suggestions welcome) but I am also intrigued by the _order_ in which ifelse seems to assign values, and how recycling works. For instance,
2014 Sep 12
2
Backup scripts - recycling old backup directories
Folks, Kevin Korb wrote: > Have you considered more advanced methods such as subvolume snapshots > provided by ZFS and BTRFS? At work we were forced to abandon rsync > - --link-dest because of the amount of time it takes to delete old > backups when the data is primarily many millions of small files > (shared web hosting company). We don't have more advanced methods like
2003 May 09
2
Data-mining using R
Is it possible to use R as a data-mining tool? Here's the problem I've got. I have a couple of data sets consisting of results from a cDNA microarray experiment - the details about the biology don't really matter here, the same theory applies for any other data-mining task (that's why I thought it'd be more appropriate to post this on r-user). Each of these datasets consists
2007 Oct 19
1
Manual recycling of vectors?
Sorry if this is already answered somewhere, but I could not find it. I have two vectors, x,y, of different length, and I want to recycle the smaller one (whichever one it is) until they have the same length. I was wondering if there is a anything better than something like: x<-1:3 y<-1:10 x<-rep(x,length=max(x,y)) y<-rep(y,length=max(x,y)) or some variant of that using if to
2004 May 14
1
covariates in lm
Dear R list, I have been trying to do a linear model, extracting the effect of a covariate.... and the results do not match, when I do it with other programs (e.g. minitab).... so it is obvious that I was doing something wrong. Whan I do it with minitab, I have this results: (sector is a factor and depth is the covariate): Source DF Seq SS Adj SS Adj MS F P
2007 Jul 30
2
deriv, loop
Hi, 2 questions: Question 1: example of what I currently do: for(i in 1:6){sink("temp.txt",append=TRUE) dput(i+0) sink()} x=scan(file="temp.txt") print(prod(x)) file.remove("C:/R-2.5.0/temp.txt") But how to convert the output of the loop to a vector that I can manipulate (by prod or sum etc), without having to write and append to a file? Question 2: >
2006 Oct 27
2
all.names() and all.vars(): sorting order of functions' return vector
Dear list-subscriber, in the process of writing a general code snippet to extract coefficients in an expression (in the example below: 0.5 and -0.7), I stumbled over the following peculiar (at least peculiar to me:-) ) sorting behaviour of the function all.names(): > expr1 <- expression(x3 = 0.5 * x1 - 0.7 * x2) > all.names(expr1) [1] "-" "*" "x1"
2001 Oct 05
1
nls() fit to a lorentzian - can I specify partials?
First, thanks to all who helped me with my question about rescaling axes on the fly. Using unlist() and range() to set the axis ranges in advance worked well. I've since plotted about 300 datasets with relative ease. Now I'm trying to fit a lossy oscillator resonance to (the square root of) a lorentzian (testframe$y is oscillator amplitude, testframe$x is drive frequency): lorentz
2002 Oct 15
0
Cartridge Recycling OccYYUdqVk
This message is brought to you by:ENVIRONMENTAL ACTIVISTS GROUPS Helping to save our world! Please Recycle Your Cartridges! Our Top Pick! - Company refills and then returns your cartridges! Laser/Jet Recycling Services : Inkjet Laser Toner And Copier Cartridges Recycling Service. Refills apple, brother, canon, hp, epson, lexmark, Xerox and more. Also sells refilled cartridges Cheap!
2006 Jul 18
2
I think this is a bug
Hello! I work with: R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) On Windows XP Professional (Version 2002) SP2 I think there is a bug in the conditional execution if (expr1) {expr2} else {expr3} If I try: "if (expr1) expr2 else expr3" it works well but when I put the expression expr2 and expr3 between {} I receive an error message
2009 Dec 09
4
equivalent of ifelse
Hi, Is there any equivalent for ifelse (except if (cond) expr1 else expr2) which takes an atomic element as argument but returns vector since ifelse returns an object of the same length as its argument? x = c(1,2,3) y = c(4,5,6,7) z = 3 ifelse(z <= 3,x,y) would return x and not 1 thanks
2006 Nov 18
1
deriv when one term is indexed
Hi, I'm fitting a standard nonlinear model to the luminances measured from the red, green and blue guns of a TV display, using nls. The call is: dd.nls <- nls(Lum ~ Blev + beta[Gun] * GL^gamm, data = dd, start = st) where st was initally estimated using optim() st $Blev [1] -0.06551802 $beta [1] 1.509686e-05 4.555250e-05 7.322720e-06 $gamm [1] 2.511870 This works fine but I