similar to: Function for describing segements in sequential data

Displaying 20 results from an estimated 5000 matches similar to: "Function for describing segements in sequential data"

2011 Aug 31
1
formatting a 6 million row data set; creating a censoring variable
List, Consider the following data. gender mygroup id 1 F A 1 2 F B 2 3 F B 2 4 F B 2 5 F C 2 6 F C 2 7 F C 2 8 F D 2 9 F D 2 10 F D 2 11 F D 2 12 F D 2 13 F D 2 14 M A 3 15 M A 3 16 M A 3 17
2012 Oct 16
5
uniq -c
I need an analogue of "uniq -c" for a data frame. xtabs(), although dog slow, would have footed the bill nicely: --8<---------------cut here---------------start------------->8--- > x <- data.frame(a=1:32,b=1:32,c=1:32,d=1:32,e=1:32) > system.time(subset(as.data.frame(xtabs( ~. , x )), Freq != 0 )) user system elapsed 12.788 4.288 17.224 --8<---------------cut
2013 Oct 16
2
How to obtain restricted estimates from coxph()?
Hello, I'm trying to use coxph() function to fit a very simple Cox proportional hazards regression model (only one covariate) but the parameter space is restricted to an open set (0, 1). Can I still obtain a valid estimate by using coxph function in this scenario? If yes, how? Any suggestion would be greatly appreciated. Thanks!!! [[alternative HTML version deleted]]
2017 Dec 29
2
Facing problem in installing the package named "methyAnalysis"
Dear Sir, I have been using R for a long time. But recently I have faced a problem when installing the Bioconductor package named "methyAnalysis". Firstly it was require to update my older R (R version 3.4.3 (2017-11-30)) in to newer version. That time I have also updated the RStudio software. After that when I have tried to install the package named "methyAnalysis". It
2017 Dec 29
2
Facing problem in installing the package named "methyAnalysis"
Thank you Michael Dewey. Can you please send me the email id for Bioconductor. regards Pijush On Fri, Dec 29, 2017 at 5:20 PM, Michael Dewey <lists at dewey.myzen.co.uk> wrote: > Dear Pijush > > You might do better to ask on the Bioconductor list as IRanges does not > seem to be on CRAN so I deduce it is a Bioconductor package too. > > Michael > > > On
2012 Jan 18
2
Table Intersection
I've got two tables.... first one(table1): ID chrom start end Ex1 2 152 180 Ex2 10 2000 2220 Ex3 15 3000 4000 second one ( table2): chrom location name 2 160 Alv 2 190 GNN 2 100
2013 Jul 02
2
cache most-recent dispatch
Hi, S4 method dispatch can be very slow. Would it be reasonable to cache the most recent dispatch, anticipating the next invocation will be on the same type? This would be very helpful in loops. fun0 <- function(x) sapply(x, paste, collapse="+") fun1 <- function(x) { paste <- selectMethod(paste, class(x[[1]])) sapply(x, paste,
2009 Mar 12
4
who can give me some hint?
Hi All, > act_2 Date Dtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51 4 58 2006-02-22 14:52:52 14 52 52 3 60 2006-02-22 14:54:42 14 54
2009 Sep 08
5
sparse vectors
Hi I deal with long vectors almost all of whose elements are zero. Typically, the length will be ~5e7 with ~100 nonzero elements. I want to deal with these objects using a sort of sparse vector. The problem is that I want to be able to 'add' two such vectors. Toy problem follows. Suppose I have two such objects, 'a' and 'b': > a $index [1] 20 30 100000000
2017 Dec 29
0
Facing problem in installing the package named "methyAnalysis"
Dear Pijush You might do better to ask on the Bioconductor list as IRanges does not seem to be on CRAN so I deduce it is a Bioconductor package too. Michael On 29/12/2017 07:29, Pijush Das wrote: > Dear Sir, > > > > > I have been using R for a long time. But recently I have faced a problem > when installing the Bioconductor package named "methyAnalysis".
2012 Nov 05
2
fusion of overlapping intervals
Hello, I have start and end coordinates from different experiments (DNase hypersensitivity data) and now I would like to combine overlapping intervals. For instance (see my test data below) (2) 30-52 and (3) 49-101 are combined to 30-101. But 49-101 and 70-103 would not be combined because they are on different chromosomes (chr a and chr b). Does anybody have an idea? Thanks Hermann > df
2009 Mar 30
2
Sliding window over irregular intervals
Dear all, I have some very big data files that look something like this: id chr pos ihh1 ihh2 xpehh rs5748748 22 15795572 0.0230222 0.0268394 -0.153413 rs5748755 22 15806401 0.0186084 0.0268672 -0.367296 rs2385785 22 15807037 0.0198204 0.0186616 0.0602451 rs1981707 22 15809384 0.0299685 0.0176768 0.527892 rs1981708 22 15809434 0.0305465 0.0187227 0.489512 rs11914222 22 15810040 0.0307183
2017 Nov 29
2
dplyr - add/expand rows
On 11/29/2017 04:15 PM, T?th D?nes wrote: > Hi, > > A benchmarking study with an additional (data.table-based) solution. I don't think speed is the right benchmark (I do agree that correctness is!). For the R-help list, maybe something about least specialized R knowledge required would be appropriate? I'd say there were some 'hard' solutions -- Michael (deep
2017 Nov 28
2
dplyr - add/expand rows
Or with the Bioconductor IRanges package: df <- with(input, DataFrame(station, year=IRanges(from, to), record)) expand(df, "year") DataFrame with 24 rows and 3 columns station year record <character> <integer> <character> 1 07EA001 1960 QMS 2 07EA001 1961 QMC 3 07EA001 1962 QMC 4
2012 Feb 13
2
finding and describing missing data runs in a time series
Hi - I am trying to find and describe missing data in a time series. For instance, in the library openair, there is a data frame called "mydata": library(openair) head(mydata) date ws wd nox no2 o3 pm10 so2 co pm25 1 1998-01-01 00:00:00 0.60 280 285 39 1 29 4.7225 3.3725 NA 2 1998-01-01 01:00:00 2.16 230 NA NA NA 37 NA NA NA 3 1998-01-01 02:00:00
2017 Nov 29
0
dplyr - add/expand rows
Hi, A benchmarking study with an additional (data.table-based) solution. Enjoy! ;) Cheers, Denes -------------------------- ## packages ########################## library(dplyr) library(data.table) library(IRanges) library(microbenchmark) ## prepare example dataset ########### ## use Bert's example, with 2000 stations instead of 2 d_df <- data.frame( station =
2011 Aug 21
1
How can I divide an image and randomly plot the segements
Hi! I would like to divide a 401 by 401 image into 20 equal blocks and then re-plot the image with the segments randomly distributed in it. How can I do this? ............. Regards, Kenduiywo Benson [[alternative HTML version deleted]]
2017 Nov 29
0
dplyr - add/expand rows
Hi Martin, On 11/29/2017 10:46 PM, Martin Morgan wrote: > On 11/29/2017 04:15 PM, T?th D?nes wrote: >> Hi, >> >> A benchmarking study with an additional (data.table-based) solution. > > I don't think speed is the right benchmark (I do agree that correctness > is!). Well, agree, and sorry for the wording. It was really just an exercise and not a full
2009 Feb 27
3
Making tapply code more efficient
Previously, I posed the question pasted down below to the list and received some very helpful responses. While the code suggestions provided in response indeed work, they seem to only work with *very* small data sets and so I wanted to follow up and see if anyone had ideas for better efficiency. I was quite embarrased on this as our SAS programmers cranked out programs that did this in the blink
2010 Apr 22
4
how to select the first observation only?
Dear r-helpers, I have a very simple question. Suppose my data is like id=c(rep(1,2),rep(2,2)) b=c(2,3,4,5) m=cbind(id,b) > m id b [1,] 1 2 [2,] 1 3 [3,] 2 4 [4,] 2 5 I wish to select the first observation for each id. That is, I want to quickly select two rows: id b 1 2 2 4 only. how should i do this? [[alternative HTML version deleted]]