similar to: Trying to perform an inner loop a random number of times

Displaying 20 results from an estimated 7000 matches similar to: "Trying to perform an inner loop a random number of times"

2011 Apr 25
1
Trouble Passing a for loop variable (iteration #) to a data frame
Greetings - I am working on a piece of code to simulate vehicle times in and out in each of a number of parking spaces. At this stage, my code basically does what it is supposed to do but for the sequential number of each new parking event for a given space (i.e., the index of the loop variable). Instead of passing the index of the loop variable (iter) to the data frame, it passes the value
2008 Oct 15
2
R: "in-place" appending to a matrix.
Hello fellow R sufferers, Is there a way to perform an appending operation in place? Currently, the way my pseudo-code goes is like this for (i in 1:1000) { if (some condition) { newRow <- myFunction(myArguments) X <- rbind(X, newRow) # <- this is the bottleneck!! } } As you can see, it works but as the matrix X gets the size of a few million rows, the
2011 Nov 23
1
Losing custom attributes
Hi All, I was adding a new row of data to my data frame using rbind(). I was surprised to see that after adding new row, I lost my data frame level attibute as well as col level attribute. Please help me to insert a new row at frist or middle position so that my custom attribute is not lost. Here is what I did. age<-c(15,20,18) weight<-c(40,42,30) ### creating my data frame
2011 Nov 24
3
Is there way to add a new row to a data frame in a specific location
Is there easy way (without copying the existing rows to a temporary location and copying back) to add a new row to a specific index location in an existing data frame? Example df = data.frame( A= c('a','b','c'), B=c(1,2,3), C=(10,20,30)) newrow = c('X', 100, 200) I want to add the newrow as the second row to the data frame df Please suggest a solution that is
2000 Mar 09
1
[Galen Hancock <galen@veribox.net>] Information leakage in sshd
Hi, Thought I'd just forward this here, because I don't have time to look into it right now, and am off skiing next week. I'd guess that we should be checking for username = ``root'' before going off to do password checks, and rejecting it on that basis first. Cheers, Phil. -- Mind-numbingly stupid UK law alert! Act now to stop it! http://www.stand.org.uk/ --------------
2006 May 12
7
RJS and page.select collection size
I need to implement a conditional in my RJS template which looks something like: if (page.select(''row1'').first != null) page << "new TableRow.MoveAfter(''row1'', ''newrow'');" else page << "new TableRow.MoveAfter(''row2'', ''newrow'');" end Now, dumb question.. My
2011 Nov 23
2
SPSS F-test on change in R square between hierarchical models
Hi, I am wondering if anyone knows how to perform an F-test on the change in R square between hierarchical models in R? SPSS provides this information and a researcher that I am working with is interested in getting this information. Alternatively, if someone knows how I can calculate the test statistic (SPSS calls it F-change?) and dfs that would be helpful as well. The output and the test I am
2009 Jul 11
5
Resilvering Loop
I have a situation where my zpool (with two radiz2s) is resilvering and reaches a certain point, then starts over. There no read, write or checksum errors. The disks do have a fair amount of resilvering to do, as I''ve had a variety of disk failures. But at the core of things, there''s enough parity data to avoid data loss, and the zpool is functioning fine, albeit in a
2011 Oct 29
1
Add col in data.frame
Hello Gurus, I am still new to R. Here is my issue. I was trying to add column to data frame that was populated by read.spss(). When I used cbind to add a new variable(column). library(foreign) mydf<-read.spss(file="C:/myspss.sav",use.value.labels=FALSE, to.data.frame=TRUE,use.missings=FALSE) attr(mydf,"variable.labels") ## it gives you all the labels
2011 May 31
3
DateTime Math in R - POSIXct
Greetings - I'm battling POSIXct, as per the code below. My input is actually an XL file, but the weird results below correctly model what I am seeing in my program. Before I punt and use lubridate or timeDate, could anyone please help me understand why POSIXct forces my variable back to GMT? I suspect that I'm not properly coding the tzone value, but it does not throw an
2002 Aug 06
2
wine troubleshooting solution not found
I've tried codeweavers and winex and have tested my config with winecheck [100%] but yet no wine err:seh:EXC_DefaultHandling Unhandled exception code c0000005 flags 0 addr 0x400be29e I've used wine for years and I'm baffled why I have no wine Others with my distro [PeanutLinux] do run wine with no problem NVIDIA driver [ge2] win98 -- Galen Thurber Web Consultant For Hire
2010 Aug 13
1
loop for inserting rows in a matrix
Dear R friends, I have a matrix with 2060 rows and 41 columns. One column is Date, another is Transect, and another is Segment. I want to ensure that there are 9 Transects (1 to 9) for each Date, and 8 Segments (1 to 8) for each Transect in the matrix, by inserting rows where these are missing. I am new to coding, but am trying to write a loop which checks if each of the transects already
2009 Jul 10
5
Slow Resilvering Performance
I know this topic has been discussed many times... but what the hell makes zpool resilvering so slow? I''m running OpenSolaris 2009.06. I have had a large number of problematic disks due to a bad production batch, leading me to resilver quite a few times, progressively replacing each disk as it dies (and now preemptively removing disks.) My complaint is that resilvering ends up
2011 Jun 02
1
Adding a line to a beside=TRUE barplot
Greetings – Grateful for any help on this one: In the following demo code, I am trying to get the points in the line to appear over the same x-axis labels as are used by the paired Bars. It appears, however, that R/lattice ignores the x-axis points used by the bars and plots the x points for the line at ½ points. Can you help me tweak this code so that the nth bump in the line
2010 May 02
1
Shell command help
Dear R Community, I am trying to run a command line in R that will open an external program, have it import a specific input file, run the program, then close the program. The command line that I got from the developer of the model to do this looks like what you see below: c:\programx.exe -import 'inputx.inp' -run -quit I have been trying to use shell() or shell.exec() to run this in
2011 Nov 12
1
With an example - Re: rbind.data.frame drops attributes for factor variables
When I use rbind() or rbind.data.frame() to add a row to an existing dataframe, it appears that attributes for the column of type "factor" are dropped. See the sample example below to reproduce the problem. Please suggest How I can fix this. Thanks, Sammy a=c("Male", "Male", "Female", "Male") b=c(1,2,3,4) c=c("great", "bad",
2011 Jun 07
1
Custom Sort on a Table object
Greetings - I've got the following table (the result of a two-way table operation): f m 0 to 5 11.328000 6.900901 15 to 24 6.100570 5.190058 25 to 34 9.428707 6.567280 35 to 44 10.462158 7.513270 45 to 54 7.621988 5.692905 5 to 14 6.502741 6.119663 55 to 64 5.884737 4.319905 65 to 74 5.075606
2006 Mar 19
0
[LLVMdev] Stupid '-load-vn -licm' question (LLVM 1.6)
On Mar 17, 2006, at 12:19 PM, Chris Lattner wrote: > Great. Note that -cee is a beta pass... it has some known bugs and > isn't planned to be worked on in the immediate future. :( After a bit of digging, I found one open bug and two failing test cases, all of which appear to be feature requests: #217: LLVM needs a generic dominator update mechanism nullpointer.ll: "a
2008 Nov 10
1
Issue with Mac OSX version of R (PR#13275)
Full_Name: Galen papkov Version: 2.8.0 OS: Tiger v.10.4.11 Submission from: (NULL) (129.7.91.106) The Package Installer cannot seem to find the CRAN source. When I try to "Get List", I get the following error: Error in read.dcf(file = tmpf) : Found continuation line starting ' <!DOCTYPE HTML P ...' at begin of record. I also tried to put the URL in directly with the
2004 Jul 29
3
Editing Strings in R
I was wondering if there is a way of editting strings in R. I have a set of strings and each set is a row of numbers and paranthesis. For example the first row is: (0 2)(3 4)(7 9)(5 9)(1 5) and I have a thousand or so such rows. I was wondering how I could get the corresponding string obtained by adding 1 to all the numbers in the string above. Dursun [[alternative HTML version deleted]]