Displaying 20 results from an estimated 10000 matches similar to: "Finding and manipulation clusters of numbers in a sequence of numbers"
2012 Jul 06
2
Maximum number of patterns and speed in grep
Hi,
I am using R's grep function to find patterns in vectors of strings. The
number of patterns I would like to match is 7,700 (of different sizes). I
noticed that I get an error message when I do the following:
data <- array()
for (j in 1:length(x))
{
array[j] <- length(grep(paste(patterns[1:7700], collapse = "|"), x[j],
value = T))
}
When I break this up into 4 chunks of
2011 Jun 02
2
Counting occurrences in a moving window
Hi list, based on the following data.frame I would like to create a variable
that indicates the number of occurrences of A in the 3 years prior to the
current year:
DF = data.frame(read.table(textConnection(" A B
8025 1995
8026 1995
8029 1995
8026 1996
8025 1997
8026 1997
8025 1997
8027 1997
8026 1999
8027 1999
8028 1995
8029 1998
8025 1997
8027 1997
8026 1999
8027 1999
2012 Nov 01
7
Reduce(paste, x) question
I have a question about the Reduce function:
x <- list()
x[[1]] <- LETTERS[1:5]
x[[2]] <- LETTERS[11:15]
Reduce(paste, x)
[1] "A K" "B L" "C M" "D N" "E O"
How do I get this?:
[1] "A" "K"
[2] "B" "L"
[3] "C" "M"
[4] "D" "N"
[5] "E" "O"
2011 Feb 13
3
String manipulation
Please consider following string:
MyString <- "ABCFR34564IJVEOJC3434"
Here you see that, there are 4 groups in above string. 1st and 3rd groups
are for english letters and 2nd and 4th for numeric. Given a string, how can
I separate out those 4 groups?
Thanks for your time
[[alternative HTML version deleted]]
2012 Jan 24
4
Select elements from text
Hi,
I have a series of MS word files and each file contains plain text. From
these texts I would like to extract only those elements (read: words) that
are between square brackets. Example of a text:
Most fundamentally, it has led to an effort to clarify the organizational
form concept. According to them [see also Smith, Jones and Carroll 2002],
categories emerge as audience members recognize
2011 Apr 09
5
Yearly aggregates and matrices
Hi,
I need to perform calculations on subsets of a data frame:
DF = data.frame(read.table(textConnection(" A B C D E F
1 a 1995 0 4 1
2 a 1997 1 1 3
3 b 1995 3 7 0
4 b 1996 1 2 3
5 b 1997 1 2 3
6 b 1998 6 0 0
7 b 1999 3 7 0
8 c 1997 1 2 3
9 c 1998 1 2 3
10 c 1999 6 0 0
11 d 1999 3 7 0
12 e 1995 1 2 3
13 e 1998 1 2 3
14 e 1999 6
2012 Mar 07
3
GPS handling libraries or (String manipulation)
Dear all,
I would like to ask you if R has a library that can work with different GPS formats
For example
I have a string of this format
N50° 47.513 E006° 03.985
and I would like to convert to GPS decimal format.
that means for example converting the part N50° 47.513
to 50 + 47/60 + 513/3600.
Is it possible to do that with R?
What is the name of such a library?
I would like to thank you in
2017 Aug 11
2
Package sqldf in R and dates manipulation
Dear all,
I recently read the book " R data preperation and manipulation using sqldf package" by Djoni Darmawikarta
However, I have a problem with manipulation of dates using this package, I do not get the expected results. Do I need to install some packages to be able to subset the data by dates in sqldf?
I am not getting Djoni Darmawikarta email address.
Please see the practice
2009 Mar 11
1
About the merge
hi, All.
Date Dtime Hour Min Second Rep App_dur
9 2006-02-22 14:36:11 14 36 11 4 1
10 2006-02-22 14:36:12 14 36 12 3 86
11 2006-02-22 14:37:38 14 37 38 0 58
14 2006-02-22 14:38:36 14 38 36 3 1
15 2006-02-22 14:38:37 14 38 37 4 1
16 2006-02-22 14:38:38 14 38 38 1 9
18 2006-02-22 14:38:47 14 38
2011 Mar 10
1
Moving window per group
Hi,
I have a data.frame of the following type:
F = data.frame(read.table(textConnection(" A B
1 1 4
2 1 3
3 1 1
4 1 4
5 1 2
6 1 2
7 1 2
8 2 1
9 2 1
10 2 1
11 2 1
12 3 2
13 3 4
14 3 1
15 3 1
16 3 1"),head=TRUE,stringsAsFactors=FALSE))
F
A B
1 1 4
2 1 3
3 1 1
4 1 4
5 1 2
6 1 2
7 1 2
8 2 1
9 2 1
10 2 1
11 2 1
12 3 2
13 3 4
14 3 1
15 3 1
16 3 1
2017 Aug 11
0
Package sqldf in R and dates manipulation
See FAQ #4 on the sqldf github home page.
On Fri, Aug 11, 2017 at 9:21 AM, Mangalani Peter Makananisa
<pmakananisa at sars.gov.za> wrote:
> Dear all,
>
> I recently read the book " R data preperation and manipulation using sqldf package" by Djoni Darmawikarta
> However, I have a problem with manipulation of dates using this package, I do not get the expected results.
2011 Jun 26
2
String manipulation
Dear all, I have following kind of character vector:
Vec <- c("344426", "dwjjsgcj", "123sgdc", "aagha123", "sdh343asgh", "123jhd51")
Now I want to split each element of this vector according to?numeric?and string element. For example in the 1st element of that vector, there is no string element. Therefore I should get a vector of
2013 Mar 14
3
date & time manipulation- R 2.15.1 windows 7
Hi,
I wanted to learn how to solve a date and time manipulation where i can
do the following two
1. difference of two dates eg (differnce between 5th jan 2013 and 1st
jan 2013)
2.Suppose i have week number of the year, i want to know if i can find
out the day it refers to eg( say week 2 of 2013 would be 6th jan 2013 and
the day is sunday)
i need my result to tell me that its
2011 Feb 14
5
Transforming relational data
Hi,
I have a large dataset with info on individuals (B) that have been involved
in projects (A) during multiple years (C). The dataset contains three
columns: A, B, C. Example:
A B C
1 1 a 1999
2 1 b 1999
3 1 c 1999
4 1 d 1999
5 2 c 2001
6 2 d 2001
7 3 a 2004
8 3 c 2004
9 3 d 2004
I am interested in how well all the individuals in a project know each
other. To
2002 Jun 17
1
Clusters of adjacent bars in barchart()
Can I create a barchart in lattice with clusters of adjacent bars, which is
possible with barplot() when beside=TRUE? How can I
accomplish the grouping in lattice that is done with
inputting a matrix to barplot()?
Thanks,
Scott Waichler
Hydrology Group/Environmental Technology Division
Battelle Pacific Northwest National Laboratory
________________________________________________
2012 Feb 17
1
time series manipulation what functions are "best"
Newbie question - mechanical engineer trying to learn R
I've had success with plotting time series data and even made a heat map
using R Graphs Cookbook by Mittal.
I have a new problem - I need to align a number of time series data
"columns" to the desired regular exact time stamp vector. The target time
vector could be finer or more course than the typical time stamp spacing
found.
2011 Apr 29
4
For loop and sqldf
Hi list,
Can anyone tell my why the following does not work? Thanks a lot! Your help
is very much appreciated.
DF = data.frame(read.table(textConnection(" B C D E F G
8025 1995 0 4 1 2
8025 1997 1 1 3 4
8026 1995 0 7 0 0
8026 1996 1 2 3 0
8026 1997 1 2 3 1
8026 1998 6 0 0 4
8026 1999 3 7 0 3
8027 1997 1 2 3 9
8027 1998 1 2 3 1
8027 1999
2010 Jan 11
2
help needed to find zero areas in a vector
Dear Helpers:
I spend more than half a day to solve this problem in R:
Let x be a vector of a string of 0s and 1s, such as
x<-c(0,0,1,1,0,0,0,0,1,1,0,0,0,0). It can be a very long vector.
How to sub vectors of 0s? In the above example, I would like get the vectors (0,0), (0,0,0,0), (0,0,0,0).
I can use which(x==0) to get the index of the 0 elements, but I don't know how to get the
2011 Apr 14
1
Create matrices for time series
Hi list, I would like to use the following data.frame to generate matrices
over a 3 year moving window:
DF = data.frame(read.table(textConnection(" A B C
80 8025 1995
80 8026 1995
80 8029 1995
81 8026 1996
82 8025 1997
82 8026 1997
83 8025 1997
83 8027 1997
84 8026 1999
84 8027 1999
85 8028 1995
85 8029 1998"),head=TRUE,stringsAsFactors=FALSE))
Function to be
2012 May 25
1
evaluate whether function returns error
Hi,
The following returns an error message. How do I evaluate (TRUE or FALSE)
the function?
require(XML)
readHTMLTable("http://www.sec.gov/Archives/edgar/data/2969/000095012399010952/0000950123-99-010952.txt")
Thanks in advance!
Math
--
View this message in context: http://r.789695.n4.nabble.com/evaluate-whether-function-returns-error-tp4631406.html
Sent from the R help mailing list