similar to: local sequence function

Displaying 20 results from an estimated 7000 matches similar to: "local sequence function"

2009 Nov 11
2
partial cumsum
Hello, I am searching for a function to calculate "partial" cumsums. For example it should calculate the cumulative sums until a NA appears, and restart the cumsum calculation after the NA. this: x <- c(1, 2, 3, NA, 5, 6, 7, 8, 9, 10) should become this: 1 3 6 NA 5 11 18 26 35 45 any ideas? thank you and best regards, stefan
2011 May 03
3
Axis trouble
Hello Everyone, I am having problem in defining specific axis for plotting a vactor. vecAVG <- c(0.2, 0.4, 0.6, 0.2, 0.4) names(vecAVG)<-c("brain","heart","kidney","lung","blood") par(mar=c(12,4.1,4.1, 2.1))
2009 Jun 22
2
Shapiro.test on data frame
Hi, I need help to perform a Shapiro.test on a data frame, I know that this test works only with vector but I guess there most be a way to permor it on a data frame instead of vactor by vector (i.e. I've got 40 variables to analyze and its kinda annoying to do it one by one) Thanks to anyone that can help me. Gonzalo Quiroga
2005 Mar 08
4
Non-linear minimization
hello, I have got some trouble with R functions nlm(), nls() or optim() : I would like to fit 3 parameters which must stay in a precise interval. For exemple with nlm() : fn<-function(p) sum((dN-estdata(p[1],p[2],p[3]))^2) out<-nlm(fn, p=c(4, 17, 5), hessian=TRUE,print.level=2) with estdata() a function which returns value to fit with dN (observed data vactor) My problem is that only
2011 May 03
1
loading only parts of RData files?
Dear List members, I would like to load R objects saved as RData file but ran into the problem that these objects are too large for my RAM ('Can not allocate vactor of size XX...'). Switching to a Linux machine is no option, neither is raising the memory limit. I am now wondering whether it is possible to load only specific single objects saved in these *.RData files into the workspace.
2008 Jul 26
1
Simple vector question.
I have some data that I read in via read.csv: sales2007 <- read.csv("Total2007.dat", header=TRUE) The data looks like: > sales2007[1:605,] Year DayOfYear Sku Quantity CatId Category SubCategory 1 2007 1 100091 1 10862 HOLIDAY Christmas 2 2007 1 100138 1 11160 PET COSTUMES Famous (Licensed) 3 2007
2007 Feb 15
3
count sequence of integers
Hi, I would like to be able to count a sequence of numbers. For example, given a vector of the following integers (1,1,1,2,2,2,2,3,3,3,3,3,3,1,1,1,1, 3,3) the function would return (3, 4, 6, 4,2) Does anyone have any cool ideas to solve this? Any help appreciated. Regards, Sam. [[alternative HTML version deleted]]
2012 Aug 21
2
Sequence detection longer than a certain value
Hello, I have 2 variable: one is an "id" sequence from 1:1000 and the other is variable with real values "VI" from -15.0 to 20.0 and I want to detect id values that have indicator values less than a certain threshold, for example (x=1) BUT that are in sequence equal or longer than 5. For instance, in the following column I want to recognize the sequence from "id" 4
2010 May 07
1
Transforming sequence data into numeric values.
Hi I am analysing from a behavioural experiment comparing left and right turns of snails. Basically I end up with a list of twenty values like this: R R R L R L L L L R R R R L L L R L R L I want to analyse runs of turns but would like to automate how this is processed and end up with a table that displays the frequency of the sequences (L, LL, LLL, R, RR, RRR etc). Is it possible to construct
2010 May 26
5
counts of a vector
Hi, I need help to find an efficient way to transform a vector like: a<-c(1,1,0,1,0,0,0,1,1,1,1,0,1,0,1,1) in a vector that counts only di 1 elements, like: b<-c(1,2,0,1,0,0,0,1,2,3,4,0,1,0,1,2) Thank you! -- View this message in context: http://r.789695.n4.nabble.com/counts-of-a-vector-tp2232047p2232047.html Sent from the R help mailing list archive at Nabble.com.
2013 Nov 13
1
can't auth against more then 1 domain
I have 2 samba servers. One with centos5+samba 3.033 that has been in service for a few years now. I have installed a centos6+samba 3.6.9. I followed the how-to I did with the first one, copied over the krb5.conf and smb.conf from the working server and all seemed to go well. It is a member server of a window AD. We have 2 DC's that are part of the same forest: SEAS and SEAS-S. I
2012 Jun 19
2
how to use by function
hi all, Assume I have data like data<-rbind(c(1,2),c(1,3),c(2,1),c(3,2),c(3,4)) I want to get some matrix like 1,2,3 2,NA,NA 3,2,4 I'm using by mat<-matrix(NA,3,3) by(data,data[,1],mat[data[,1],]<-c(data[,2])) but it doesn't work. Any ideas? thanks, cowboy
2007 Oct 09
3
identify number of sequences from a vector
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071009/365764b4/attachment.pl
2005 Mar 11
2
Calculating lengths of runs of 0 or 1 sequences in meteorological data
Dear List Members, I need some help about programming in S language. My problem is as follows: I have meteorological data (about rainfall measurement each day from 1989-2002), say like http://www.angelfire.com/ab5/get5/data.rainfall.txt or http://www.angelfire.com/ab5/get5/R.rainfall.txt in a sequence of 0(denoting dry day)'s and 1(denoting wet day)'s. I want to construct a frequency
2010 Dec 01
4
Sequence for repeated numbers
Hello fellows, I would like to create a sequence for repeated numbers in a dataset. For example: ID <- c(1:20) grade <- c(4,4,4,5,5,7,7,7,7,8,8,8,9,9,9,9,9,10,10,10) Data: ID Grade 1 4 2 4 3 4 4 5 5 5 6 7 7 7 8 7 9 7 (...) I would like to create a variable "sequence": Data: ID Grade Sequence: 1 4 1 2 4 2 3 4 3 4 5
2008 Oct 27
3
counting run lengths
Hello, I have the following problem. I am running simulations on possible states of a set of agents (1=employed, 0=unemployed). I store these simulated time series in a matrix like the following, where rows indicates time periods, columns the number of agents (4 agents and 8 periods in this case): Atr=[ 1 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 1 0
2012 Mar 08
3
Calculating length of consecutive sequences within a vector
Hi all, I have a nx1 logical array of zeros and ones and I want to calculate the individual lengths of all 1-consecutive sequences contained in it. Is there an easy quick way to do this in R? So, if I have a vector such as 111001101000011111110 I would like to get (1) 3, (2) 2, (3) 1, (4) 7 Any help would be appreciated! thanks! Jorge [[alternative HTML version deleted]]
2009 Jul 07
3
Numbering sequences of non-NAs in a vector
Greetings, I have a vector of the form: [10,8,1,3,0,8,NA,NA,NA,NA,2,1,6,NA,NA,NA,0,5,1,9...] That is, a combination of sequences of non-missing values and missing values, with each sequence possibly of a different length. I'd like to create another vector which will help me pick out the sequences of non-missing values. For the example above, this would be:
2001 Feb 19
2
Does Visual Basic 6 run on wine?
Hi, I would like to switch over to linux, but I need to run VB on my computer for one of my classes. I don't want to dual boot, so if it works, then I'll switch. If it doesn't, I'll wait. If anyone has any experience running VB with Wine, please let me know. thanks, Justin jbauer@engr.smu.edu
2005 May 20
2
comparing a vactor of values in IF statement.
Hi, my vector V<- c(1,0.5,0.06,0.056,0.01,0.04,0.4,0.9,0.82,0.1) if( V > 0.5) { V <- 1 - V } I get a warning saying only the first element will be used in comparing (if V > 0.5). However, my results tell me vis-versa ,it actually compares every element of the vector V with 0.5 and that is waht i want it to do. Using a for loop is expensive and time consuming since my actual