search for: ragged

Displaying 20 results from an estimated 110 matches for "ragged".

2011 Dec 20
1
Convert ragged list to structured matrix efficiently
Hi All, I'm wanting to convert a ragged list of values into a structured matrix for further analysis later on, i have a solution to this problem (below) but i'm dealing with datasets upto 1GB in size, (i have 24GB of memory so can load it) but it takes a LONG time to run the code on a large dataset. I was wondering if anyone had any...
2011 Oct 16
2
question: ragged array
...ust not able to solve. I created the following mean value from the following dataset structure: Id |value 1 | 2 1 | 3 1 | 4 2 | 2 2 | 1 3 | 5 4 | 3 etc.|etc. with the command: mean_rating <- tapply(ratok$value, ratok$project_id , mean,simplify = FALSE) this gives me a ragged array: > mean_rating [1] $`14` ###########==project_id [1] 3.933333 #######==mean value > dim (mean_rating) [1] 2214 I want to separate now the project_id from the mean value. So that I have two separate columns (2 dimension). How can I separate a ragged array into two...
2012 Oct 23
10
How to pick colums from a ragged array?
...individuals which have pairs of rows with the same ID and (lowest or highest) DATE. The size of the dataset precludes the option of doing this by eye. I suspect there is a very elegant way of doing this in R. This is what I've come up with: - Sort by DATE then ID - Make a ragged array of DATE by ID - Remove IDs that only occur once. - Subtract the first and second DATEs. Remove IDs for which this = zero, as this will only be true for IDs for which the appointment is recorded twice (because there were two diagnoses recorded on this date). - (Th...
2004 Sep 13
1
Adding ranks to a repeatedly ragged array
How can I add an extra column containing the rank to a ragged array indexed by more than one grouping factors? E.g. with the barley dataset: How can I to add an additional column ``rank'' containing the rank of the ``yield'' of the different varieties in relation to the indices ``year'' and ``site'' to the barley dataframe?...
2011 Jun 03
0
ragged data.frame? using plyr
...score_mean_iqr<-data.frame(id=names(tblscore_iqr),mean=tblscore_mean,iqr=tblscore_iqr) However, as it turns out, my data look more like: dat<-dat[-sam] ldply(dlply(dat,.(id,day),adj.values),length) So on different days I only have data for some of the id variables which leads to a "ragged" data.frame. ddply(dat,.(id,day),adj.values) can i do something like ldply(dlply(dat,.(id.day),adj.values), function(x){put in a NA for the places where data is missing?}) To give you a sense of where this is going, I'm eventually going to plot the mean of each id variable over the ti...
2006 May 26
4
stopping effects, help me again please
Hi * and thanks for you responses some body help me stop effect, just last effect. Thanks! to somebody help me with: Pulsator = Class.create(); Pulsator.prototype = {initialize: function(element) { this.stopped = false; new Effect.Pulsate(element, { afterFinish: this.action.bind(this) }); },action: function(element){if(!this.stopped) new Effect.Pulsate(element, { afterFinish:
2009 Jun 22
5
Convert "ragged" list to matrix
Hi, I have a list made up of character strings with each item a different length (each item is between 1and 6 strings long). Is there a way to convert a "ragged" list to a matrix such that each item is its own row? Here is a simple example: a=list(); a[[1]] = c("a", "b", "c"); a[[2]] = c("d", "e"); a[[3]] = c("f", "g", "h", "i"); I would like to conver...
2007 Nov 24
1
ragged array with append
I wonder what's the right way in R to do the following -- placing objects of the same kind together in subarrays of varying length. Here's what I mean: > word <- c("a","b","c","d","e","f","g","h","i","j") > kind <- c(1,1,1,2,3,4,5,5,7,7) > d <-
2006 Jul 19
2
Aligning ragged text columns
Can anyone please suggest how I can print: a <- matrix(c( "Heading 1", "This is some info\nabout heading 1", "Heading 2", "This is some info\nabout heading 2", ), byrow=T, nrow=2) to look like: Heading 1 This is some info about heading 1 Heading 2 This is some info about heading 2 (if you're not using a fixed width
2011 May 07
2
write.table vs. read.table and the argument "fill"
Just wondering how come read.table lets you specify fill=TRUE for ragged arrays, but so far as I can tell, no equivalent for write.table? Not a big deal, since I'm perfectly comfortable w/ write and scan and the other file I/O goodies. "A foolish inconsistency..." and all that. Carl
2001 Oct 22
1
statistics for ragged arrays: loop to vector
Dear R users, I am currently writing a MCMC algorithm for spatial Poisson model. One problem which I need to solve is as follows: I have a vector X[1:J] which describes characteristics of cells of a rectangular grid. Further, for each cell I have a list of adjascent cells adj[] and the vector listing numbed of adjascent cells num[]. Thus if I want to list cells adjascent to cell i I write
2008 Oct 03
2
Ragged time series data
Hi and thanks in advance, I am fairly new with R so I hope this problem isn't too amateur. I have a vector of count data which correspond to vectors of date (%m/%d/%Y) and time of day (%H:%M:%S). I am trying to compute various statistics (e.g. daily max) by lumping the data together by day. I have been able to utilize tapply() and group the counts together, but with the method I use I end
2006 Jul 25
3
problem with *.foobar.com urls
I am using Apache2.2 + mod_proxy_balancer + mongrel setup and my mongrel.conf file(for apache is like this) 2 3 <Proxy balancer://mongrel_cluster> 4 BalancerMember http://127.0.0.1:9000 5 BalancerMember http://127.0.0.1:9001 6 BalancerMember http://127.0.0.1:9002 7 </Proxy> 8 9 <VirtualHost *> 10 ServerAdmin rags at
2007 Mar 16
1
Fast lookup in ragged array
Hello, I'm running an algorithm for graph structural cohesion that requires a depth-first search of subgraphs of a rather large network. The algorithm will necessarily be redundant in the subgraphs it recurses to, so to speed up the process I implemented a check at each subgraph to see if it's been searched already. This algorithm is very slow, and takes days to complete on a
2005 Feb 18
4
barplot and ylim - display problems
...llowing single line of code shows what I am trying to do, and the problem I am having... barplot(c(101,102,103),ylim=c(100,103)) The 'xaxis' is missing, and the grey bars 'fall off' the plot area. This is generally ugly, and I would like to trim the bars (ideally they would have a ragged appearance to show that I am 'zooming in'). I can see why what I am trying to do is conceptually a bit tricky, as the yaxis needs to be closly inspected to see the data in its propper context. This is simply fixed by showing... barplot(c(101,102,103)) However, I want to first show the da...
2006 May 18
5
more that 5 time beats for effect.pulsate
hi again How can i extend 5 times for effect.pulsate beats? I need that continue beat until other event client happened about my other mail, is there other solution more elegant that this? : new Effect.Pulsate(leccion[i_leccion],{duration: 5,from: 1}); thanks again rag
2012 Apr 05
0
Multi part problem...array manipulation and sampling
Ok, I have a new, multipart problem that I need help figuring out. Part 1. I have a three dimensional array (species, sites, repeat counts within sites). Sampling effort per site varies so the array should be ragged. Maximum number of visits at any site = 22 Number of species = 161 Number of sites = 56 I generated the array first by; mydata<-tapply(spdata1$NTOTAL,list(spdata1$COUNT,spdata1$SPECIES,spdata1$SITESURVEY),sum) where spdata1$NTOTAL = number of detections spdata1$COUNT = repeat visit per site (...
2016 Sep 09
2
R-intro: function 'stderr' and 'sd'
In "An Introduction to R" Version 3.3.1, in "4.2 The function tapply() and ragged arrays", after stderr <- function(x) sqrt(var(x)/length(x)) , there is a note in brackets: Writing functions will be considered later in [Writing your own functions], and in this case was unnecessary as R also has a builtin function sd(). The part "in this case was unnecessary as R a...
2008 Mar 08
2
pdflatex: fuzzy fonts in Evince, but not on paper output
...ling the 'memoir' class. I can run 'latex document.tex' ok: the resulting .dvi looks nice in xdvi. When running 'dvips -o document.dvi', I get a .ps file that I can view OK in Evince. But when I run 'pdflatex document.tex', the fonts in the resulting PDF are all ragged and fuzzy... though the print output is OK. I thought I'd rather post this question here, since the answer is probably distribution-specific. Any suggestions? Niki
2013 Mar 09
3
data.frame with variable-length list
...) 2 b 2 list(4, 5, 6) 3 c 3 list(7, 8, 9, 10) I discovered this in the R Language Definition manual: "A data frame can contain a list that is the same length as the other components. The list can contain elements of differing lengths thereby providing a data structure for ragged arrays. However, as of this writing such arrays are not generally handled correctly. (2.3.2)" Is this still the case? What does 'not handled correctly' mean? Can I do something like: sample(df$rtn, 1) If this isn't the way to do this, can you suggest the correct way? Thanks for...