similar to: looping variable names

Displaying 20 results from an estimated 260 matches similar to: "looping variable names"

2012 Aug 27
2
looping through numbered variables
Hello, This is a beginner question. I am trying to loop through numbered variables with "apply" to calculate weighted means. My data is "data", the variables are "var1" to "var100", the weight is "weight". The command works using sapply(paste('data$var', 1:100, sep=''), function(x) weighted.mean(eval(parse(text=x)), data$weight))
2007 Feb 02
1
Access to column names stored in a vector in lm procedure
Hello everybody I have to run many statistical tests that are identical, with the exception of the dependent variable. Is there a possibility to store the dependent variable names e.g. in a vector (in the below mentioned example called “variable”) and to use the content of this vector in a simple statistical test (e.g. a regression). I would like to write the statistical procedure only once…
2011 Nov 27
1
sqldf if iif
Dear all, I have problems with iif function using sqldf library. I counted abundance (Num) of different "SPECIES" in two moments (esf) saving the information in two Tables (esf50, esf100): esf50 SAMPLE SPECIES Num esf 1289 diso1 44 50 1289 diso2 5 50 1289 diso3
2011 Feb 02
1
Help with Help
I have recently been reading several books on data mining which contain a few data sets.  The books offer some perspective on model choices, tuning decisions, result interpretation.  Are there any good resources that can walk me through the thought process of an experienced data miner with the datasets that are included for packages such as "rpart" & "kmeans". I
2011 Feb 02
1
drawing from one cell to another using layout() - possible?
Is it possible to cross the cell boundaries set by layout using base graphics? I.e. I want to draw e.g. a line from one layout cell to another. Is there a way to do that? layout(matrix(c(1,2), byrow=TRUE, ncol=2)) plot.new() text(0,0,paste(rep("a", 200), collapse=""), xpd=T) layout.show(2) I would like the a's to not end at the layout borders of the left cell. Thanks in
2011 Feb 02
2
matrix and a function - apply function
Hi I have this function and this matrix: function(x,y) x+y/x m<-matrix(c(1,2,4,2,10,8),3,2) > m [,1] [,2] [1,] 1 2 [2,] 2 10 [3,] 4 8 each row represent a point (x,y) in a chart and I want via my fucntion to calculate the image in order to get this results: for point (1,2) I would get 1+2/1 = 3 for point (2,10) I would get 2+10/2 = 7 for point (4,8) I would get
2011 Feb 02
3
Applying multiple functions to one object
Dear list members, I recall seeing a convenience function for applying multiple functions to one object (i.e., almost the opposite of 'mapply?) somewhere. Example: If the function was named ?fun? the output of fun(3.14, mode, typeof, class) would be identical to the output of c(mode(3.14), typeof(3.14), class(3.14)) Is my memory failing me, or does such a function already exists in a
2011 Feb 02
4
Testing whether a number belong to a set
Hello everyone, I am stuck with an apparently simple issue : i) I have two sets S1 and S2, each containing a large number of integers, say zip codes. ii) Now, I just want to test whether a particular zip code belong to S1 or S2 or neither of them. iii) If it belongs to S1, the area/region gets a particular label, say 1; if it belongs to S2, it gets a label 2 and if it doesnot belong to either S1
2005 Feb 21
1
e2fsck Looping?
Helping a friend fix a computer that was having severe, weird troubles. Reformatted (from XP) and installed Fedora. Install went ok, on first boot, however, filesystem was READONLY for some reason. Knew hard drive was suspect, so I e2fsck'd it over and over all night long, fall asleep next to the computer. This morning, Fedora boots fine, login not a problem, so I shut down and fsck it again,
2006 Jan 05
1
Looping through all models in the application
Hello. I have an application that depends on a table/model (ModelInternationalization) that provides international translations in various languages for all the model/table and columns names as well as some other stuff (whether the column is visible on forms, dropdowns, lists, reports etc). I need to create a management interface for this translation stuff (the plaintext stuff, btw, will be
2010 Jun 25
1
Confused: Looping in dataframes
Hey, I have a data frame x which consists of say 10 vectors. I essentially want to find out the best fit exponential smoothing for each of the vectors. The problem while I'm getting results when i say > lapply(x,ets) I am getting an error when I say >> myprint function(x) { for(i in 1:length(x)) { ets(x[i],model="AZZ",opt.crit=c("amse")) } } The error message is
2010 Feb 24
1
problem with looping on sqlSave()
Dear R users, I have a follow-up question on sqlSave(). Since most of the output from the tests I use are lists, I would like to loop to export each element of the list and append it to the sheet. Here is what I do: > library(RODBC) > test <- structure(list(m = structure(c(0.090909090909091, 0.181818181818182, 0.272727272727273, 0.363636363636364, 0.454545454545455,
2008 Feb 06
1
usbhid-ups looping and unresponsive after update
OS: Linux (Linux ares 2.6.22-3-686 #1 SMP) Dist: Debian (testing) UPS: Tripp Lite Omni1000 LCD After updating from 2.2.0 to 2.2.1, the following command seems to go into loop and becomes unresponsive except for a "kill -9": /lib/nut/usbhid-ups -u root -DDD -a trippy It seem that the previous version would pause the output at some polling interval, but with the new version prints to
2009 Jan 06
1
Alternate looping
R-help, I'm using the "for" control flow to graph plots continuously: par(mfrow=c(3,5), mar=c(0.6,.2,1.2,.2),yaxt="n",xaxt="n") for(j in 1:11) { for(i in 1:15) { species <- spAldur[spAldur$ar == 1993+i & spAldur$aldur == j,] plot(species at coords[,1], species at coords[,2], xlim=c(-10,-3.5), ylim=c(60.1,63) ,
2011 Mar 21
1
Basic Looping Trouble
Hi all, Forgive me for this basic question. I've been doing some research and haven't been able to figure out how to best do this yet. I have 75 variables defined as vector time series. I am trying to create a script to automate calculations on each of these variables, but I wasn't sure how to go about calling variables in a script. I am hoping to write a loop that calls a list of
2009 Apr 21
0
Nested forms without looping through fields_for collection.
Hi, I have a fairly complex form and I am wondering if it is even possible to do what I am attempting. I have multiple models included in the form. A small example would be the following: Company has many Locations Company has many PhoneNumbers... and so on I have this working without issue using Rails 2.3 and nested forms. Where this becomes complex is that I also have another model named
2005 Oct 18
2
smbd looping and consuming 100% CPU
Hi All, I have a samba 3.0.4 installation on AIX 5.2 ML05. The problem I am facing is that sometimes one smbd is looping and consuming up to 100% CPU time. In the log I see the following entry: =============================================================== [2005/10/18 11:35:34, 0] lib/fault.c:fault_report(37) INTERNAL ERROR: Signal 11 in pid 39316 (3.0.4) Please read the appendix Bugs of
2010 Feb 09
0
For and while in looping
I would like to solve a nonlinear eqn using newton method and here is the code:   library(numDeriv)   fprime <- function(z) { alp  <- 2.0165;   rho  <- 0.868;   # simplified expressions   a      <- alp-0.5   c1     <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)   c2     <- sqrt(rho)/(1-rho)   t1     <- exp(-z/(1-rho))   t2     <- (z/(2*c2))^a    bes1   <- besselI(z*c2,a)  
2009 May 25
2
Looping through java hashmap from ruby through rjb
Greetings. I am trying to list all keys in a java.util.HashMap field. The Java code to do this looks like: # Collection c = hMap.values(); # # //obtain an Iterator for Collection # Iterator itr = c.iterator(); # # //iterate through HashMap values iterator # while(itr.hasNext()) System.out.println(itr.next()); So, I took a stab at the ruby version: # I have a java hashmap called fields
2000 Jan 12
1
unrequired headers (looping affect in NeXT)
In bsd-login.[hc] and login.c seems to have #include <utmp.h> that are unneeded (and platforms with non-protected headers files trips on them.) Could I get a few people on different platforms remove them and see if they cause any compiling issues it would make my life easier (and less required #ifdef grabage). bsd-login.c:52:#include <utmp.h> bsd-login.h:7:#include <utmp.h>