Displaying 20 results from an estimated 1000 matches similar to: "Maximum number of patterns and speed in grep"
2007 Mar 13
2
Sweave question: prevent expansion of unevaluated reused code chunk
Hi,
Consider the following (much simplified) Sweave example:
--------------
First, we set the value of $x$:
<<chunk1,eval=FALSE>>=
x <- 1
@
Then we set the value of $y$:
<<chunk2,eval=FALSE>>=
y <- 2
@
Thus, the overall algorithm has this structure:
<<combined,eval=FALSE>>=
<<chunk1>>
<<chunk2>>
@
2011 Dec 21
1
Looping over files
Hi,
?I have a list of files in one of my working directories:
"chr17.chunk1.dose.fvd"
"chr17.chunk1.dose.fvi"
"chr17.chunk1.prob.fvd"?
"chr17.chunk1.prob.fvi"?
...........
.........
........
"chr17.chunk10.dose.fvd"
"chr17.chunk10.dose.fvi"
"chr17.chunk10.prob.fvd"
"chr17.chunk10.prob.fvi"
And I am
2011 Nov 15
1
gsub help
Hi,
?I am working with the following list of files:
[1] "study_chr1.one.phased.impute2.chunk1"??????????????
[2] "study_chr1.one.phased.impute2.chunk1_info"?????????
[3] "study_chr1.one.phased.impute2.chunk1_info_by_sample"
[4] "study_chr1.one.phased.impute2.chunk1_summary"??????
[5] "study_chr1.one.phased.impute2.chunk1_warnings"??????
The
2010 Dec 11
5
(S|odf)weave : how to intersperse (\LaTeX{}|odf) comments in source code ? Delayed R evaluation ?
Dear list,
Inspired by the original Knuth tools, and for paedaogical reasons, I wish
to produce a document presenting some source code with interspersed
comments in the source (see Knuth's books rendering TeX and metafont
sources to see what I mean).
I seemed to remember that a code chunk could be defined piecewise, like in
Comments...
<<Chunk1, eval=FALSE, echo=TRUE>>=
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"
2023 Feb 11
1
scan(..., skip=1e11): infinite loop; cannot interrupt
On Fri, 10 Feb 2023 23:38:55 -0600
Spencer Graves <spencer.graves at prodsyse.com> wrote:
> I have a 4.54 GB file that I'm trying to read in chunks using
> "scan(..., skip=__)". It works as expected for small values of
> "skip" but goes into an infinite loop for "skip=1e11" and similar
> large values of skip: I cannot even interrupt it; I
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
2012 Oct 25
2
Regarding the memory allocation problem
Dear All,
My main objective was to compute the distance of 100000 vectors from a
set having 900 other vectors. I've a file named "seq_vec" containing
100000 records and 256 columns.
While computing, the memory was not sufficient and resulted in error
"cannot allocate vector of size 152.1Mb"
So I've approached the problem in the following:
Rather than reading the data
2012 Jul 16
2
Finding and manipulation clusters of numbers in a sequence of numbers
Hi,
I have the following sequence:
in <- c(0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 0, 0, 2)
>From this sequence I would like to get to the following sequence:
out <- c(0, 0, 0, 3, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0,
0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 2, 0, 2, 0, 0, 2)
Basically,
2008 Feb 07
6
Buffer flushing
Short question: is there way to tell EM to actually send data after
send_data call?
I''m building a file transferring app. I send Mashal.dump''ed metadata
first, and then - the file contents (chunked). I found a silly bug:
receive_data() gets marshalled metadata and the first chunk of the
file in a single variable.
Like that:
c1.send_data("meta")
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
2012 May 30
1
gsub/strsplit with multiple patterns/splits
Hi,
I have a vector like this:
DF <- c("Aetna, Inc.", "Alexander's Inc.", "Allegheny Energy, Inc")
For each element in the vector I would like to remove the "incorporated"
info, so that my vector looks like this:
DF <- c("Aetna", "Alexander's", "Allegheny Energy")
That means that I have to strip:
strip <-
2012 Nov 27
1
Accumulate objects in list after try()
Hi,
I have written a function "harvest" and I would like to run the function for
each value in a vector c(1:1000). The function returns 4 list objects
(obj_1, obj_3, obj_3, obj_4) using the following code at the end of the
function: return(list(obj_1 = obj_1, obj_2 = obj_2, obj_3 = obj_3, obj_4 =
obj_4)).
Since I am connecting with the web in the function and the connection
sometimes
2007 Oct 23
0
Residuals from biglm package
Hi all,
first of all, I'm not an expert on R, I'm still learning, so sorry if this is a stupid question...
I have a large dataset that is to big for my computer memory, and I found quite useful the package biglm. Now everything is working perfectly. But if I want the residuals, how I can do it?
Let's say that we are running the example:
> data(trees)>
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 May 14
3
Scraping a web page.
Folks,
I want to scrape a series of web-page sources for strings like the following:
"/en/Ships/A-8605507.html"
"/en/Ships/Aalborg-8122830.html"
which appear in an href inside an <a> tag inside a <div> tag inside a table.
In fact all I want is the (exactly) 7-digit number before ".html".
The good news is that as far as I can tell the the <a>
2012 Jan 24
1
Sweave driver extension
Almost all of the coxme package and an increasing amount of the survival
package are now written in noweb, i.e., .Rnw files. It would be nice to
process these using the Sweave function + a special driver, which I can
do using a modified version of Sweave. The primary change is to allow
the following type of construction
<<coxme>>
coxme <- function(formula, data, subset, blah blah
2011 Aug 25
3
Selections in lists
Hi,
I have produced a list g and I would like to reduce the amount of
information contained in each object in g.
For each matrix I would like to keep the values where the column name equals
g[year][[1]][[x]] and the row names equals g[year][[1]][[-x]]. So in
g$`1999`$`8029`, year = 1999 and x = 8029. I have been experimenting with
the subset function, but have been unsuccesful. Thanks for your
2012 Mar 14
4
Merging fully overlapping groups
Hi,
I have data on individuals (B) who participated in events (A). If ALL
participants in an event are a subset of the participants in another event I
would like to remove the smaller event and if the participants in one event
are exactly similar to the participants in another event I would like to
remove one of the events (I don't care which one). The following example
does that however it
2006 May 17
1
Re : Large database help
Thanks for doing this Thomas, I have been thinking about what it would
take to do this, but if it were left to me, it would have taken a lot
longer.
Back in the 80's there was a statistical package called RUMMAGE that did
all computations based on sufficient statistics and did not keep the
actual data in memory. Memory for computers became cheap before
datasets turned huge so there