similar to: Naming output of a for loop

Displaying 20 results from an estimated 10000 matches similar to: "Naming output of a for loop"

2010 Jun 04
2
Help with iteration using while loop
Hello everyone, I am trying to use while loop to iterate a function until convergence. But I am having problem when I try to use a fixed number of iterations. Say I want to use maximum iteration of 150. If the value don't converge within maximum iteration, show warning of no convergence. Currently I don't have non- convergence problem so I think my code works fine. But in future I may
2010 Jan 01
1
Questions bout SVM
Hi everyone, Can someone please help me in these questions?: 1)if I use crossvalidation with svm, do I have to use this equation to calculate RMSE?: mymodel <- svm(myformula,data=mydata,cross=10) sqrt(mean(mymodel$MSE)) But if I don’t use crossvalidation, I have to use the following to calculate RMSE: mymodel <- svm(myformula,data=mydata) mytest
2011 Dec 05
1
Problem in while loop
Hi all, I have the following code, When I run the code, it never terminate this is because of the while loop i am using. In general, if you need a loop for which you don't know in advance how many iterations there will be, you can use the `while' statement so here too i don't know the number how many iterations are there. So Can some one suggest me whats going on? I am using the
2005 Jun 14
8
ADSL Calculator
Hi, I''ve written a small javascript ADSL throughput calculator: http://nukunuku.yamamaya.is-a-geek.org/~ranma/adsl.html Feel free to submit alternative presets (I currently have presets for three german telecom speed variants: T-DSL (1000|2000|3000), derived from http://www2.lancom.de/kb.nsf/5d445c701b3ff52dc1256e7700297e5c/27c6ee1c3e3f74b0c1256e94004a433e?OpenDocument). Comments,
2009 Nov 05
1
NLM OUTPUT
I am missing something fundamental. I ran the function nlm, but I don't understand how to extract the optimal solution as a numeric vector. The function produces it as one element of a list. I don't see anything in the R documentation about converting such a list element to the vector it displays. Thanks, Bob Robert Agnew | Discover Director Acquisition Analytics Marketing –
2011 Sep 05
2
Need more information about VGLM
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20110905/43ff838a/attachment.pl>
2009 Jul 28
1
different names for new files in a for loop
Hi, I have an excel file with 10 columns and I am trying to create new excel files each with columns 1, 2, and columns 3-10. Does anyone know how to change the name of the file in a for loop so that the first new file will have columns 1, 2, 3 with a name and then the next file will have columns 1, 2, 4 with a different name and so on till i get to the 8th new file with columns 1, 2, 10? Thank
2010 May 05
3
Symbolic eigenvalues and eigenvectors
Let's say I had a matrix like this: library(Ryacas) x<-Sym("x") m<-matrix(c(cos (x), sin(x), -sin(x), cos(x)), ncol=2) How can I use R to obtain the eigenvalues and eigenvectors? Thanks, John [[alternative HTML version deleted]]
2011 Feb 10
2
for loop to merge .csvs
So I needed to merge 17 .csv files, and did so by brute force, but I might need to do so again. Anyone have suggestions for a for loop that might do the below for me (where a:r are separate .csv files) ab<-merge(a,b,all=TRUE) cd<-merge(c,d,all=TRUE) ef<-merge(e,f,all=TRUE) gh<-merge(g,h,all=TRUE) ij<-merge(i,j,all=TRUE) kl<-merge(k,l,all=TRUE) no<-merge(m,n,all=TRUE)
2009 Jul 27
1
Creating new data frame using loop
Hi all, I sent a request round last week asking for help with using a "for" loop to read and separate a large dataset. The response I got worked great, but now I have another problem with using my loop. Basically I have a number of different files containing columned data. There are 132 datasets, named such that I have something in the form... precip_colxxx.txt ...where xxx is a
2010 Apr 07
1
Use a variable of a list in a loop
Hi all, My problem may be related with the list manipulations. See below. #example data a<-list() a[[1]]<-data.frame(matrix(c(1:4),ncol=2)); a[[2]]<-data.frame(matrix(c(5:8),ncol=2)) I can use a[[1]]$X1,a[[1]]$X2,a[[2]]$X1,a[[2]]$X2 to use the corresponding variables. But what i need to do is to use function parameters to specify the variable names. The variable names will be
2012 Feb 03
2
Assigning objects to variable and variable to list in a for loop
Hello, I want to use a for loop for repeadely calculating a maxent model (package dismo, function maxent()) which creates an object of the class maxent (S4). I want to collect all the resulting object in a list. I tried to simplify my for loop to explain what I want. There are two problems/questions: 1) How can I create the new variables in the loop (using paste) and assign the objects 2) How
2012 Jan 11
1
Help with speed (replacing the loop?)
Dear R-ers, I have a loop below that loops through my numeric variables in data frame x and through levels of the factor "group" and multiplies (group by group) the values of numeric variables in x by the corresponding group-specific values from data frame y. In reality, my: dim(x) is 300,000 rows by 100 variables, and dim(y) is 120 levels of "group" by 100 variables. So, my
2011 Mar 24
2
Using C code in R
Hi, I am new to R and I want to know how to use C code which contains two functions one called inside another.I know that how to use C code in R if it has only one function but dont know how to do it in above case. I want to use the same in R .My C code is as follows. //#include <R.h> void sayHello(); void g(); void sayhello() { Rprintf("Hello world %d\n",global); } void
2011 Sep 15
1
Where to put tryCatch or similar in a very big for loop
Dear all, I am running a simulation study to test variable imputation methods for Cox models using R 2.9.0 and Windows XP. The code I have written (which is rather long) works (if I set nsim = 9) with the following starting values. >bootrs(nsim=9,lendevdat=1500,lenvaldat=855,ac1=-0.19122,bc1=-0.18355,cc1=-0.51982,cc2=-0.49628,eprop1=0.98,eprop2=0.28,lda=0.003) I need to run the code 1400
2010 May 05
2
probabilities in svm output in e1071 package
svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification", kernel="radial", cost=bestc, gamma=bestg, cross=10) # model fitting svm.pred<-predict(svm.fit, hh, decision.values = TRUE, probability = TRUE) # find the probability, but can not find. attr(svm.pred, "probabilities") > attr(svm.pred, "probabilities") 1 0 1 0 0 2 0
2010 Feb 02
2
using rbind in a for loop
*Dear R users, *I'm facing a trivial problem but I cannot solve it. My question is: I want to make data set like this. > i_lon1 i_lat1 i_lon2 i_lat2 i_lon3 i_lat3 i_lon4 i_lat4 > i+1_lon1 i+1_lat1 i+1_lon2 i+1_lat2 i+1_lon3 i+1_lat3 i+1_lon4 i+1_lat4 > i+2_lon1 i+2_lat1 i+2_lon2 i+2_lat2 i+2_lon3 i+2_lat3 i+2_lon4 i+2_lat4 . . . > i+5_lon1 i+5_lat1 i+5_lon2 i+5_lat2 i+5_lon3
2009 Aug 18
2
open txt
Não consigo abrir a pasta txt no R, dá a mensagem: Warning message: In file(file, "r") : cannot open file 'plantula.txt': No such file or directory O arquivo está na mesma página do Scrip. Não sei qual é o problema???? [[alternative HTML version deleted]]
2011 Jul 05
3
Output data frame using write.table
Dear all, I have a data frame whose name is m1. I want to write this data frame in text file as output.I am using this code- write.table(m1, file = "kas.txt", append = FALSE,row.names=F,quote=F,sep="\t") When I am opening my kas.txt file,the column names are not coming exactly above the column. What should I do.Please help me. Thanking you, Warm Regards Vikas Bansal Msc
2012 Mar 09
1
Eigenvalue calculation of sparse matrices
Dear all, I am currently working on the calculation of eigenvalues (and -vectors) of large matrices. Since these are mostly sparse matrices and I remember some specific functionalities in MATLAB for sparse matrices, I started a research how to optimize the calculation of eigenvalues of a sparse matrix. The function eigen itself works with the LAPACK library which has no special handling for