Re: [R] Narrowing values collected from .txt file

2013-08-29 Thread Morway, Eric
On Thu, Aug 29, 2013 at 5:40 AM, jim holtman wrote: > Here is how I would do it since are reading in the entire file. This > breaks on each "Flow Budget" section, extracts the RECHARGE values and > puts them in a list with the name of the Flow Budget: > I learned more R in studying your solutio

Re: [R] Narrowing values collected from .txt file

2013-08-29 Thread jim holtman
Here is how I would do it since are reading in the entire file. This breaks on each "Flow Budget" section, extracts the RECHARGE values and puts them in a list with the name of the Flow Budget: > # read entire file > input <- readLines("C:\\Users\\jh52822\\Downloads\\MCR_Budgets.txt") > # determ

Re: [R] Narrowing values collected from .txt file

2013-08-28 Thread Morway, Eric
A relatively concise, commented, working solution to the problem originally motivating this thread was found (below). I suspect the approach I've taken has a major inefficiency through the use of the "scan" statement appearing inside the function "g". The way the code works right now, it has to r

Re: [R] Narrowing values collected from .txt file

2013-08-21 Thread Morway, Eric
Hello John, I tried the dput function a couple of different ways, with some different arguments set, and it dumped the following (or less): "structure(3L, class = c("textConnection", "connection"), conn_id = )" Concerned that I miscopied some of the reproducible example to my original post, I ju

Re: [R] Narrowing values collected from .txt file

2013-08-21 Thread John Kane
John Kane Kingston ON Canada > -Original Message- > From: emor...@usgs.gov > Sent: Wed, 21 Aug 2013 06:50:07 -0700 > To: r-help@r-project.org > Subject: [R] Narrowing values collected from .txt file > > useRs- > > The output generated from a groundwater mo

[R] Narrowing values collected from .txt file

2013-08-21 Thread Morway, Eric
useRs- The output generated from a groundwater model post-processor contains millions of lines of text. Using the custom R function shown below, I can quickly gather values from this file. As you can see in the textConnection provided below (which is only a small snippet from the file), the outp