Ok, thank you for the advice I will take some time to see in details
these packages.
Le 19/05/2020 à 05:44, Jeff Newmiller a écrit :
Laurent... Bill is suggesting building your own indexed database... but this
has been done before, so re-inventing the wheel seems inefficient and risky. It
Laurent... Bill is suggesting building your own indexed database... but this
has been done before, so re-inventing the wheel seems inefficient and risky. It
is actually impossible to create such a beast without reading the entire file
into memory at least temporarily anyway, so you are better
Hi Laurent,
Off the bat I would have guessed that the problem you're seeing has to
do with 'command line quoting' differences between the Windows system
and the Linux/Mac systems. I've noticed people using Windows having
better command line success with "exterior double-quotes / interior
On Wed, 27 May 2020 10:56:42 +0200
Laurent Rhelp wrote:
> May be it is because I work with MS windows ?
That is probably the case.
On Windows, pipe() invokes "%COMSPEC% /c ", and the
rules of command line quoting are different between POSIX shell and
cmd.exe + runtimes of Windows applications
I installed raku on my PC to test your solution:
The command raku -e '.put for lines.grep( / ^^N053 | ^^N163 /, :p );'
Laurents.txt works fine when I write it in the bash command but when I
use the pipe command in R as you say there is nothing in lines with
lines <- read.table(i)
There is
Strike that one sentence in brackets: "[In point of fact, the R Data
Import/Export Manual suggests using perl]", to pre-process data before
loading into R. The manual's recommendation only pertains to large
fixed width formatted files [see #1], whereas Laurent's data is
whitespace-delimited:
>
Hi Laurent,
Seeking to give you an "R-only" solution, I thought the read.fwf()
function might be useful (to read-in your first column of data, only).
However Jeff is correct that this is a poor strategy, since read.fwf()
reads the entire file into R (documented in "Fixed-width-format
files",
Hi Ivan,
Endeed, it is a good idea. I am under MSwindows but I can use the
bash command I use with git. I will see how to do that with the unix
command lines.
Le 20/05/2020 à 09:46, Ivan Krylov a écrit :
Hi Laurent,
I am not saying this will work every time and I do recognise that this
There is also apparently a package called disk.frame that you might consider.
On May 19, 2020 12:07:38 AM PDT, Laurent Rhelp wrote:
>Ok, thank you for the advice I will take some time to see in details
>these packages.
>
>
>Le 19/05/2020 à 05:44, Jeff Newmiller a écrit :
>> Laurent... Bill is
Hi Laurent,
I am not saying this will work every time and I do recognise that this
is very different from a more general solution that you had envisioned,
but if you are on an UNIX-like system or have the relevant utilities
installed and on the %PATH% on Windows, you can filter the input file
Laurent... Bill is suggesting building your own indexed database... but this
has been done before, so re-inventing the wheel seems inefficient and risky. It
is actually impossible to create such a beast without reading the entire file
into memory at least temporarily anyway, so you are better
Ok, thank you for the advice I will take some time to see in details
these packages.
Le 19/05/2020 à 05:44, Jeff Newmiller a écrit :
Laurent... Bill is suggesting building your own indexed database... but this
has been done before, so re-inventing the wheel seems inefficient and risky. It
GREAT ! It is exactly in the idea of my request !
I like the nextElem call in the skip argument.
Thank you very much William
Best Regards
Laurent
Le 18/05/2020 à 20:37, William Michels a écrit :
Hi Laurent,
Thank you for explaining your size limitations. Below is an example
using the
Dear William,
Thank you for your answer
My file is very large so I cannot read it in my memory (I cannot use
read.table). So I want to put in memory only the line I need to process.
With readLines, as I did, it works but I would like to use an iterator
and a foreach loop to understand this
Dear Laurent,
I'm going through your code quickly, and the first question I have is
whether you loaded the "gmp" library?
> library(gmp)
Attaching package: ‘gmp’
The following objects are masked from ‘package:base’:
%*%, apply, crossprod, matrix, tcrossprod
> library(iterators)
>
Apologies, Laurent, for this two-part answer. I misunderstood your
post where you stated you wanted to "filter(ing) some
selected lines according to the line name... ." I thought that meant
you had a separate index (like a series of primes) that you wanted to
use to only read-in selected line
Hi Laurent,
Thank you for explaining your size limitations. Below is an example
using the read.fwf() function to grab the first column of your input
file (in 2000 row chunks). This column is converted to an index, and
the index is used to create an iterator useful for skipping lines when
Dear William,
Thank you for your answer
My file is very large so I cannot read it in my memory (I cannot use
read.table). So I want to put in memory only the line I need to process.
With readLines, as I did, it works but I would like to use an iterator
and a foreach loop to understand this
Dear R-Help List,
I would like to use an iterator to read a file filtering some
selected lines according to the line name in order to use after a
foreach loop. I wanted to use the checkFunc argument as the following
example found on internet to select only prime numbers :
|
19 matches
Mail list logo