search for: vograno

Displaying 20 results from an estimated 99 matches for "vograno".

Did you mean: logrado
2001 Dec 11
0
Re: (PR#1210) an error message from scan() surprised vograno@arbitrade.com.
...ject: [Rd] multi.line=FALSE does not work in scan() (PR#1210) It *does* work quite correctly: this was an erroneous file nd you got an error, just one you didn't understand. Please don't use grossly misleading subject lines: they are all that appear in the BUGS file. On Tue, 11 Dec 2001 vograno@arbitrade.com wrote: > The following applies to scan function called with multi.line=FALSE and > what=list(...). > > If 'what' has more members than the number of columns in the file scan() > keeps reading from the next line of the file despite multi.line=FALSE. Here > is...
2005 Mar 08
4
how modify object in parent.env
Hi, Is it possible to modify an object in the parent.env (as opposed to re-bind)? Here is what I tried: > x = 1:3 # try to modify the first element of x from within a new environment > local(get("x", parent.env(environment()))[1] <- NA) Error in eval(expr, envir, enclos) : Target of assignment expands to non-language object # On the other hand retrieval works just fine >
2004 Dec 03
4
seq.Date requires by
Hi, What is the reason for seq.Date to require the 'by' argument and not to default it to 1 in the example below? > seq(from=as.Date("1996-01-01"), to=as.Date("1996-12-01")) Error in seq.Date(from = as.Date("1996-01-01"), to = as.Date("1996-12-01")) : exactly two of `to', `by' and `length.out' / `along.with' must be specified
2004 Jun 08
5
fast mkChar
Hi, To speed up reading of large (few million lines) CSV files I am writing custom read functions (in C). By timing various approaches I figured out that one of the bottlenecks in reading character fields is the mkChar() function which on each call incurs a lot of garbage-collection-related overhead. I wonder if there is a "vectorized" version of mkChar, say mkChar2(char **, int
2004 Jun 30
2
Slow IO: was [R] naive question
I believe IO in R is slow because of the way it is implemented, not because it has to do some extra work for the user. I compared scan() with 'what' argument set (which is, AFAIK, is the fastest way to read a CSV file) to an equivalent C code. It turned out to be 20 - 50 times slower. I can see at least two main reasons why R's IO is so slow (I didn't profile this though): A) it
2004 May 01
5
skip lines on a connection
Hi, I am looking for an efficient way of skipping big chunks of lines on a connection (not necessarily at the beginning of the file). One way is to use read lines, e.g. readLines(1e6), but a) this incurs the overhead of construction of the return char vector and b) has a (fairly remote) potential to blow up the memory. Another way would be to use scan(), e.g. scan(con, skip=1e6, nmax=0)
2003 Sep 03
3
read.table: check.names arg - feature request
Hi, I thought it would be convenient if the check.names argument to read.table, which currently can only be TRUE/FALSE, could take a function value as well. If the function is supplied it should be used instead of the default make.names. Here is an example where it can come in handy. I tend to keep my data in coma-separated files with a header line. The header line is prefixed with a comment
2003 Nov 06
4
building r-patch
Hi, I am building r-patch from the sources (rsync-ed today). make check produced the following message: running tests of Internet and socket functions expect some differences make[3]: Entering directory `/usr/evahome/vograno/R/tests' running code in 'internet.R' ... OK comparing 'internet.Rout' to './internet.Rout.save' ...18c18 < Content type `text/plain; charset=iso-8859-1' length 134991 bytes --- > Content type `text/plain; charset=iso-8859-1' length 124178 bytes 22,23c22,23...
2004 Nov 10
3
recursive default argument reference
Hi, It seems that a formal function argument can not default to an "outer" variable of the same name: > x <- "foo" > ff <- function(x=x) x > ff() Error in ff() : recursive default argument reference > Is this intentional? Why? I use R-1.9.1. Thanks, Vadim
2005 May 06
0
FW: distance between distributions
...rs [mailto:dr.mike at ntlworld.com] Sent: 06 May 2005 18:40 To: 'Campbell' Subject: RE: [R] distance between distributions -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Campbell Sent: 06 May 2005 11:19 To: vograno; r-help Subject: Re: [R] distance between distributions I may have missed the point here but isn't this an obvious case for using the bootstrap. A paper by Mallows, the exact reference escapes me, establishes the conditions under which asymtotics of the marginal distribution imply a well beha...
2003 Mar 11
2
system(..., intern=TRUE) splits long lines (PR#2623)
system(..., intern=TRUE) splits long lines after 118th character and discards the 119th character > a <- paste(rep("a", 124), collapse="") > system(paste("echo", a), intern=TRUE) system(paste("echo", a), intern=TRUE) [1] "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2004 Mar 02
3
error() and C++ destructors
Hi, I am writing C++ functions that are to be called via .Call() interface. I'd been using error() (from R.h) to return to R if there is an error, but then I realized that this might be not safe as supposedly error() doesn't throw an exception and therefore some destructors do not get called and some memory may leak. Here is a simple example extern "C" void foo() { string
2005 May 07
4
how to add method to .Primitive function
Hi, I tried to write the dim method for the list class, but R doesn't seem to dispatch to it: > dim.list = function(x) c(length(x[[1]]), length(x)) > dim(list(1)) NULL > dim.list(list(1)) [1] 1 1 What is the correct way of registering dim.list with .Primitive("dim")? Thanks, Vadim [[alternative HTML version deleted]]
2004 Nov 26
2
Lightweight data frame class
Hi, As far as I can tell data.frame class adds two features to those of lists: * matrix structure via [,] and [,]<- operators (well, I know these are actually "["(i, j, ...), not "[,]"). * row names attribute. It seems that the overhead of the support for the row names, both computational and RAM-wise, is rather non-trivial. I frequently subscript from a data.frame,
2001 Nov 26
3
Doing things with POSIXt
Dear R-Users, I have a data file with timestamps and I wanted to use POSIXct time data type to represent the respective column. I played around with the type and found a couple of issues: * there seems to be no direct way of reading datetimes into a variable. Let's say this is my file "1992-02-27 23:03:20 PST" "1992-02-27 22:29:56 PST" "1992-01-14 01:03:30 PST"
2002 Dec 19
1
disabling NA token as na.string in read.table
Dear R-Users, I have a csv file that has NA tokens and these tokens are perfectly good values that need not to be converted to NA by read.table(). I tried to prevent the conversion by specifying the na.strings arg., but this seems to only add to the list of NA strings, not substitute. > system("cat foo") system("cat foo") 1 foo 2 NA > read.table("foo",
2004 Feb 25
0
books:
...man</a> | <a href="http://faculty.washington.edu/tlumley/Rcourse/objects.pdf">Lumley</a> | <a href="http://maths.newcastle.edu.au/~rking/R/devel/03a/0969.html">Symth</a> --- Date: Wed, 25 Feb 2004 12:42:13 -0800 From: Vadim Ogranovich <vograno at evafunds.com> To: R Help List <r-help at stat.math.ethz.ch> Subject: [R] books: "Programming with Data: A Guide to the S Language" vs." S Programming" Hi, Could someone please compare "Programming with Data: A Guide to the S Language" by J. Chambe...
2004 Aug 10
1
on.exit() inside local()
Hi, Since I routinely open files in a loop I've developed a habit of using on.exit() to close them. Since on.exit() needs to be called within a function I use eval() as a surrogate. For example: for (fileName in c("a", "b")) eval({ con <- file(fileName); on.exit(close(con)) }) and con will be closed no matter what. However it stopped working once I wrapped the
2005 Jun 10
1
Redirect console to file
Hi, Is it possible to redirect the staff that normally goes to the R console window into a file. sink() does this for sdterr and stdout. But I need something that redirects "everything" that appear in the console window (including the top-level commands). I want to achieve the same effect as that of the following command under sh: R < foo.R &> foo.Rt only I want the
2004 Aug 20
1
gcc optimization flag when building R
Hi, I am building R on RH Linux 7.3 and I noticed that ./configure does not set the optimization flag, -O or -O2, for gcc, but does set for g++ and g77. Why is that? Should I try to set it manually, if yes how? Thanks, Vadim P.S. This is the bottom portion of the ./configure run R is now configured for i686-pc-linux-gnu Source directory: . Installation directory: