Andrew Beckerman
2013-Sep-17 11:36 UTC
[R] why does system() truncates stdout output from large files?
Dear listers
I am using a system() call to my machine (OSX 10.8, R 3.0.1. 32GB memory
available):
system(paste("awk 'NR==2'", file.genepop), intern = TRUE)
and when processing big files, getting numerous helpful error messages
system(paste("awk 'NR==2'", file.genepop), intern = TRUE, ...
:
line 1 may be truncated in call to system(, intern = TRUE)
I understand what is happening, and can see the truncations, but is there any
way to prevent the truncation? Or is there a read-limit in system() [I
can't see anything in the help file… but I am probably missing something]?
Many thanks
Andrew
--
Andrew Beckerman
University of Sheffield
[[alternative HTML version deleted]]
Andrew Beckerman
2013-Sep-19 11:08 UTC
[R] why does system() truncates stdout output from large files? (SOLUTION)
Dear all -
Should anyone be interested - using
paste(system(paste("awk 'NR==2'", file.genepop), intern =
TRUE), collapse="")
pulls together the pieces (list elements) of the returned values.
--
Andrew Beckerman
University of Sheffield
On Tuesday, 17 September 2013 at 12:36, Andrew Beckerman wrote:
> Dear listers
>
> I am using a system() call to my machine (OSX 10.8, R 3.0.1. 32GB memory
available):
>
> system(paste("awk 'NR==2'", file.genepop), intern = TRUE)
>
> and when processing big files, getting numerous helpful error messages
>
> system(paste("awk 'NR==2'", file.genepop), intern = TRUE,
... :
> line 1 may be truncated in call to system(, intern = TRUE)
>
> I understand what is happening, and can see the truncations, but is there
any way to prevent the truncation? Or is there a read-limit in system() [I
can't see anything in the help file… but I am probably missing something]?
>
> Many thanks
> Andrew
>
>
> --
> Andrew Beckerman
> University of Sheffield
>
>
[[alternative HTML version deleted]]