similar to: Full enumeration, how can this be vectorized

Displaying 20 results from an estimated 400 matches similar to: "Full enumeration, how can this be vectorized"

2011 Jan 25
1
Learn Vectorization (Vectorize)
Greetings Friends, I would be grateful if you can help me undestand how to make my R code more efficiently. I have read in R intoductory tutorial that a for loop is not used so ofter (and is not maybe not that efficient) compared to other languages. So I am trying to build understanding how to get the equivalent of a for loop using more R-oriented thinking. If I got it right one way to do that
2002 Mar 29
1
memory error with rpart()
Dear all, I have a 100 iteration loop. Within each loop, there are some calls to rpart() like: ctl <- rpart.control(maxcompete=0, maxsurrogate=0, maxdepth=10) temp <- rpart(y~., x, w=wt, method="class", parms=list(split="gini"), control=ctl) res <- log(predict.rpart(temp, type="prob")) newres <- log(predict.rpart(temp, newdata=newx,
2006 Nov 09
2
Multi Head Cube rotation
Hi, I pulled compiz from GIT yesterday to see if I could get proper multi-head support. I think the current status is great, but I have one little suggestion to make. The current behavior is that we have two viewpoints of the "cube" (it's more like a body with eight side planes now). If it's rotated one step we skip one of the planes. Rotating four times is enough to go round
2007 Jun 22
2
fitCopula
I am using R 2.5.0 on windows XP and trying to fit copula. I see the following code works for some users, however my code crashes on the chol. Any suggestions? > mycop <- tCopula(param=0.5, dim=8, dispstr="ex", df=5) > x <- rcopula(mycop, 1000) > myfit <- fitCopula(x, mycop, c(0.6, 10), optim.control=list(trace=1), method="Nelder-Mead")
2011 Dec 23
2
missing value where TRUE/FALSE needed
Merry Xmas to all, I am writing a function and curiously this runs sometimes on one data set and fails on another and i cannot figure out why. Any help much appreciated. If i run the code below with data <- iris[ ,1:4] The code runs fine, but if i run on a large dataset i get the following error (showing data structures as matrix is large) > str(cluster.data) num [1:9985, 1:811] 0 0 0 0
2014 Feb 05
1
ldb segment fault. Problem on joining as a DC member.
Dear All, Need some help as I was trying to follow the guide below. https://wiki.samba.org/index.php/Samba4/HOWTO/Join_a_domain_as_a_DC Until the steps of ldbsearch -H /usr/local/samba/private/sam.ldb '(invocationid=*)' --cross-ncs objectguid and my ldbsearch reply with such a result. ldb: unable to dlopen /usr/lib64/samba/ldb/acl.so : /usr/lib64/ldb/libreplace.so: version
2013 Mar 14
2
question about nls
Hi,all: I met a problem of nls. My data: x y 60 0.8 80 6.5 100 20.5 120 45.9 I want to fit exp curve of data. My code: > nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates I can't find out the reason for the error. Any suggesions are welcome. Many thanks. [[alternative HTML
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody When one is working with complex matrices, "transpose" very nearly always means *Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]). One often writes A^* for the Hermitian transpose. I have only once seen a "real-life" case where transposition does not occur simultaneously with complex conjugation. And I'm not 100% sure that that wasn't a
2009 Feb 20
2
equivalent function to MatLab 'step' ?
I have to admit I don't fully understand how MatLab's step() function works, but I'm learning that part. Can someone point me to equivalent&related functions in R? thanks Carl
2004 Oct 30
2
How to add values to an array at any position.
Hi, How to add values to an array at any position. Asking because of the following: e.g. y<-c(0.1,NaN,0.2,NaN) #or data frame x<-na.omit(y) take some columns from x and do some computation with functions which do not allow NaN 's. After the computing add NaN's at positions stored in attr(x,"na.action") of the result vector. /E -- Dipl. bio-chem. Witold Eryk
2013 Jul 14
2
creating dummy variables based on conditions
Hello everyone, I have a dataset which includes the first three variables from the demo data below (year, id and var). I need to create the new variable ans as follows If var=1, then for each year (where var=1), i need to create a new dummy ans which takes the value of 1 for all corresponding id's where an instance of one was recorded. Sample data with the output is shown below. year
2008 Mar 11
1
messages from mle function
Dears useRs, I am using the mle function but this gives me the follow erros that I don't understand. Perhaps there is someone that can help me. thank you for you atention. Bernardo. > erizo <- read.csv("Datos_Stokes_1.csv", header = TRUE) > head(erizo) EDAD TALLA 1 0 7.7 2 1 14.5 3 1 16.9 4 1 13.2 5 1 24.4 6 1 22.5 > TAN <-
2012 May 11
1
identify() doesn't return "true" numbers
Dear R community. I am using the identify() function to identify outliers in my dataset. This is the code I am using: #################################################################### # Function to allow identifying points in the QQ plot (by mouseclicking) qqInteractive <- function(..., IDENTIFY = TRUE) { qqplot(...) -> X abline(a=0,b=1) if(IDENTIFY) return(identify(X))
2005 Nov 06
2
Does advanced menu actually support ontimeout?
I've finally gotten around to playing with the advanced menu, though the complex example is definitely still beyond me. I'm trying to figure out a few basics from it, such as the tab key for line editing (don't know what I've done wrong here since it seems like I copied that part right) and the timeout. It looks to me like the only ontimeout implemented so far is an option to not
2007 Jul 07
1
calculating p-values of columns in a dataframe
I have a dataframe ("mydf") that contains "differences of means". I wish to test whether these differences are significantly different from zero. Below, I calculate the t-statistic for each column. What is a "good" method to calculate/look-up the p-value for each column? mydf=data.frame(a=c(1,-22,3,-4),b=c(5,-6,-7,9)) mymean=mean(mydf) mysd=sd(mydf)
2009 May 26
2
Problem with fractional seconds
Dear List, I am having problems converting a file with fractional seconds to class POSIXct. I have set my options to include digits.secs and my format to just time, but my output is the current date with my time lacking the fractions of a second. For example: options(digits.secs=3) t<-c("06:00:00.100","06:00:01.231") myt<-as.POSIXct(t,format="%H:%M:%S")
2008 Nov 06
3
.C(..., DUP=FALSE) memory costs depending on input size?
Hello, I'm trying to create my own C code for use within R. While optimizing the code I've noticed that even while only using pointers to get my data to C the time needed still depends on data (vector) size. To test this, I've created an empty C function to which I've send vectors containing various sizes of elements. The time needed for each call is measured and plotted. I would
2006 Mar 10
2
problem building R-patched on x86-64 with PGI 6.1
Dear R-devel, [I'm not sure if this is appropriate for R-devel. If not, I'm more than happy to move it to R-help.] As those of you who saw my post on R-help know, I've been trying to build R-patched on a dual Opteron box running Scyld Beowulf, using the PGI 6.1 compilers. The build went fine, but I couldn't get it to pass make check-all. Jennifer Lai, who reported success with
2007 Dec 10
1
What is happening here - rsync can't copy where cp can, Input/Output errors
I am using rsync version 2.6.9 protocol version 29 on a Fedora 7 system to backup files to a network drive. rsync is getting I/O errors when copying maildir files (I'm not sure if the error is happening with other files but these are the only ones I have found so far). I have done some tests on one particular directory, "cp -R" succeeds but "rsync -r" fails:- home#
2012 Jun 23
9
[PATCH 0/5] btrfs: lz4/lz4hc compression
WARNING: This is not compatible with the previous lz4 patchset. If you''re using experimental compression that isn''t in mainline kernels, be prepared to backup and restore or decompress before upgrading, and have backups in case it eats data (which appears not to be a problem any more, but has been during development). These patches add lz4 and lz4hc compression