Hello I've been trying to produce a general error logging/handling
framework that I can live with. I'll post the code first:
example.R
---
good_main <- function() {
for (i in 1:2) {
bad_function()
}
}
bad_main <- function() {
for (i in 1:2) {
tr
again everyone!
Cheers,
Thomas
On 03/12/2015 02:12 PM, John McKown wrote:
> On Thu, Mar 12, 2015 at 12:15 PM, Thomas Nyberg wrote:
>> Hello,
>>
>> I've found the following useful functionality:
>>
>>> s <- 'cola,colb\n1,2\n2,3\n'
>>> r
s
}
read.csv.str <- function(s) {
read.csv(text=s)
}
readfile <- function(filepath) {
text <- readChar(filepath, file.info(filepath)$size)
text
}
---
Thanks for the help everyone.
Cheers,
Thomas
On 03/12/2015 02:12 PM, John McKown wrote:
> On Thu, Mar 12, 2015 at 12:15 PM
d be the easiest way to go
about such a thing? Right now I can only think of using a file as an
intermediary, but that seems a bit silly. Thanks for any help.
Cheers,
Thomas Nyberg
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https
23456789 10
4976 4968 4912 5111 5009 5074 4987 4950 5166 4847
Notice the following features of my code:
* no object initialization
* no loops
More comments inline.
On Thu, Oct 30, 2014 at 8:17 AM, Thomas Nyberg wrote:
Hello,
I want to do the following: Given a
om
On Thu, Oct 30, 2014 at 8:17 AM, Thomas Nyberg wrote:
Hello,
I want to do the following: Given a set of (number, value) pairs, I want to
create a list l so that l[[toString(number)]] returns the vector of values
associated to that number. It is hundreds of times slower than the
equivalent that I w
Hello,
I want to do the following: Given a set of (number, value) pairs, I want
to create a list l so that l[[toString(number)]] returns the vector of
values associated to that number. It is hundreds of times slower than
the equivalent that I would write in python. I'm pretty new to R so I
be
entire file (or url, etc.), examining the results, and trying
again with a different parsing scheme. In that case the default
behavior works well.
In any case, I assume the behavior is documented in help("file").
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Oct 29, 2014 at 9:
ous 2 lines
> readLines(f, n=1)
[1] "a"
> readLines(f, n=1)
[1] "b"
> readLines(f, n=2)
[1] "c" "d"
> close(f)
I/O operations on an unopened connection generally open it, do the operation,
then close it.
Bill Dunlap
TIBCO Softw
Hi everyone,
I would like to read a file line by line, but I would rather not load
all lines into memory first. I've tried using readLines with n = 1, but
that seems to reset the internal file descriptor's file offset after
each call. I.e. this is the current behavior:
---
bash $ echo 1
I am running:
R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Platform: x86_64-unknown-linux-gnu (64-bit)
It is an Amazon 64 Linux instance with the following version:
3.3.4-5.fc17.x86_64
I compiled R myself as well as the newest version of gnu screen.
I create a file with a couple hundred
11 matches
Mail list logo