Displaying 20 results from an estimated 10000 matches similar to: "R CMD BATCH w/o inputs?"
2005 Apr 11
4
How to suppress the printing of warnings (Windows)?
Dear all,
I'm a newbie in R. I am running simulations using a fixed bandwidth in nonparametric regressions, sending all the output to a file myoutput.txt using sink("myoutput.txt"), & R is printing all warnings by the end of the simulation on the file. I know the source of the problem & can take care of it. However, finding a 50 MB file (where all the output is printed, e.g.
2009 Jan 09
4
Extracting File Basename without Extension
Dear all,
The basename() function returns the extension also:
> myfile <- "path1/path2/myoutput.txt"
> basename(myfile)
[1] "myoutput.txt"
Is there any other function where it just returns
plain base:
"myoutput"
i.e. without 'txt'
- Gundala Viswanath
Jakarta - Indonesia
2012 Mar 30
4
list assignment syntax?
Dear R wizards: is there a clean way to assign to elements in a list?
what I would like to do, in pseudo R+perl notation is
f <- function(a,b) list(a+b,a-b)
(c,d) <- f(1,2)
and have c be assigned 1+2 and d be assigned 1-2. right now, I use the clunky
x <- f(1,2)
c <- x[[1]]
d <- x[[2]]
rm(x)
which seems awful. is there a nicer syntax?
regards, /iaw
----
Ivo Welch
2006 Jul 11
3
--no-save and --save toggle from inside R? + BATCH stderr
dear R wizards: is it possible to instruct R to save or no-save from
inside R? or does this have to be given at invokation on the
command-line? The same question applies to "--no-restore-data",
although this presumably would have to be decided in a .First()
function or something like it.
on a similar note, I would love a CMD BATCH invokation to output just
one line to stderr at the
2006 Nov 24
1
Error in Calling C++ function from R!!!
Hello,
I tried to call an external function of R from the following code in C++:
void prodgdot(double *x, double *y, int *n, double *output)
{
int i;
*output=0;
for (i=0;i<*n;i++)
{
*output+=x[i]*y[i];
}
}
I compiled it using from my working directory in linux terminal and I think
it's ok:
giba at giba-desktop:~/mysrc/meus_testes_iniciais$ R CMD SHLIB
2011 Jul 02
5
%dopar% parallel processing experiment
dear R experts---
I am experimenting with multicore processing, so far with pretty
disappointing results. Here is my simple example:
A <- 100000
randvalues <- abs(rnorm(A))
minfn <- function( x, i ) { log(abs(x))+x^3+i/A+randvalues[i] } ?## an
arbitrary function
ARGV <- commandArgs(trailingOnly=TRUE)
if (ARGV[1] == "do-onecore") {
?library(foreach)
?discard <-
2009 Feb 12
2
beginner's question: group of regressors by name vector?
dear r-experts: there is probably a very easy way to do it, but it eludes
me right now. I have a large data frame with, say, 26 columns named "a"
through "z". I would like to define "sets of regressors" from this data
frame. something like
myregressors=c("b", "j", "x")
lm( l ~ myregressors, data=... )
is the best way to create new
2010 Jan 22
2
sorted reshaping?
dear R wizards:? I am wrestling with reshape.? I have a long data set
that I want to convert into a wide data set, in which rows are firms
and columns are years.
> summary(rin)
firm fyear sim1
Min. :1004.00 Min. :1964.0 Min. : -1.00000
1st Qu.:1010.00 1st Qu.:1979.0 1st Qu.: -0.14334
Median :1016.00 Median :1986.0 Median : 0.00116
Mean
2010 Jan 08
4
fast lm se?
dear R experts---I am using the coef() function to pick off the coefficients
from an lm() object. alas, I also need the standard errors and I need them
fast. I know I can do a "summary()" on the object and pick them off this
way, but this computes other stuff I do not need. Or, I can compute (X'
X)^(-1) s^2 myself. Has someone written a fast se() function?
incidentally, I think
2010 Jun 11
3
lm without error
this is not an important question, but I wonder why lm returns an
error, and whether this can be shut off. it would seem to me that
returning NA's would make more sense in some cases---after all, the
problem is clearly that coefficients cannot be computed.
I know that I can trap the lm.fit() error---although I have always
found this to be quite inconvenient---and this is easy if I have only
2007 Jan 01
1
advice on semi-serious attempt to extend summary
Dear R wizards:
I am trying (finally) to build a function that might be useful to
others. In particular, I want to create a summary.lme (extended lm)
method that [a] adds normalized coefficients and [b] white
heteroskedasticity adjusted se's and T's. I believe I already know
how to do the programming to do these two, at least in simple
unweighted cases. Now my challenges are just [1]
2012 May 09
2
big quasi-fixed effects OLS model
dear R experts---now I have a case where I want to estimate very large
regression models with many fixed effects---not just the mean type, but
cross-fixed effects---years, months, locations, firms. Many millions of
observations, a few thousand variables (most of these variables are
interaction fixed effects). could someone please point me to packages, if
any, that would help me estimate such
2013 Feb 06
5
First R Package --- Advice?
Dear R experts---
after many years, I am planning to give in and write my first R
package. I want to combine my collection of collected useful utility
routines.
as my guide, I am planning to use Friedrich Leisch's "Creating R
Packages: A Tutorial" from Sep 2009. Is there a newer or better
tutorial? this one is 4 years old.
I also plan on one change---given that the
2009 Sep 15
2
why is nrow() so slow?
dear R wizards: here is the strange question for the day. It seems to me
that nrow() is very slow. Let me explain what I mean:
ds= data.frame( NA, x=rnorm(10000) ) ## a sample data set
> system.time( { for (i in 1:10000) NA } ) ## doing nothing takes
virtually no time
user system elapsed
0.000 0.000 0.001
## this is something that should take time; we need to add 10,000
2010 May 11
3
Revolution R and the R Community?
As an end-user, I wonder about Revolution R. Is the relationship
between Revolution R and the R community at-large a positive one? Do
the former contribute to the development efforts of the latter? Is
there a competitive aspect? is their forum competitive with r-help?
any other thoughts? (most of all, I simply hope that they help some
of the many helpful experts on this forum, who have
2004 Oct 15
4
pdf device --- axes labels text disappeared?
Dear R Wizards: Running R 1.9.1. on amd64.
Promise<- c(0,20,40); Expect<- c(0, 20, 0.2*20+.8*40 );
# this omits printing numbers on the axes labels.
pdf(file = "bug.pdf" );
plot(Promise, Expect, type="b", ylim=c(0,60));
dev.off();
# this works
postscript(file = "bug.eps" );
plot(Promise, Expect, type="b", ylim=c(0,60));
dev.off();
apologies if
2009 Apr 16
2
static variable?
dear R experts:
does R have "static" variables that are local to functions? I know
that they are usually better avoided (although they are better than
globals).
However, I would like to have a function print how often it was
invoked when it is invoked, or at least print its name only once to
STDOUT when it is invoked many times.
possible without <<- ?
sincerely,
/iaw
2009 Sep 01
2
"simple" 3-dimensional plots?
dear R experts: I am trying to plot an empirical likelihood function in 3d.
The values are not over a regular grid---I just searched the likelihood
function to find the optimal value, and then computed a few values around
it. (each point in the likelihood function takes a very long time to
compute.)
the likelihood values now sit in a csv file that has three
columns, "mu",
2004 Jul 07
3
fast NA elimination ?
dear R wizards: an operation I execute often is the deletion of all
observations (in a matrix or data set) that have at least one NA. (I
now need this operation for kde2d, because its internal quantile call
complains; could this be considered a buglet?) usually, my data sets
are small enough for speed not to matter, and there I do not care
whether my method is pretty inefficient (ok, I
2004 Aug 21
4
loadhistory() in .Rprofile ?
dear wizards: my .Rprofile has just one command for testing,
loadhistory("~/.Rhistory")
but this gives me an error on R startup:
Error: couldn't find function "loadhistory"
Invoking loadhistory() as the first interactive command works fine;
incidentally, I believe loadhistory() in the .Rprofile worked in
earlier or other platform R releases, too.
Is the .Rprofile