similar to: for loop

Displaying 20 results from an estimated 30000 matches similar to: "for loop"

2012 Nov 19
6
How to subset my data and at the same time keep the balance?
Hi guys, I have 1000 rows of a dataset. In my analysis, I need 70% of the data, run my analysis and then use the remaining 30% to test my model. Could anybody kindly help me on this? Cheers
2012 May 28
1
need help in logistic regression
Hello everyone, I tried to understand the relationship between temperature and the death of an organism by using logistic regression. glm(formula = Death ~ Temperature, family = binomial(link = "logit"), data = mydata) Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -87.9161 7.7987 -11.27 <2e-16 *** Temperature
2011 Mar 16
4
'x' values must be positive.
> b [1] "2" "1" "1" "1" "1" "1" > pie(b) Error in pie(b) : 'x' values must be positive. Can someone help me? And sorry i am an beginner -- View this message in context: http://r.789695.n4.nabble.com/x-values-must-be-positive-tp3381744p3381744.html Sent from the R help mailing list archive at Nabble.com.
2011 Apr 28
1
Trying to perform an inner loop a random number of times
Grateful for any hints as to why I'm not getting the inner loop to cycle the expected number of times. Code and one run's results below. Thanks, Galen > # source("looptest.r") > sp<-numeric() > iter<-numeric() > rn<-numeric() > ds<-data.frame(sp, iter, rn) > > for (sp in c(1:6)) { + i<-1 +
2011 Oct 24
2
How to selectively sum rows [Beginner question]
Hi, I am new to R so I would appreciate any help. I have some data that has passenger flight data between city pairs. The way I got the data, there are multiple rows of data for each city pair; the number of passengers needs to be summed to get a TOTAL annual passenger count for each city pair. So my question is: how do I create a new table (or data frame) that selectively sums My initial
2011 Sep 16
2
automatic selection of object without loop
Hello, does anyone know the solution to this problem: I imported a dataframe from Spss into R and saved it as an object called "kinderrechte". I have got the following command lines: q1 <- kinderrechte[,"q0007_0001"] l1 <- q0007_0001_l now i would like to be able to change the column name in the first command line (e.g. into q0007_0002) and to get R to automatically
2012 Apr 06
2
Sincere inquiry about “subscript out of bounds” error in R
Hello£¬experts I am working on a simulation of effect of artificial selection on certain population in Animal Breeding.I am new beginner in coding. I have already build a matrix A(500*500) based on this code A<-matrix(,500,500) for(i in 1:500){ for(j in 1:500){ ifelse(i==j,A[i,j]<-1,A[i,j]<-0) } } and I need to caculate A2 base on A and X1(4500*4500).Here are the codes
2012 Feb 17
3
editing import data, strings
Regards. I'm a beginner in programing, so I have a basic question for you. If someone could help me please.. I want to create a function, which will be able to export files from excel. I tried with a <- read.csv(file, sep =",", as.is = TRUE, row.names = 1, header = TRUE), .. but instead of numbers, it gives me strings for example: "299,311". I can handle this string
2005 Jun 03
2
POP3 download problem
Hi All I am experiencing a mail download problem with dovecot's pop3 protocol. We use outlook XP 2002 mail clients and I have setup a mail system with pop accounts on a Fedora 2 installation using dovecot. Some of the clients download email fine but others do not download email and also do not give any error messages. I have enabled the "verbose" options in the
2016 Nov 03
2
The code itself disappears after starting to execute the for loop
Hi all, I've a question concerning the R 3.3.1 version. I have a long code that I used to run on versions earlier to the 3.3.1 version, and when I copied the code to the R console, I can still see the code while the loop is executing , along with the output printed after each iteration of the loop. Now, on the 3.3.1 version, after I copy the code to the console, it disappears and I only see
2016 Nov 03
2
The code itself disappears after starting to execute the for loop
Hi all, I've a question concerning the R 3.3.1 version. I have a long code that I used to run on versions earlier to the 3.3.1 version, and when I copied the code to the R console, I can still see the code while the loop is executing , along with the output printed after each iteration of the loop. Now, on the 3.3.1 version, after I copy the code to the console, it disappears and I only see
2012 Jul 15
4
computing a subset using a loop
Dear all, I have a data frame with different variables and I want to build different subsets out of this data frame using some conditions and I want to use a loop because there will be a lot of subsets and this would be saving a lot of time. I try to give you an overview about my data frame. I have a data frame named "Baumdaten" and it has one column named "transectID" with
2011 Nov 25
2
perfectionism
I have a named vector: > z <- c(1, 2, 3, 2) > names(z) <- c("a","b","c","b") > f <- c("b","c") I want to know the index in z of the first occurrence of each of the values in f. One implementation is > sapply(f, function(x) which(names(z)==x)[1]) b c 2 3 Is which() smart enough to stop when it finds in z the
2011 Feb 05
2
Help!!! from R beginner
Hello, I'm trying to add a column to the following data frame. The new column will contain "black" when the 5th column(if_TE_related) is "TE_related", or "orange" when the 4th column is " " (space). "chromo" "MSU_locus" "end5" "end3" "if_TE_related" "chr04" "LOC_Os04g01006" 1032
2016 Apr 24
1
assign color to subsets
'grepl' returns a logical vector; you have to use this to get your subset. You can use: df_tq <- subset(df, grepl("t1", Command)) df_t2 <- subset(df, grepl("t2", Command)) # if you want to also get a subset that has both, use df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command)) Jim Holtman Data Munger Guru What is
2007 May 30
1
Dovecot Authentication Problem (REVISED)
Hello List, I am back again and I think I am edging closer to getting a solution. I have done some modifications and now dovecot gives me a different error message than before.... Here is what I have for the password_query and user_query password_query = SELECT popbox.cleartext AS password FROM popbox, domain \ WHERE popbox.local_part = 'eddie' AND popbox.domain_name =
2005 Mar 08
1
To convert an adjacency list model into a nested set model
Dear R-help I am wondering if somebody wrote some code to convert an adjacency list model into a nested set model. In principal I want to do the same as John Celko mentioned it here with SQL: http://groups.google.co.uk/groups?hl=en&lr=lang_en&selm=8j0n05%24n31%241 %40nnrp1.deja.com Assume you have a tree structure like this Albert / \ /
2013 Aug 30
3
Memory usage bar plot
Hi, I haven't tried the code yet. Is there a way to parse this data using R and create bar plots so that each program's 'RAM used' figures are grouped together. So 'uuidd' bars will be together. The data will have about 50 sets. So if there are 100 processes each will have about 50 bars. What is the recommended way to graph these big barplots ? I am looking
2011 Jun 10
2
Sorting Data Frame Without Loop
Hello all! I am currently trying to sort a data frame in a particular way, but I am having some difficulties with this. Specifically I want to sort the below dataset in such a way that there is only one line per ProteinID and if there are multiple GeneID or GeneName entries for a single proteinID, that they be concatenated with a comma separating them. The way I have done it earlier worked fine
2011 Mar 11
3
How to source a part of the file
I have a text file of R commands. Some times I only want to run a few lines of the R commands in an existing R session and wonder whether there is a simple way to do this. To run a few lines in a new session of R, I could use sed to pick up the lines from the file and pipe them into R. source() does not allow me to specify which lines to be included/excluded. Is there any function that is