Displaying 20 results from an estimated 4000 matches similar to: "Determine longest run of number"
2007 Dec 27
1
A function for random test based on longest run (UNCLASSI FIED)
Classification: UNCLASSIFIED
Caveats: NONE
Thanks for your quick response. The program you mentioned below available
from R is based on number of runs (up or down) not based on a longest length
of runs of same events. To be more specific, for example, from a series,
HHTHTTTTHHH, the number of runs are 5, and the longest length of runs of the
same events is 4. I'll check for the website you
2009 Apr 10
3
Determine the Length of the Longest Word in a String
Hi Everyone,
I'm new to programming R and have accomplished my goal, but feel that there
is probably a more efficient way of coding this. I'd appreciate any
guidance that a more advanced programmer can provide.
My goal --
I would like to find the length of the longest word in a string containing
many words separated by spaces.
How I did it --
I was able to find the length of the
2009 Oct 28
1
Need help locating the longest series of consecutive numbers in a matrix
I need to determine the length of the longest series of consecutive numbers
(1's to be specific) and the start time of that series. For example, in the
following sample, the first column is "time" and the second column indicates
the presence of the target behavior.
I would like a function that would return "21" as the start time and "17" as
the length.
sample
2009 Oct 01
1
Help me replace a for loop with an "apply" function
...if that is possible
My task is to find the longest streak of continuous days a user participated
in a game.
Instead of writing an sql function, I chose to use the R's rle function, to
get the longest streaks and then update my db table with the results.
The (attached) dataframe is something like this:
day user_id
2008/11/01 2001
2008/11/01 2002
2008/11/01 2003
2003 May 07
2
Extracting the longest entry
I have a matrix with NAs and want to extract the longest column.
> is.matrix(foo)
[1] TRUE
> dim(foo)
[1] 2000 75
> GetLength <- function(x) {length(na.omit(x))}
> junk <- apply(foo, 2, GetLength)
> junk
[1] 1004 512 432 523 691 396 607 838
[9] 730 389 388 445 609 333 637 1024
[17] 1163 823 718 466 799 459 701 833
[25] 456 549 376 728 539 384
2007 Dec 27
2
A function for random test based on longest run (UNCLASSIFIED)
Classification: UNCLASSIFIED
Caveats: NONE
Hello, R users,
Has anybody written a function for random test based on the length of
longest run of same events. I really appreciate your help.
Kyong Park
Classification: UNCLASSIFIED
Caveats: NONE
[[alternative HTML version deleted]]
2012 Aug 24
6
updating elements of a vector sequentially - is there a faster way?
I would like to know whether there is a faster way to do the below
operation (updating vec1).
My objective is to update the elements of a vector (vec1), where a
particular element i is dependent on the previous one. I need to do this on
vectors that are 1 million or longer and need to repeat that process
several hundred times. The for loop works but is slow. If there is a faster
way, please let
2012 Oct 16
2
cannot coerce class '"rle"' into a data.frame
why?
> rle
Run Length Encoding
lengths: int [1:1650061] 2 2 8 2 4 5 6 3 26 46 ...
values : chr [1:1650061] "4bbf9e94cbceb70c BG bg" "4fbbf2c67e0fb867 SK sk" ...
> as.data.frame(rle)
Error in as.data.frame.default(vertices.rle) :
cannot coerce class '"rle"' into a data.frame
it seems that
rle.df <-
2004 Feb 10
1
Longest known unpatched FreeBSD security issue ?
Does anyone know off hand what the longest known serious security issue
(i.e. remote compromise) has been with FreeBSD that went unpatched ? e.g.
security hole is reported to security-officer@FreeBSD.org. X days later,
fix and advisory committed. What has been the largest X ?
My jaw dropped when I saw
http://www.eeye.com/html/Research/Upcoming/index.html
---Mike
2013 Jul 22
4
How to split two levels several times?
Hi,
I have a small problem with the function split() and would appreciate your help.
I have a table called ?XXX? with 2 columns and 49 rows. The 49 rows belong to 8 different levels (electrode1, ...,electrode8). I want to split the table always at the row where ?electrode1? starts again so that I can export 7 individual dataframes (numbered ?dataframe1? to ?dataframe7?) which contain always
2010 Feb 02
1
Finding the difference between two vectors
Hello everyone,
I have two vectors having only one element different:
vector1 vector2
vector1
TWC TWC
TWC
VFC TWX
NA
VIA/B VFC
VFC
2002 Oct 17
2
Help
Hello,
I already download rm160.sit to a iMac9.1 computer.
But I can not run R-icon for installation of R. The
computer told me --the application "R" could not be
opend because
"Carbonlib" could not be found. I donot know why I
could not install R to the computer.
Thank you.
Jinbo
__________________________________________________
Faith Hill - Exclusive Performances,
2006 Oct 04
1
RODBC: longest string is truncated
Hello R community:
I'm encountering unexpected behaviour as I download string data from
MySQL using the RODBC package. The unexpected behaviour is that the last
character of the string is truncated. As far as I can see, this happens
when some strings are of length 501 or more.
Here's how to reproduce this behaviour.
## In MySQL, pick a database and run this:
CREATE TABLE test (
v1
2004 Oct 15
2
edit plots from the ADE4 package
Dear R-Help
i have a newbie question, how edit size fonts and colors in the plots (scatter.acm or dudi.acm function) of multiple correspondence analysis in the ADE4 Package?
thanks?
Rafael Gutierrez
Estad??stico
Unidad de Tecnolog??a Cerro Matoso S.A.
Tel. 4-7723350 Fax. 4-7723236
*************************************************************************************************
Este correo
2012 Dec 18
3
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
On Dec 18, 2012, at 2:07 PM, Chandler Carruth <chandlerc at google.com> wrote:
> On Tue, Dec 18, 2012 at 1:13 PM, Eli Bendersky <eliben at google.com> wrote:
> On Tue, Dec 18, 2012 at 1:09 PM, Craig Topper <craig.topper at gmail.com> wrote:
> > But its pretty easy to change the tabstop within the editor to make it
> > readable.
> >
>
> True, in
2023 Jun 01
1
bug in na.contiguous? Doesn't give the first tied stretch if it is at the start
Hi.
The description of na.contiguous says:
"Find the longest consecutive stretch of non-missing values in a
time series object. (In the event of a tie, the first such
stretch.)"
But this seems not to be the case if one of the tied longest stretches is at the start of the sequence/series. In the following example, there are three stretches of length 3, so I expect the result
2010 Jun 04
2
Argument recycling in substring()
Hi,
According to its man page substring() "expands (its) arguments
cyclically to the length of the longest _provided_ none are of
zero length".
So, as expected, I get an error here:
> substring("abcd", first=2L, last=integer(0))
Error in substring("abcd", first = 2L, last = integer(0)) :
invalid substring argument(s)
But I don't get one here:
2012 Dec 18
0
[LLVMdev] Getting rid of tabs in LLVM's assembly output?
> > Maybe it's naive, but I would expect it to be easy for each backend to
> > expose a constant N which is the length of the longest mnemonic, and then
> > for the printer to pad to N+1 or N+2….
>
> That would probably work for X86, but other targets (ARM in particular)
> often have operands which are printed/parsed as suffices on the mnemonic
> itself. Because
2013 Dec 13
1
substring() and propagation of names
Hi,
In R < 3.0.0, we used to get:
> substring(c(A="abcdefghij", B="123456789"), 2, 6:2)
A B A B A
"bcdef" "2345" "bcd" "23" "b"
But in R >= 3.0.0, we get:
> substring(c(A="abcdefghij", B="123456789"), 2, 6:2)
[1] "bcdef"
2002 Jun 18
5
insert number in vector
Hello R-users,
I need to create a vector inserting an 1 after each value of another vector.
For example:
vec1<-c(2,3,4)
I need to create a vector with the values 2,1,3,1,4
Does anyone know how create this vector without loops (vec1 could have 1000
elements)
Thank you,
Juan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read