similar to: How to apply a two-place function to each combination of elements in two vectors of different lengths?

Displaying 20 results from an estimated 8000 matches similar to: "How to apply a two-place function to each combination of elements in two vectors of different lengths?"

2012 Dec 08
5
How to efficiently compare each row in a matrix with each row in another matrix?
Dear expeRts, I have two matrices A and B. They have the same number of columns but possibly different number of rows. I would like to compare each row of A with each row of B and check whether all entries in a row of A are less than or equal to all entries in a row of B. Here is a minimal working example: A <- rbind(matrix(1:4, ncol=2, byrow=TRUE), c(6, 2)) # (3, 2) matrix B <-
2007 Mar 07
1
Read data with different column lengths
Dear r-help users, I have the following simple problem: Reading data from a file. The file is a .txt file exported ("save as...") from Excel (see below for an example). The Excel file consists of two header rows (first row consists of ticker symbols of stocks, the second row consists of column explanations ("Date","Px Last"), followed by several rows of
2013 Mar 11
2
How to 'extend' a data.frame based on given variable combinations ?
Dear expeRts, I have a data.frame with certain covariate combinations ('group' and 'year') and corresponding values: set.seed(1) x <- data.frame(group = c(rep("A", 4), rep("B", 3)), year = c(2001, 2003, 2004, 2005, 2003, 2004, 2005), value = rexp(7)) My goal is essentially to
2008 Mar 13
2
How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?
Hi, How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ? > cbind(1:2, 1:10) [,1] [,2] [1,] 1 1 [2,] 2 2 [3,] 1 3 [4,] 2 4 [5,] 1 5 [6,] 2 6 [7,] 1 7 [8,] 2 8 [9,] 1 9 [10,] 2 10 [[alternative HTML version deleted]]
2011 Aug 17
3
How to apply a function to subsets of a data frame *and* obtain a data frame again?
Dear all, First, let's create some data to play around: set.seed(1) (df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10), Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),]) ## Now we need the empirical distribution function: edf <- function(x) ecdf(x)(x) # empirical distribution function evaluated at x ##
2013 Jan 22
2
Length of seed for l'Ecuyer-CMRG
Dear expeRts, ./src/library/base/man/Random.Rd says that L'Ecuyer requires a seed of length 6. ./src/library/parallel/man/RngStream.Rd also mentions this, but only in the text part; In the "Arguments"-part, it says that "seed" has to be of length 7 Also: ,---- | > RNGkind("L'Ecuyer-CMRG") | > length(.Random.seed) | [1] 7 `---- Is the docu old? Some
2011 Mar 26
1
bwplot [lattice]: how to get different y-axis scales for each row?
Dear expeRts, How can I get ... (1) different y-axis scales for each row (2) while having the same y-axis scales for different columns? I coulnd't manage to do this with relation="free" [which gives (1) but not (2)]. I also tried relation="sliced", but it did not give the same y-axis scales within each row (see the fourth row). Further, it "separates" the
2012 Sep 23
1
grid: How to merge cells in grid.layout?
Dear grid expeRts, I would like to create a layout with grid that looks like the following, but with cells (1,1), (1,4), (4,1), and (4,4) removed and cells (2,1) and (3,1) (and (4,2) and (4,3)) combined to one cell (so that contents can easily be centered. How can this be achieved? require(grid) gl <- grid.layout(4, 4, widths=unit(c(1, 3, 3, 1), "cm"),
2006 Nov 28
11
Extending Element with getTop, getWidth, getLeft problem
Hi, I need to extend the Element object with getTop, getWidth, getLeft . I wrote something like this in an js file and loaded it after the prototype.js . ---------------------------------------------------- Object.extend(Element, { getWidth: function(element) { element = $(element); return element.offsetWidth; }, getTop: function(element) { element = $(element); var curtop
2006 Nov 24
1
sortable - after complete dropping element want to send ajax reqeust with id of elements: draggable and droppable
Hi all. I have specific situations - I use sortable on html list, and after I move elements I want to do ajax reqeust to serwer with the id of dragging element and id of the element that was droppable. How to do it? which function in Sortable class i have to overrider or modify? i try to modife onhover method in sortable and put a ajaxRequest call before methods dropon.parentNode.insertBefore
2019 Oct 31
4
PHP FPM issue
Hi Marius, Will make the changes and see how it goes. On the other hand https://cbs.centos.org/koji/buildinfo?buildID=27138 if the above was released we could just install and migrate to rh-php73-php, which is not affected as per https://access.redhat.com/security/cve/cve-2019-11043 thanks --- Thomas Stephen Lee On Thu, Oct 31, 2019 at 8:40 PM Marius ROMAN <marius at roman.systems>
2010 Dec 30
5
Why is format(10000, big.mark = "\\,") not 10\,000?
Hi, why does format(10000, big.mark = "\\,") not give me "10\,000"? How can I get this kind of "big.mark"? Cheers, Marius
2011 Apr 06
7
Quiz: Who finds the nicest form of X_1^\prime?
Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: plot(0,0,main=expression(italic(X*minute[1]))) plot(0,0,main=expression(italic(X[1]*minute))) plot(0,0,main=expression(italic(X)[1]*minute)) Any suggestions? Cheers, Marius
2004 Mar 03
1
nesting vectors in a dataframe
Hi, I want to create a dataframe where one of the columns does not hold individual elements, but a vector instead. For example, imagine the following dataframe without any vectors as elements . . . ex X1 X2 1 5 15 2 7 12 3 9 14 If I have a pre-existing dataframe, then setting an element in the dataframe
2015 Feb 03
2
Seed in 'parallel' vignette
Hi, This is most likely only a minor technicality, but I saw the following: On page 6 of the 'parallel' vignette (http://stat.ethz.ch/R-manual/R-devel/library/parallel/doc/parallel.pdf), the random-number generator "L'Ecuyer-CMRG" is said to have seed "(x_n, x_{n-1}, x_{n-2}, y_n, y_{n-1}, y_{n-2})". However, in L'Ecuyer et al. (2002), the seed is given with
2010 Dec 26
1
lattice splom: how to adjust space between tick marks and tick labels?
Dear expeRts, how can I decrease the space between the tick marks and the corresponding labels in an splom? See here: library(lattice) U <- matrix(runif(4000), ncol = 8) splom(U, axis.text.cex = 0.2) # => space between the [small] tick labels and tick marks is/seems to be too large I checked ?panel.pairs but could not find an option for that. Cheers, Marius
2005 Jun 22
4
tc on a PDA
hello, i have a 5500 iPaq with familiar 0.8.2 on it and i don''t know how to install a traffic shaper tool on it. I installed iproute2 package i found on familiar site and for that i have the tc and ip commands, but when trying to add a qdisc, as a dummy example, i get the next answer: > tc qdisc add dev wlan0 root cbq bandwidth 100Mbit avpkt 100 RTNETLINK answers: Invalid argument
2016 May 05
4
R process killed when allocating too large matrix (Mac OS X)
Hi Simon, thanks for your quick reply. 1) ... so you can reproduce this? 2) Do you know a way how this can be 'foreseen'? We allocate larger matrices in the copula package depending on the user's input dimension. It would be good to tell her/him "Your dimension is quite large. Be aware of killers in your neighborhood"... before the killer attacks. Thanks & cheers,
2015 Jun 24
2
Identify listeners on log reports
Hi Marius, thanks for your reply. URL auth via usern/pass seems what I need. I fail to understand is if and how would that reflect on logs. Care to elaborate further? Thank you ---- Mark Foster On Wed, Jun 24, 2015 at 8:28 AM, Marius Flage <marius at flage.org> wrote: > Hi Mark, > > You can maybe look at authentication: > http://icecast.org/docs/icecast-2.4.1/auth.html ?
2012 Mar 01
2
How to colorize the panel backgrounds of pairs()?
Dear expeRts, I would like to colorize the backgrounds of a pairs plot according to the respective panel number. Here is what I tried (without success): count <- 0 mypanel <- function(x, y, ...){ count <<- count+1 bg. <- if(count %in% c(1,4,9,12)) "#FDFF65" else NA points(x, y, cex=0.5, bg=bg) } U <- matrix(runif(4*500), ncol=4) pairs(U, panel=mypanel) I