similar to: Getting data out of a loop

Displaying 20 results from an estimated 300 matches similar to: "Getting data out of a loop"

2006 Aug 28
2
Cannot get simple data.frame binding.
I am stuck on a simple problem where an example works fine but the real one does not. I have a data.frame where I wish to sum up some values across the rows and create a new data.frame with some of old data.frame variables and the new summed variable. It works fine in my simple example but I am doing something wrong in the real world. In the real world I am loading a labeled data.frame. The
2007 Feb 02
1
Assigning labels to a list created with apply
I have a simple data base and I want to produce tables for each variable. I wrote a simple function fn1 <- function(x) {table(x)} where x is a matrix or data.frame. and used apply to produce a list of tables. Example below. How do I apply the colnames from the matrix or names from the data.frame to label the tables in the results in the list. I know that I can do this individually but
2007 Feb 07
6
setting a number of values to NA over a data.frame.
This is probably a simple problem but I don't see a solution. I have a data.frame with a number of columns where I would like 0 <- NA thus I have df1[,144:157] <- NA if df1[, 144: 157] ==0 and df1[, 190:198] <- NA if df1[, 190:198] ==0 but I cannot figure out a way do this. cata <- c( 1,1,6,1,1,NA) catb <- c( 1,2,3,4,5,6) doga <- c(3,5,3,6,4, 0) dogb <- c(2,4,6,8,10,
2009 Sep 19
1
Re-order columns
Dear R'sians, Would really appreciate if you could suggest a more efficient way to order the columns of a dataset. The column names of the dataset contain indices separated by a period. Following are examples of my code and the dataset. oC <- function(tg=x2) { lth <- length(grep("T",names(tg))) thix <-
2006 Aug 07
0
Trying to do aseries of subsets with function or for loop
I want to calculate the "scat" etc, values for each level of id, output a vector of these values that is a <- c(scat, sdog, srat, sbat ) and do an rbind on them. Each level of id has a different value of rate. So far it it looks to me like I can do this by a series of repeated subsets of Df butI would think that I should be able to do this with a function but I am not having
2012 Mar 08
6
how to modify the tickment of x-axis
hi I plot a series of observation data every minutes in a day as the attachment below plot(wnd,type='l',lty=1,col='red',lwd=1,xlab=xxlab,ylab=yylab,ylim=YY) In the figure, the x-axis tickment is the number of data How can I change it fore example 1h 2h 3h 4h and so on ? -- TANG Jie Email: totangjie at gmail.com Tel: 0086-2154896104 Shanghai Typhoon Institute,China
2011 Jan 13
0
Help with Data Transformation - RESOLVED
Hi Dennis, SOLVED!!! My thanks to both you, John, and others who chimed in. Took a little more digging before finally working, but it is working! Here's a little more of what I did and the ultimate resolutions: I installed the reshape2 library from CRAN. Executed > (.packages()) [1] "reshape2" "stats" "graphics" "grDevices"
2007 Mar 09
1
Applying some equations over all unique combinations of 4 variables
#I have a data set that looks like this. A bit more complicated actually with # three factor levels but these calculations need to be done on one factor at a #I then have a set of different rates that are applied #to it. #dataset cata <- c( 1,1,6,1,1,2) catb <- c( 1,2,3,4,5,6) doga <- c(3,5,3,6,4, 0) data1 <- data.frame(cata, catb, doga) rm(cata,catb,doga) data1 # start rates #
2007 Jun 28
3
Function call within a function.
I am trying to call a funtion within another function and I clearly am misunderstanding what I should do. Below is a simple example. I know lstfun works on its own but I cannot seem to figure out how to get it to work within ukn. Basically I need to create the variable "nts". I have probably missed something simple in the Intro or FAQ. Any help would be much appreciated. EXAMPLE
2006 Jul 01
1
Uh oh, Error solving...
undefined method `stringify_keys'' for [["Craved"], ["Whole Sale"]]:Array I did this earler in the script how come now it''s yealling? <% catas = Category.find(:all, :order=> "name").map {|u| [u.name]} -%> <p><label for="item_cata">Catagory:</label><br/> <%= select ''item'',
2011 May 29
22
[Bug 8177] New: Problems with big sparsed files
https://bugzilla.samba.org/show_bug.cgi?id=8177 Summary: Problems with big sparsed files Product: rsync Version: 3.0.8 Platform: x64 OS/Version: Linux Status: NEW Severity: normal Priority: P5 Component: core AssignedTo: wayned at samba.org ReportedBy: joluinfante at gmail.com
2013 Dec 15
1
Rows to Column
Hi all, I'm kinda new in R programming and I need some help preparing a database to run logistic regression. I have data in a tuple form: *id cat val* 1 A 2 1 C 4 3 B 1 5 A 2 6 A 3 6 B 5 6 C 2 8 B 5 8 D 2 9 D 3 and would like to have it like: *id catA catB catC catD* 1 2 0 4 0 3 0 1 0 0 5 2 0 0 0 6 3
2006 Aug 17
1
MAC to Windows 2003
Where do I find a version of Samba that will work on Windows 2003? I would be happy to test a bata version of one was available. I need to connect new MAC G5's to a Windows 2003 server for file sharing and storage. Thank you for your help. Danny Martin Instructional Designer 912-353-5277
2001 Jul 04
1
Ogg Vorbis ripping/encoding on Windows
I think the new web page is wonderful. However, one thing annoyed me. Some programs on 'Other Software Which Supports Ogg Vorbis' page at Vorbis.com seems to be bit problematic. As far as I know, at least two of them have not updated their plug-ins for a while. 1. 'CD-DA X-Tractor' vorbenc-20001018.zip as 'Latest released version of vorb_enc.dll' 2. 'Media
2007 Feb 07
1
FOSDEM: Lodging and presentations
Hi all, Since it looks like I''ll be attending FOSDEM, I now need to find some lodging, and if possible I''d like to line up a presentation or four. Someone in the community offered to let me crash with them if I came to the conference (someone with the nick of ''robk'' on IRC, I think), so I''d like to take that person up on it if possible.
2007 Jun 02
7
u32 classifier
Hi folks...!!! I´ve a problem that i did not solve it. i want to limit the DOWNLOAD to my hosts (upstream traffic for the firewall) using IMQ, If i classify by PORT (source or destination) all seems to be fine, but...BUT...if i want to restrict by IP addresss (internal IP address) i can´t do it, because my hosts go to Internet toward the firewall using NAT, so after NAT my IP address in
2005 Oct 11
5
openssh 4.2p1 bug
hello, I have just installed openssh 4.2p1 and it seems that sshd child process crash if /var/empty/usr/lib do not exist. Here is a strace log ( before creating this directory): 26787 open("/etc/protocols", O_RDONLY) = -1 ENOENT (No such file or directory) 26787 getsockopt(3, SOL_IP, IP_OPTIONS, "", [0]) = 0 26787 socket(PF_UNIX, SOCK_STREAM, 0) = 6 26787 connect(6,
2012 Apr 12
3
Remove superscripts from HTML objects
Is there some way to remove superscripts from objects returned by html/xmlParse (XML package)? h <- "<html><p>Cat<sup>a</sup></p><p>Dog</p></html>" doc <- htmlParse(h) xpathSApply(doc, "//p", xmlValue) [1] "Cata" "Dog" I could probably remove the <sup> tags from the "h" object above,
2013 Mar 30
3
how to draw the math graph?
how can i draw the graph in R?
2009 Mar 29
1
Data decomposition
Hi R users, I have a time series variable that is only available at a monthly level for 1 years that I need to decompose to a weekly time series level - can anyone recommend a R function that I can use to decompose this series? eg. if month1 = 1200 I would to decompose so that the sum of the weeks for month1 equals 1200, etc.. Many thanks in advance for any help. -- View this message in