similar to: Replacing double loop by apply

Displaying 20 results from an estimated 10000 matches similar to: "Replacing double loop by apply"

2009 Oct 01
2
(no subject)
Hi, Does anyone know where the following package is available: Holleczek B, Gondos A, Brenner H. PeriodR - an R package to calculate long term survival estimates using period analysis. Methods of Information in Medicine 2009; 48: 123-128. Thanks Jens Oehlschl?gel -- GRATIS f?r alle GMX-Mitglieder: Die maxdome Movie-FLAT!
2010 Apr 13
1
vegan (ordisurf): R² for smoothed surfaces
Dear r-helpers, I just read in an article by Virtanen et al. (2006) where vegetation-environment relationships are studied by fitting smoothed surfaces on an NMDS ordination using GAMs (Wood 2000). The authors describe, that they used R? as goodness-of-fit statistic, which they compare to the R? of fitted vectors. Calculations were carried out using the package vegan (Oksanen). I know that I can
2010 Jun 23
2
step-to-step Installation Guide
Hello, I'm new here, and I'm from Germany, so please be patient with me because my English is not so good ;) I am searching for a Step-to-Step Guide to first-configure Dovecot. I want to create virtual Users wich can logon to my Server to a Webinterface to call theire mails. I think IMAP is the right protokoll but it should be safe, so i think IMAPs is better. Unfortunately I am not
2009 Aug 31
1
Test for stochastic dominance, non-inferiority test for distributions
Dear R-Users, Is anyone aware of a significance test which allows demonstrating that one distribution dominates another? Let F(t) and G(t) be two distribution functions, the alternative hypothesis would be something like: F(t) >= G(t), for all t null hypothesis: F(t) < G(t), for some t. Best wishes, Matthias PS. This one would be ok, as well: F(t) > G(t), for all t null
2009 Oct 30
2
data.frame extracting data row-wise
Dear All, I am struggling with extracting data from a data frame: x=data.frame(a=1:11,b=100:110) What I want is a list/vector in this sence: 1 100 2 101 3 102... For single rows, this works fine: as.matrix(x)[1,] For, say 2 rows, this works fine: z=c(as.matrix(x)[1,],as.matrix(x)[2,]) But z=c(as.matrix(x)[1:2,]) gives 1 2 100 101!? Is there an 'automated way' to produce a
2010 Jun 16
1
Mean variance plot of a data frame
Hello, I have a data frame that looks like Position, Relevance 0, 0.151531117072265 0, 0.245532564696541 0, 0.285207130323724 0, 0.302718099889669 0, 0.308213700400889 0, 0.341562706518953 0.0151515151515152, 0.368991215730364 0.0263157894736842, 0.256406702156839 0.0263157894736842, 0.344003157058329 0.0303030303030303, 0.200307950418176 0.0303030303030303, 0.558093143666938 0.04,
2010 Jul 20
3
pci.backhide
Hello List If i have a PCI=[08:00.0](example) in any DomU config file the xm shutdown <ID> shuts down this DomU and the Dom0! Otherwise i shutdown this DomU from inside the DomU with halt or shutdown -r now, the Dom0 shuts down to. This happend on Xen 3.4.2 and Xen 4.0 (Kernel 2.6.18.8-xen, 2.6.18.8-xen0) The Operating System to Compile xen was Debian Lenny and the Dom0 os. Without
2009 Sep 10
1
v.1.2.4 deliver maildir quota does not work
Hi, I'm using deliver for storing new mails (nfs). Since v.1.2 deliver does not reject mails if over quota (maildir quota). test with v. 1.1.18: # HOME=/tmp/maildir/ /path/dovecot-1.1.18/libexec/dovecot/deliver -e -c /path/dovecot-1.1.18/etc/dovecot.conf # Quota exceeded (mailbox for user is full) test with v. 1.2.4: # HOME=/tmp/maildir/ /path/dovecot-1.2.4/libexec/dovecot/deliver -e -c
2010 Mar 03
2
[LLVMdev] LLVM for heterogenous platforms
Hi llvm, it's for sure an obvious idea to use llvm as IR for heterogenous platforms (e.g. CPU+GPU). In theory someone could write plain C/C++ code, which by clang is translated to llvm-IL and then together with JIT-backends packed in an appropriate executable. Thus all the limitations and hassles of openCL or CUDA could be avoided. I wonder if there already is a related project? Of course in
2010 Jan 17
3
enty-wise closest element
Dear R-users, i have a simple problem maybe, but i don't see the solution. i want to find the entry-wise closest element of an vector compared with another. ind1<-c(1,4,10) ind2<-c(3,5,11) for (i in length(ind2):1) { print(which.min(abs(ind1-ind2[i]))) } for ind2[3] it should be ind1[3] 10, for ind2[2] it should be ind1[2] 4 and for ind2[1] it should be ind1[1] 1. but with the
2008 Dec 07
4
Finding the first value without warning in a loop
Dear R useRs, with the following piece of code i try to find the first value which can be calculated without warnings `test` <- function(a) { repeat { ## hide warnings suppressWarnings(log(a)) if (exists("last.warning", envir = .GlobalEnv)) { a <- a + 0.1 ## clear existing warnings rm("last.warning", envir = .GlobalEnv) }
2009 Apr 22
2
integrate lgamma from 0 to Inf
Dear R users, i try to integrate lgamma from 0 to Inf. But here i get the message "roundoff error is detected in the extrapolation table", if i use 1.0e120 instead of Inf the computation works, but this is against the suggestion of integrates help information to use Inf explicitly. Using stirlings approximation doesnt bring the solution too. ## Stirlings approximation lgammaApprox
2008 Nov 26
2
Very slow: using double apply and cor.test to compute correlation p.values for 2 matrices
My two matrices are roughly the sizes of m1 and m2. I tried using two apply and cor.test to compute the correlation p.values. More than an hour, and the codes are still running. Please help to make it more efficient. m1 <- matrix(rnorm(100000), ncol=100) m2 <- matrix(rnorm(10000000), ncol=100) cor.pvalues <- apply(m1, 1, function(x) { apply(m2, 1, function(y) { cor.test(x,y)$p.value
2009 Sep 15
4
Strange Network behaviour
Hi there, my Server: Debian 4.0, XEN xen-hypervisor-3.0.3-1-i386-pae I have successfully installed and running 13 domU. I have enough free ressources for number 14. I set it up in exactly the same way like the others. Once started this dumU Nr 14, every other domU lost its network connection. If I shutdown Nr 14, everything is working finde again. Is there a maximum number of domUs per Host?
2009 Sep 25
6
update of openssh-server i386 4.3p2-36.el5, dependencies
Any ideas why there is such a dependency hell? It's a server host, I don't need any GTK stuff etc. > yum install openssh-* output: --------- Dependencies Resolved ============================================================================= Package Arch Version Repository Size
2009 Nov 05
5
Density estimate with bounds
Dear R users, I would like to show the estimated density of a (0, 1) uniformly distributed random variable. The density curve, however, goes beyond 0 and 1 because of the kernel smoothing. Example: x = runif(10000) plot(density(x)) Is there a way to estimate the density curve strictly within (0, 1) and still use some sort of smoothing? Any help would be greatly appreciated. Best regards,
2008 Nov 02
1
ESS Toolbar missing after Ubuntu Update
Dear R useRs, yesterday i updated my system from ubuntu 8.04 to 8.10. I use emacs- snapshot, this is emacs 23.0.60.1 and ess 5.3.8. Before the update i had when starting emacs with an R file an ess-toolbar with little icons to start R or to evaluate a line or a region of my R file, but no this toolbar is lost and i don't know how to get it again. I tried a lot of changes in the ess options
2009 Dec 04
2
Solve linear program without objective function
Dear R-users, i try to solve to following linear programm in R 0 * x_1 + 2/3 * x_2 + 1/3 * x_3 + 1/3 * x_4 = 0.3 x_1 + x_2 + x_3 + x_4 = 1 x_1, x_2, x_3, x_4 > 0, x_1, x_2, x_3, x_4 < 1 as you can see i have no objective function here besides that i use the following code. library(lpSolve) f.obj<-c(1,1,1,1) f.con<-matrix(c(0,2/3,1/3,1/3, 1,1,1,1,
2005 Dec 05
1
apply() and dropped dimensions
Hi I am having difficulty with apply(). I want apply() to return a matrix, but sometimes a vector is returned. Toy example follows. Function jj() takes a couple of matrices m1 and m2 as arguments and returns a matrix with r rows and c columns where r=nrow(m2) and c=nrow(m1). jj <- function(m1,m2,f,...){ apply(m1, 1, function(y) { apply(m2, 1, function(x) { f(x, y, ...)
2011 Sep 27
1
array extraction
hello everyone. Look at the following R idiom: a <- array(1:30,c(3,5,2)) M <- (matrix(1:15,c(3,5)) %% 4) < 2 a[M,] <- 0 Now, I think that "a[M,]" has an unambiguous meaning (to a human). However, the last line doesn't work as desired, but I expected it to...and it recently took me an indecent amount of time to debug an analogous case. Just to be explicit, I would