similar to: writintg wrappers around save()

Displaying 20 results from an estimated 5000 matches similar to: "writintg wrappers around save()"

2008 Jul 23
2
shQuote and cat
Dear R-users, It is my understanding that cat(shQuote(a.string)) should print the origintal a.string. Is this right? I am not sure cat() correctly prints strings which are generated by triple-shQuote(): > shQuote(shQuote("a")) [1] "\"\\\"a\\\"\"" > cat(shQuote(shQuote(shQuote("a"))), '\n')
2008 Jul 23
2
shQuote and cat
Dear R-users, It is my understanding that cat(shQuote(a.string)) should print the origintal a.string. Is this right? I am not sure cat() correctly prints strings which are generated by triple-shQuote(): > shQuote(shQuote("a")) [1] "\"\\\"a\\\"\"" > cat(shQuote(shQuote(shQuote("a"))), '\n')
2008 Oct 03
2
computing on expressions
Dear R-users, Suppose I have an expression: expr = expression(a>0) and now I want to modify it to expression(a>0 & b>0). The following doesn't work: expr = expression(expr & b>0) What would be a good way of doing this? Thanks, Vadim ________________________________ Note: This email is for the confidential use of the named addressee(s) only and may contain
2008 Mar 04
1
making array of lists
Dear R Users, Given two vectors, say a = seq(2) and b = seq(3), I want to make an 2*3 array, where (i,j) element is list(a=a[i], b=b[j]). I tried the outer() function but it generates an error message that I don't understand, see below. What do I do wrong? The expan.grid function is not good enough since I need a solution that works when a and b are not atomic, say a=list(list(x=1,
2008 Apr 16
1
C++ complains abouct Rprintf signature
Dear R-devel, My g++ complains about the first argument to Rprintf being non-const char *. For example when compiling the line Rprintf("hello world\n"); the following warning is emitted: warning: deprecated conversion from string constant to 'char*' Is there a reason for the non-const? It is curious that Rf_error, which is similar to RPrintf, is const. If there is a need
2008 Aug 20
1
names of return value of median
Dear R-devel, The median() function assigns a name, "NA", to its return value if the return value is NA and the input vector has names, otherwise the names attribute is NULL. This looks strange and inconsistent with the behavior of mean(). This inconsistency becomes a problem when median() is used inside user code that relies on consistent naming convention. Thanks, Vadim > foo
2008 Feb 25
1
how to write dput-able objects
Hi, One way of doing object-oriented programming in R is to use function environment to hold object's data, see for example @Article{Rnews:Chambers+Lang:2001a, author = {John M. Chambers and Duncan Temple Lang}, title = {Object-Oriented Programming in {R}}, journal = {R News}, year = 2001, volume = 1, number = 3, pages = {17--19},
2008 Aug 15
1
stopifnot message mutation
Dear R-users, Could someone please explain why the message printed by function stopifnot2, see below, is different from that of stopifnot itself? Thank you for your help, Vadim > stopifnot2 <- function(...) stopifnot(...) > stopifnot(F) Error: F is not TRUE > stopifnot2(F) Error: ..1 is not TRUE > version _ platform i386-pc-mingw32 arch i386 os
2008 Feb 26
1
error loading library
Hi, I am debugging intermittent crashes of R that seem to happen when multiple R sessions nearly summaltaneously load same dll-based library. I have R and my libraries installed on a network drive (everything is Windows). The drive is visible from a farm of servers. I have an R script, foo.R, that just loads a dll-based library (to be precise it loads a library that requires a dll-based
2008 Feb 17
1
forcing gc() to do its work
Hi, At some points of my computations I want gc() to try really hard and collect as many objects as possible even though the triggering limits are not hit. Will it help if I temporarily set the limits to some small values, call gc() and then reset them back to their original values? What variables exactly need to be set? Does anyone have a prototype of such function? I tried to read the R help,
2008 Sep 04
1
lapply(NULL, ...) returns empty list
Dear R-devel, Is there a reason that lapply(NULL, ...) returns the empty list, rather than NULL? It seems intuitive to expect the latter, and rather counterintuitive that lapply(list(), ... ) returns the same value as lapply(NULL, ...). > lapply(list(), function(x) 1) list() > lapply(NULL, function(x) 1) list() > version _ platform i386-pc-mingw32 arch
2008 Aug 08
1
operating on arrays of unknown dimensionality
Dear R-users, I am looking for a way to assign to slices of arrays where dimensionality of the array is not a-priory known. Specifically, I would like to be able to generalize the following example of dimensionality 2 to an arbitrary diminsionality: In this example we create an array x, a smaller array y and then assign y to a slice of x. > dimnmx <- list(c('a','b'),
2008 Apr 14
1
clean-up actions after non-local exits
Dear R-devel, Some time ago I started a thread that boiled down to clean-up actions after non-local exits in R, see below. I wonder if there has been any progress on this? R-ext 2.6.1 doesn't say much on the subject. How, for example, do people deal with a situation where their C (C++) function opens a file and then receives a signal or longjump-s on error(), how do they make sure the
2004 Aug 09
1
error when calling debugger()
Hi, I am getting an error message when I am trying to run the debugger() on the last.dump. The debugger() stops after I make a selection. Could someone please suggest what it might mean? The R log is included below. This is R-1.8.1 on RH 7.3. Thanks, Vadim > load("last.dump.rda") > debugger(last.dump) Message: Error in split(x, f) : Group length is 0 but data length > 0
2004 Dec 26
4
R's IO speed
R-devel now has some improved versions of read.table and write.table. For a million-row data frame containing one number, one factor with few levels and one logical column, a 56Mb object. generating it takes 4.5 secs. calling summary() on it takes 2.2 secs. writing it takes 8 secs and an additional 10Mb. saving it in .rda format takes 4 secs. reading it naively takes 28 secs and an
2004 Nov 18
4
Enormous Datasets
Dear List, I have some projects where I use enormous datasets. For instance, the 5% PUMS microdata from the Census Bureau. After deleting cases I may have a dataset with 7 million+ rows and 50+ columns. Will R handle a datafile of this size? If so, how? Thank you in advance, Tom Volscho ************************************ Thomas W. Volscho Graduate Student Dept. of Sociology U-2068
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
2004 Sep 24
1
algorithm reference for sample()
Hi, Don't know if it belongs to r-devel or r-help, but since I am planning to alter some of R's internal code I am sending it here. The existing implementation of the sample() function, when the optional 'prob' argument is given, is quite inefficient. The complexity is O(sampleSize * universeSize), see ProbSampleReplace() and ProbSampleNoReplace() in random.c. This makes the
2017 Dec 29
2
data compression in a package
The submission guide has the following cryptic (to me) sentence: ?? "Reasonable compression should be used for data (not just .rda files) " The survival pacakge has a fairly large number of data files --- exactly what should I be doing??? xz compression? Terry T.
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"