[Peter Dalgaard]
[François Pinard]
I meant that R might have implemented a Scheme engine [...] with
a surface language [...] which is purposely not Scheme, but could have
been. [...] one could dare dreaming that the Scheme engine in R be
completed, and Scheme offered as an alternate extension
[Duncan Murdoch]
You could also look at Ross Ihaka's paper that is online here:
http://cran.r-project.org/doc/html/interface98-paper/paper.html
Interesting read. Thanks for this reference!
--
François Pinard http://pinard.progiciels-bpi.ca
__
R
[Roland Rau]
[François Pinard]
I wonder what happened, for R to hide the underlying Scheme so fully,
at least at the level of the surface language (despite there are
hints).
To further foster portability, we chose to write R in ANSI C
Yes, of course. Scheme is also (often) implemented
). If R was ever to offer
Lisp-like interfaces, RnRS (Scheme standards) might be considered, both
for being simpler, and more in the spirit of what R already is.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing
[Dirk Eddelbuettel]
[François Pinard]
#!/usr/bin/Rscript
options(echo=TRUE)
a - 1
Sys.sleep(3)
a - 2
If I execute ./pp.R at the shell prompt, the output shows the
timely progress of the script as expected. If I use ./pp.R | tee
OUT instead, the output seems buffered
have the similar experience?
Not me. I use flash drives a lot to move .RData files around, without
the slightest trouble. However, in my case, the involved machines are
similar in their architecture and system, so I was not fearing trouble.
--
François Pinard http://pinard.progiciels-bpi.ca
this (and consequently, Metapost as well). I still
remember my surprise when I found out that Donald Knuth resorts to such
sophisticated machinery for the sole purpose of designing font
characters. Knuth surely did many wonderful things :-).
--
François Pinard http://pinard.progiciels
limited.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal
how one computes the expression piecemeal, that
is, better than by building a string and parsing the result.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=fr_CA.UTF-8;LC_IDENTIFICATION=C
Search Path:
.GlobalEnv, package:stats, package:utils, package:datasets, fp.etc,
package:graphics, package:grDevices, package:methods, Autoloads, package:base
--
François Pinard http://pinard.progiciels-bpi.ca
)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self
to be productive
with R as it stands, even knowing it could have been a bit better.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
was already taken :-)
For example:
a = list(x=matrix(1:3, 3, 1), y=matrix(4:6, 3, 1))
a
$x
[,1]
[1,]1
[2,]2
[3,]3
$y
[,1]
[1,]4
[2,]5
[3,]6
do.call(cbind, a)
[,1] [,2]
[1,]14
[2,]25
[3,]36
--
François Pinard http
(yet I did not recently check) that do.call,
which.min, and a flurry of other useful functions, are introduced in
various R tutorials. If you plan to use R seriously, it might be worth
scrutinizing a few of those.
Keep happy!
--
François Pinard http
3 11 19 27 35
a 1 6 11 16 21 4 12 20 28 36
b 2 7 12 17 22 5 13 21 29 37
b 2 7 12 17 22 6 14 22 30 38
b 2 7 12 17 22 7 15 23 31 39
b 2 7 12 17 22 8 16 24 32 40
does it is clear? is there a function that automate this operation?
Like, maybe:
cbind(a[rownames(b),], b)
--
François
, given this artificial example:
X - sample(1:24)
dim(X) - c(2, 3, 4)
you would want:
library(reshape)
melt(X)[order(X), -4]
so getting the indices in a three columns data frame.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R
[Gabor Grothendieck]
table(col(mat), mat)
Clever, simple, and elegant! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
columns afterwards.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented
this in R?
Either of:
A[!A %in% B] - NA
A[!A %in% B] - 0
depending on what you want your N/A symbol to be.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
different schools in this 60 obs dataset.
I need to thave sequential identifiers, 1,2,3,4,5,...,143.
Hello, Toby. Maybe:
dta$id - cumsum(c(1, diff(dta$school_id) != 0))
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch
an arbitrarily large number of categories, one may go
through a recoding vector, like this for the example above:
Cat - c('a', 'a', 'a', 'b', 'b', 'b', 'a', 'a', 'b')
C1 - c(a=-1, b=1)[Cat]
C1
a a a b b b a a b
-1 -1 -1 1 1 1 -1 -1 1
--
François Pinard http://pinard.progiciels
of thanks from me!
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented
the R online help system, many examples are marked so they are
not run. I naively thought they were not run for friendly reasons, like
for example, not inordinately impacting the user's environment. Should
I read you as saying that those examples are not to be believed?
--
François Pinard
on any R implementation, for little things only meant
for myself, and too simple to warrant publication anyway?
Keep happy, all.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch
the first and second line.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
[John Lawrence Aspden]
Another difficulty I'm having is creating a common function (foo, say) to
share between two scripts.
In your previous message, you were telling us that you want to load from
your home directory. You might put the common functions there, maybe?
--
François Pinard http
$xsel.eval
fp.etc$xs - fp.etc$xsel.source
attach(fp.etc, warn=FALSE)
})
}
# vim: ft=r
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
. They will resist
the fashion of the day for complexity, and survive in the long run.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
for such
problems, and also not so well adapted to quasi-parallelism between
interacting processes having each their own behaviour.
Of course, seasoned R users might have much more sound opinions than
mine on this topic! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
for such
problems, and also not so well adapted to quasi-parallelism between
interacting processes having each their own behaviour.
Of course, seasoned R users might have much more sound opinions than
mine on this topic! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
rapidly, to increase
precision by not so much. By merely tuning a few parameters, these
people may easily pump nearly all the available cycles out the
supercomputers given to them, and they do so without hesitation.
Moore's Law will never succeed at calming their starving hunger! :-).
--
François
:-). Simple
enough! Make sure you `cat' or `print' explicitly whatever has to be
written on standard output: for one, I usually prefer full control in
scripts over automatic printing of given expressions.
--
François Pinard http://pinard.progiciels-bpi.ca
[Taka Matzmoto]
Is there any way to prevent [this] warning message.
Hi, Taka. The easiest might be using the suppressWarnings wrapper.
See ?suppressWarnings for more information.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help
)] - NA
return(-100*x+0*y+100*z)
}
x = seq(1, 0, by = -0.01)
y = seq(1, 0, by = -0.01)
zmat = outer(x, y, f)
image(zmat, col=terrain.colors(10))
contour(zmat, add=T)
Another idea is to exchange x, y in the outer call, and maybe also
use rev() on one of them.
--
François Pinard http
-fortran-4.0.2_20050901-3
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
, LOWEST) argument,
that is, listing the maximum before the minimum. For example:
plot(1:10, ylim=c(10, 1))
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
itself slowly over time,
and is not so much in need of forceful evangelists. :-)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
that
ignores all warnings.
My exegesis :-) for that sentence would be that the context does not
survive the error, and so, the warn option is not changed.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
on this side, who knows... :-)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
not know how easy (or not) it
would be writing a dumb device for R, but I wish that if someone ever
contributes it, it will be accepted by the core team.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
or another (currently done
within quantile).
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting
[Robert Citek]
How can I increase/decrease the line length for screen wrapping?
Check ?options, and within in, width, it might be what you want.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https
under SuSE 10.0, and needs
nothing which is not already available on the distribution media.
Should I say, I'm still impressed (even astonished) that R installation
succeeds so easily, given the size and complexity of the distribution.
--
François Pinard http://pinard.progiciels-bpi.ca
[Romain Francois]
[...] it would be useful to add an option 'ask' in 'example', maybe
with a default to TRUE in interactive mode
Seconded. `example(...)' would be more friendly for the average use.
--
François Pinard http://pinard.progiciels-bpi.ca
2 1
2 2 1
You might try:
subset(x3, !x1 %in% x1[which(x2==2)])
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http
within your ~/.Rprofile file.
P.S. - By the way, much congratulations and thanks to the R Core team
for the recent publication of R 2.3.0.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https
[Jian Zhang]
how to draw a circle (e.g. radius=10cm) of one point?
And how to choose these points in the circle?
There also are ellipse functions in both packages car and ellipse.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help
,
given the size and complexity of R sources, components, and all release
engineering. I'm always quite impressed that such software works!
There is a tremendous amount of work behind a successful distribution,
which many of us do not suspect enough! :-) It forces admiration.
--
François Pinard
. This is
convenient for quick mathematical jobs, and quite in the spirit of Vim
(fast and easy start/exit, instead of long running like Emacs).
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch
[Gabor Grothendieck]
What you are referring to iris is called iris3 in R so just replace
iris with iris3. iris3 is a 3d array in R whereas iris is a data frame.
Thanks for this calm and simple reply. Some could learn from you! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
a matrix again
?'[' explains it. Using your example:
is.matrix(y[-c(1, 2), , drop=FALSE])
[1] TRUE
is.matrix(y[-c(1, 2, 3), , drop=FALSE])
[1] TRUE
is.matrix(y[-c(1, 2, 3, 4), , drop=FALSE])
[1] TRUE
--
François Pinard http://pinard.progiciels-bpi.ca
[ivo welch]
how about people on [...] linux or unix [...]
See ?commandArgs.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
?
You may use cat instead of print. No need to paste then.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org
of the constant fear some have of seeing this list abused.
There are ways for not being abused, which do not require becoming
abusive ourselves. We should deepen such ways in our own habits.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help
[Kjetil Brinchmann Halvorsen]
erf [in] package (CRAN) NORMT3, as help.search(error function) could
have told [you]
It does not for me. I would presume one needs NORMT3 installed first,
and NORMT3 is seemingly not part of standard base R installation.
--
François Pinard http
else for JPEG images).
Just a few thoughts. Keep happy, all!
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting
, the few remaining lines is
Newton-Raphson over an expression. Don't take this too seriously, it
was a mere toy with this to get an initial feel of the R language. :-)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch
-alpha, which itself quotes a message written in 1994.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org
[Vincent Negre]
[...] I do not understand how qqplot() compute quantiles.
Just type ``qqplot`` (without the parentheses) at the R prompt, to see
the source code. ``qqplot`` does not especially compute quantiles,
which are rather obtained directly through sorting its arguments.
--
François
, François Pinard wrote:
Hi, R friends. I had some difficulty with the following code:
qqnorm(freq, log='y')
qqline(freq)
as the line drawn was seemingly random. The exact data I used appears
below. After wandering a bit within the source code for abline,
I figured out I should rather write
Search Path:
.GlobalEnv, package:methods, package:stats, package:graphics,
package:grDevices, package:utils, package:datasets, fp.etc, Autoloads,
package:base
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
because of the starred paragraph above, that is, for wrong
reasons. Best is, and this often occurs on the R list, when everything
(facts, opinions) is being shared efficiently, without useless arguing.
Then, threads quickly fade out.
--
François Pinard http://pinard.progiciels-bpi.ca
of others, improve ourselves, and so increase the value of our share.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R
for computing the
projection of the rectangle enclosing the image, than PIL (Python
Imaging Library) for producing that precise trapezoidal deformation.
Just sharing ideas, of course. Much likely that if I knew R better,
I would use it more fully -- but that's a tautology! :-)
--
François
knows (I'm not sure): R might well offer a powerful
environment for building a dynamic programming framework.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
[hadley wickham]
[François Pinard]
Selecting a sample is easy. Yet, I'm not aware of any SQL device for
easily selecting a _random_ sample of the records of a given table.
On the other hand, I'm no SQL specialist, others might know better.
There are a number of such devices, which tend
[Brian Ripley]
[François Pinard]
[Brian Ripley]
One problem [...] is that R's I/O is not line-oriented but
stream-oriented. So selecting lines is not particularly easy in R.
I understand that you mean random access to lines, instead of random
selection of lines.
That was not my point
-- but this is only an opinion: I'm
rather demanding in the area of legibility, while many or most people
are more courageous than me! :-).
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch
, so it might be that pregenerating randomized
IDs is not worth the trouble. Also given that whenever the database
size changes, the list of pregenerated IDs is not valid anymore.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help
[Uwe Ligges]
François Pinard wrote:
[David Forrest]
[...] A few end-to-end tutorials on some interesting analyses would
be helpful.
I'm in the process of learning R. While tutorials are undoubtedly
very useful, and understanding that working and studying methods vary
between individuals, what I
] are designed for people in particular fields
and turn out to be extremely useful.
Undoubtedly! I envy you all, who know already! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman
.
If such a sampling facility was built right within usual R reading
routines (triggered by an extra argument, say), it could offer
a compromise for processing large files, and also sometimes accelerate
computations for big problems, even when memory is not at stake.
--
François Pinard http://pinard.progiciels
, and if I then dared implementing it
myself, would it be welcome?
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R
of the current material. The
mechanism should likely allow for added glue text, about everywhere
reasonable, and for diagnosing any lone, unreachable page in the current
reference.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch
^2 + y^2))
di$angle - with(di.c, atan2(y, x))
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org
at an actual example of using R for mini-movies:
http://pinard.progiciels-bpi.ca/plaisirs/animations/index.html
I wrote this toy about the same week I started to learn R, and it was a
hell of a good exercise for the poor little me! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
and be mislead; don't be, the engine is pretty solid.
Peek at http://maxima.sourceforge.net if you think you need such a
beast. Beware: to use it, you need either GCL or Clisp pre-installed.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help
done..
Surely that for now, RPy is quite sufficient for my simple needs.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http
extensions). R also holds interesting
(useful and flexible) ideas about argument passing and matching, lazy
evaluation, and environments. And surely other things as well.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch
[Prof Brian Ripley]
[François Pinard]
Now using this line within `~/.Renviron':
R_LIBS=/home/pinard/etc/R
my tiny package is correctly found by R. However, R does not seem to
see any library within that directory if I rather use either of:
R_LIBS=$HOME/etc/R
R_LIBS=$HOME/etc/R
on SuSE 9.2.
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
with this!
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
capabilities, and it also opens
up all kind of ideas to toy with! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R
, if possible, at the tedious work of
getting those archives, so it sooner gets behind me, instead of ahead...
Thanks to all. Enjoy the spring! :-)
--
François Pinard http://pinard.progiciels-bpi.ca
---BeginMessage---
Robert King, hello!
The page `http://www.r-project.org
85 matches
Mail list logo