Re: [R] Adding 3D points

2004-08-26 Thread David Brahm
[EMAIL PROTECTED] wrote:

 I would like to add individual points and lines to a persp() plot that I
 generated with the geoR package.

See example (2) in ?persp.  You must define this function:
  trans3d - function(x,y,z, pmat) {
tr - cbind(x,y,z,1) %*% pmat
list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4])
  }

Then you must assign the result of your persp() call to pmat, e.g.:
R x - y - seq(-10, 10, length = 50)
R f - function(x, y) {r - sqrt(x^2+y^2); 10 * ifelse(r==0, 1, sin(r)/r)}
R z - outer(x, y, f)
R pmat - persp(x, y, z, theta=30, phi=30, expand=.5, col=lightblue,
+  xlab=X, ylab=Y, zlab=Z, ticktype=detailed)

And then you can add points and lines:
R points(trans3d(0,0,f(0,0),pmat))
R z2 - sapply(1:length(x),function(n)f(x[n],y[n]))
R lines(trans3d(x,y,z2,pmat),col=red,lwd=2)
R lines(trans3d(c(-10,10,10,-10,-10),c(-10,-10,10,10,-10),c(2,2,8,8,2), pmat),
+col=blue)

All hail to Ben Bolker, who kindly taught me this in March 2002.
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to set the number format to pure numeric?

2004-08-24 Thread David Brahm
lichi shi [EMAIL PROTECTED] wrote:
 I want to export a numeric matrix in pure numeric format, i.e. I want
 0.0001 to appear as 0.0001. But it seems the default setting for
 write.table is scientific notation, i.e. it will appear as 1e-04. how
 to set the number format to pure numeric?

Try:
R options(scipen=99)
which sets a very high SCIentific notation PENalty.
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: R equivalent of Splus rowVars function

2004-06-09 Thread David Brahm

Mark Leeds [EMAIL PROTECTED] wrote (to S-News):
 does anyone know the R equivalent of the SPlus rowVars function ?

Andy Liaw [EMAIL PROTECTED] replied:
 More seriously, I seem to recall David Brahms at one time had created an R
 package with these dimensional summary statistics, using C code.  (And I
 pointed him to the `two-pass' algorithm for variance.)

Here are the functions that didn't make it into R's base package, which should
be very similar to the S-Plus functions of the same names.  The twopass
argument determines whether Andy's two-pass algorithm (Chan Golub  LeVegue) is
used (it's slower but more accurate).  In real life I set the twopass default
to FALSE, because in finance noise is always bigger than signal.

I am cc'ing to R-help, as this is really an R question.
-- 
  -- David Brahm ([EMAIL PROTECTED])


colVars - function(x, na.rm=FALSE, dims=1, unbiased=TRUE, SumSquares=FALSE,
twopass=TRUE) {
  if (SumSquares) return(colSums(x^2, na.rm, dims))
  N - colSums(!is.na(x), FALSE, dims)
  Nm1 - if (unbiased) N-1 else N
  if (twopass) {x - if (dims==length(dim(x))) x - mean(x, na.rm=na.rm) else
 sweep(x, (dims+1):length(dim(x)), colMeans(x,na.rm,dims))}
  (colSums(x^2, na.rm, dims) - colSums(x, na.rm, dims)^2/N) / Nm1
}

rowVars - function(x, na.rm=FALSE, dims=1, unbiased=TRUE, SumSquares=FALSE,
twopass=TRUE) {
  if (SumSquares) return(rowSums(x^2, na.rm, dims))
  N - rowSums(!is.na(x), FALSE, dims)
  Nm1 - if (unbiased) N-1 else N
  if (twopass) {x - if (dims==0) x - mean(x, na.rm=na.rm) else
 sweep(x, 1:dims, rowMeans(x,na.rm,dims))}
  (rowSums(x^2, na.rm, dims) - rowSums(x, na.rm, dims)^2/N) / Nm1
}

colStdevs - function(x, ...) sqrt(colVars(x, ...))

rowStdevs - function(x, ...) sqrt(rowVars(x, ...))

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] unusual name in .Rd file: documenting an infix function

2004-03-08 Thread David Brahm
Christian Hoffmann [EMAIL PROTECTED] wrote:
 I am having difficulties documenting an infix function:
 %% - function(x,y) { paste(x,y,sep=) }

We have the exact same function, and the following documentation works fine.
Note the documentation filename is g.am.Rd, but that's just a random name,
unrelated to the function.  Also note that  is escaped in the name but not
in the alias!

\name{\%\\%}
\alias{\%\%}
\title{Concatenate strings}
\description{a \%\% b  converts a and b into strings and concatenates them.}
\usage{a \%\% b}
\value{A string, the concatenation of a and b.}
\examples{3 \%\% RAJA}
\keyword{character}

-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] calling R from a shell script and have it display graphics

2004-02-13 Thread David Brahm
Christophe Pallier [EMAIL PROTECTED] wrote:
 I would like to call R from a shell script and have it display a series 
 of graphics.
 The graphics should remain visible until the user clicks or presses a key.

One trick is to use locator(1), which waits for a mouse click on a plot.
Here's a minimal Perl script that runs R, displays a plot, and exits when the
click is detected.


eval 'exec /usr/local/bin/perl -s -S $0 $@'
  if 0;
open(SCRIPT, | R --vanilla --slave);
print SCRIPT 'EOF';

x11(width=5, height=3.5)
plot(1:10, 1:10)
z - locator(1)
q()

EOF
close(SCRIPT);

-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] force fixed format

2004-01-02 Thread David Brahm
John Fox wrote:
 If the issue [of suppressing scientific notation] is general, try the scipen
 option:
   options(scipen=10)
   p - 0.0001
   p
 [1] 0.0001

To explain further: R normally prints in scientific notation if it requires
fewer characters than standard notation.  By setting options(scipen=10), you
are imposing an addition 10-character SCIentific notation PENalty whenever this
comparison is made.  Negative values would favor scientific notation.
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Plot a sphere

2003-12-26 Thread David Brahm
Derick Schoonbee [EMAIL PROTECTED] wrote:
 Would somebody please be so kind as to direct me in plotting a 3D sphere?

Here's one way.  I generate an empty 3D plot with persp, then fill it with
polygons transformed with trans3d (as found in the help for persp).  I
didn't do hidden surface removal (you didn't mention whether you wanted it),
but if you do, just reorder the polygons from back to front and paint them
a solid color (e.g. col=red), so hidden ones get painted over.

pmat - persp(0:1, 0:1, matrix(,2,2), xlim=c(-1,1), ylim=c(-1,1), zlim=c(-1,1),
  theta=25, phi=30, expand=.9, xlab=X, ylab=Y, zlab=Z)

trans3d - function(x,y,z, pmat) {  # From the help for persp
  tr - cbind(x,y,z,1) %*% pmat
  list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4])
}

theta - seq(0, 2*pi, length=51)
phi   - seq(0,   pi, length=26)
x - cos(theta) %o% sin(phi)
y - sin(theta) %o% sin(phi)
z - rep(1, length(theta)) %o% cos(phi)

for (j in seq(phi)[-1]) for (i in seq(theta)[-1]) {
  idx - rbind(c(i-1,j-1), c(i,j-1), c(i,j), c(i-1,j))
  polygon(trans3d(x[idx], y[idx], z[idx], pmat))
}
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R function help arranged in categorical order ?

2003-11-05 Thread David Brahm
Neil Osborne [EMAIL PROTECTED] wrote:
 Is any one aware of R help documentation that is aranged in functional
 categories for e.g.:
   String manipulation
   File I/O
   Dataframe, List manipulation

There really oughta be.  Several people replied with ways to search the help,
but that assumes you know the specific task you want to perform, and the right
keyword to describe it.  Beginners often just want to learn what's available.

For a few functional categories there are general help pages, and you might
not easily stumble across them.  Here's a list I came up with recently.  Just
type e.g. ?Arithmetic at the R prompt to learn about Arithmetic Operators.

?Arithmetic
?Comparison
?Control
?DateTimeClasses
?Defunct
?Deprecated
?Devices
?Extract (same as ?Subscript)
?Foreign
?Logic
?Memory
?Paren
?Rdconv  (RdUtils page: Rdconv, Rd2dvi, Rd2txt, Sd2Rd)
?Special (beta, gamma, choose, ...)
?Startup
?Syntax
?build   (PkgUtils page: R CMD build, R cmd check)
?connections (file, pipe, ...)
?pi  (Constants page: LETTERS, letters, month.abb, month.name, pi)

-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R - S compatibility table

2003-10-21 Thread David Brahm
Purvis Bedenbaugh [EMAIL PROTECTED] wrote:
 I started looking for an R-S compatibility table but didn't find it.
 Examples:
   'stdev' is now 'sd'  - is it exactly the same computation ?
   couldn't find a built-in for error.bar()
   syntax that is an error in R: param(thisframe,b) - value

It's a moving target!  I wrote such a list in October 2001, and revised it a
year later, but I haven't updated it since then (I no longer use S-Plus).  Some
people (e.g. Paul Gilbert) replied that they also had lists which didn't
overlap much with mine, suggesting we were each seeing just a small part of the
puzzle.  So maintaining a complete and current list would be quite a challenge.

Paul also mentioned to me a mailing list R-sig-S on the topic:
  https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-s
but it seems dead since May 2001.

That said, here's my year-old list.  Note S means S-Plus 6.1.2 (not The S
Language) and R probably means R-1.6.0.

 ***   R vs. S (DB 10/28/02)  ***

Language differences:
- Scoping rules differ.  In R, functions see the functions they're in.  Try:
f1 - function() {x - 1; f2 - function() print(x); f2()};  f1()
- Data must be loaded explicitly in R, can be attach()'ed in S.
Addressed by my contributed package g.data.
- R has a character-type NA, so LETTERS[c(NA,2)] = c(NA,B) not c(,B)
- paste(a,b, sep=|, sep=.) is an error in R; ok in S.
- for() loops more efficient in R.

Graphics differences:
- Log scale indicated in S with par(xaxt)==l, in R with par(xlog)==T.
- R has cex.main, col.lab, font.axis, etc.  Thus title(Hi, cex=4) fails.
- R has plotmath and Hershey vector fonts.
- R has palette(rainbow(10)) to define colors (both screen and printer).

Functions missing from R:
- unpaste, slice.index, colVars

Functions missing from S:
- strsplit, sub, gsub, chartr, formatC

Functions that work differently:
- system() has no input argument in R.
- substring(s,x) - X only works in S, but R has s - gsub(x,X,s).
- scan expects numbers by default in R.
- which(numeric) converts to logical in S, is an error in R.
- The NULL returned by if(F){...} is invisible in R, visible in S.
- The NULL returned by return() is visible in R, invisible in S.
- Args to var differ, and R has cov.  S na.method=a ~ R use=p.
- var (or cov) drops dimensions in S, not R.
- cut allows labels=F in R, not in S (also left.include=T becomes right=F).
- Last argument of a replacement function must be named value in R.
- tapply(1:3, c(a,b,a), sum) is a 1D-array in R, a vector in S.
- probability distribution fcn's have arg log.x in R (ref: Spencer Graves)

-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] How to upgrade R

2003-10-21 Thread David Brahm
Andy Liaw [EMAIL PROTECTED] wrote:

 What's not clear to me is a good way of keeping two versions of R
 simultaneously (for ease of transition).  Can anyone suggest a good strategy
 for doing that on *nix?

I'm not sure what you mean, but I'll tell you what we do.  We have built
/res/R/R-1.6.2, /res/R/R-1.7.1, /res/R/R-1.8.0, etc. (note we never run make
install).  Anyone who doesn't want to upgrade (e.g. frozen production code)
just hard-codes one of those paths.  Everyone else uses a symbolic link
/res/R/R, which right now points to R-1.7.1 but will change to R-1.8.0 when we
feel we're ready.

Just to add another layer of complication, actually we have another symbolic
link /res/R/Rdb, which I (db) use, because I like to upgrade faster.  So Rdb
currently points to R-1.8.0.  Symbolic links are your friend.
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] [R-pkgs] Updated package: g.data v1.4

2003-10-17 Thread David Brahm
Version 1.4 of package g.data is available on CRAN.  This upgrade is
necessary for it to work under R-1.8.0, and is fully backward compatible.

Description: Create and maintain delayed-data packages (DDP's).  Data stored in
  a DDP are available on demand, but do not take up memory until requested.
  You attach a DDP with g.data.attach(), then read from it and assign to it in
  a manner similar to S-Plus, except that you must run g.data.save() to
  actually commit to disk.

Thanks very much to [EMAIL PROTECTED] for pointing out the incompatibility.
(Sorry, Brian, a direct reply to you bounced.)  g.data basically creates mock
packages (DDP's) to contain the data, and in R-1.8.0 a package needs a
DESCRIPTION file to be recognized by .find.package().  Note you will need
temporary write access to any existing (pre-1.4) DDP's, as g.data.attach() will
try to create a DESCRIPTION file for any DDP that doesn't already have one.
-- 
  -- David Brahm ([EMAIL PROTECTED])

___
R-packages mailing list
[EMAIL PROTECTED]
https://www.stat.math.ethz.ch/mailman/listinfo/r-packages

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] How to avoid automatic coercion to factor?

2003-09-03 Thread David Brahm
Steve Dutky [EMAIL PROTECTED] wrote:
 I have a function that manipulates a list of numeric and character
 components of equal length and wants to return a data.frame.
 ...
 How can I get the columns Char1, Char2, (...CharN) returned coerced to
 character and not factor?

Prof Brian Ripley [EMAIL PROTECTED] wrote:
 ... We should ask why you want character columns in a data frame?...

I think Steve's situation is very common.  It points up a long-standing gap in
the S language, namely a class of objects for tabular data that is less
restrictive than data.frame or matrix.  Data frames are really designed for
statistics (thus their inclination towards factors and valid column names),
while matrices can only handle a single mode of data (numeric or character).

In my own world, I've implemented this class as lists of equal-length
vectors, and built many tools for it that mirror read.table, write.table,
merge, cbind, rbind, etc.  Except that I've done it sloppily, without using
real classes or constructors/validators/methods.

It would be nice to have a real class table (maybe data.frame would extend
it?).  But no, I'm not volunteering to build it. :-/
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] General help pages

2003-08-18 Thread David Brahm
Uwe Ligges [EMAIL PROTECTED] wrote:
 Please follow that [?sort] reference and read ?Comparison as well.

There seem to be several very useful general help pages like ?Comparison,
?Devices, and ?Startup, which do not tie to a specific function.  Is there a
list of these?  I'd like some bedtime reading.
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] General help pages

2003-08-18 Thread David Brahm
Following Uwe's and Dirk's suggestions, here's a first pass at a list of
interesting general help pages:

?Arithmetic
?Comparison
?Control
?DateTimeClasses
?Defunct
?Deprecated
?Devices
?Extract
?Foreign
?Logic
?Memory
?Paren
?Rdconv  (RdUtils page: Rdconv, Rd2dvi, Rd2txt, Sd2Rd)
?Special (beta, gamma, choose, ...)
?Startup
?Syntax
?build   (PkgUtils page: R CMD build, R cmd check)
?connections (file, pipe, ...)
?pi  (Constants page: LETTERS, letters, month.abb, month.name, pi)

Note that the RdUtils, PkgUtils, and Constants pages cannot be accessed through
their names (?RdUtils, etc).

I'd also suggest two additional general pages (which do not currently exist):
?System   (system, .Platform, Sys.info, Sys.getenv, Sys.putenv, getwd, setwd)
?Graphics (covering plot, lines, points, segments, par, Devices)
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] 'format' problem

2003-08-04 Thread David Brahm
Timur Elzhov [EMAIL PROTECTED] wrote:
 format(1234567, digits = 2)
   [1] 1234567
 but I'd like the last number to be represented as 1.2e+06 string too.

R chooses 1234567 instead of 1.2e+06 because it has fewer or equal number
of characters (equal in this case).

In R-devel (which will become R-1.8.0, as I understand it), an options(scipen)
has been added which penalizes scientific notation by an additional number of
characters.  In your case, a negative penalty would do the trick:

  R-devel options(scipen=-9)
  R-devel format(1234567, digits = 2)
   [1] 1.2e+06

However, unless you feel like compiling a development version or waiting
until 1.8.0, Andrew C. Ward's [EMAIL PROTECTED] suggestion is
probably the simpler way to go:
  Ward sprintf(%.1e, 1234567)
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] dev.copy()

2003-06-30 Thread David Brahm
In a batch script (i.e. there is no screen device), I would like to create both
a PDF file and a PNG file from the same plot.  I thought this would be the way
to do it, but it isn't:

 R bitmap(copy.png, png16m, res=300)
 R pdf(copy.pdf)
 R plot(1:10, 1:10) # Plot into pdf file
 R dev.copy(which=2)# Copy to png file
 R dev.off(3)   # Close pdf
 R dev.off(2)   # Close png

The PDF comes out fine, but the PNG appears blank.  Any ideas what I'm doing
wrong?  TIA.
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] breaks

2003-06-13 Thread David Brahm
Martin Maechler [EMAIL PROTECTED] wrote:
 findInterval()

Hi, Martin.  I wasn't aware of findInterval().  findInterval(x, vec) looks to
me very similar to:
  R cut(x, c(-Inf,vec,Inf), labels=FALSE, right=FALSE) - 1
so I'm curious what the differences are (e.g. speed, duplicates in vec?).  In
any case, findInterval() and cut() ought to be in each other's See Also,
don't you think?

R xx - c(-2.0, 1.4, -1.2, -2.2, 0.4, 1.5, -2.2, 0.2, -0.4, -0.9)
R xx.y - c(-2.200, -0.967, 0.267, 1.500)
R findInterval(xx, xx.y)
   [1] 1 3 1 1 3 4 1 2 2 2
R cut(xx, c(-Inf,xx.y,Inf), labels=FALSE, right=FALSE) - 1
   [1] 1 3 1 1 3 4 1 2 2 2
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R CMD BATCH --vanilla --slave produces unwanted lines

2003-05-31 Thread David Brahm
Robin Hankin [EMAIL PROTECTED] wrote:

 Anyway, now I'm trying to run R in batch mode, but I'm getting extra
 output, which I don't want (RedHat 8.3, R-1.7.0):
...
 r:~% R CMD BATCH --vanilla --slave test.R

Why not just run:
unix R --vanilla --slave  test.R  test.out

Then the options(echo=FALSE) line is unnecessary.  Note an explicit q()
at the end of the script eliminates a single blank line that occurs otherwise.
So the test.R script is just:

  write(rnorm(4),)
  q()

-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] network connection

2003-03-19 Thread David Brahm
Wei Ding [EMAIL PROTECTED] wrote:
 How can I configure R to allow http connection (through company firewall)?

Repeating my R-help message of 2/18/03, for R-1.6.2 under Solaris 2.6:

1) In my .Rprofile:  options(download.file.method=wget)
   (The default method internal does not seem to work for me.)

2) In my .cshrc: setenv http_proxy some.proxy.server:8000

3) some.proxy.server is NOT the name I find in my web browser!  The web
   browser knows the machine that serves Proxy Auto-Configuration files, but
   I needed to get the name of an actual proxy server from our local guru.
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] functions different in R and S

2003-02-19 Thread David Brahm
Helen Yang [EMAIL PROTECTED] wrote:
 I wonder whether there is any resource that can point to useful substitutes
 for S functions that are not recognized by R.  At the same time whether there
 is a list of functions, which appear in both R and S but which don't do
 exactly the same thing.

As Prof. Brian D. Ripley [EMAIL PROTECTED] said, see the FAQ at:
  http://www.r-project.org/ (Click FAQs, R FAQ, R and S.)

Here are my own crib notes on some differences that I care about.  Note S
here really means S-Plus version 6.1.2.  I have not checked whether any of
these have changed since October.  This list is certainly not complete.

 ***   R vs. S (DB 10/28/02)  ***

Language differences:
- Scoping rules differ.  In R, functions see the functions they're in.  Try:
f1 - function() {x - 1; f2 - function() print(x); f2()};  f1()
- Data must be loaded explicitly in R, can be attach()'ed in S.
Addressed by my contributed package g.data.
- R has a character-type NA, so LETTERS[c(NA,2)] = c(NA,B) not c(,B)
- paste(a,b, sep=|, sep=.) is an error in R; ok in S.
- for() loops more efficient in R.

Graphics differences:
- Log scale indicated in S with par(xaxt)==l, in R with par(xlog)==T.
- R has cex.main, col.lab, font.axis, etc.  Thus title(Hi, cex=4) fails.
- R has plotmath and Hershey vector fonts.
- R has palette(rainbow(10)) to define colors (both screen and printer).

Functions missing from R:
- unpaste, slice.index, colVars

Functions missing from S:
- strsplit, sub, gsub, chartr, formatC

Functions that work differently:
- system() has no input argument in R.
- substring(s,x) - X only works in S, but R has s - gsub(x,X,s).
- scan expects numbers by default in R.
- which(numeric) converts to logical in S, is an error in R.
- The NULL returned by if(F){...} is invisible in R, visible in S.
- The NULL returned by return() is visible in R, invisible in S.
- Args to var differ, and R has cov.  S na.method=a ~ R use=p.
- var (or cov) drops dimensions in S, not R.
- cut allows labels=F in R, not in S (also left.include=T becomes right=F).
- Last argument of a replacement function must be named value in R.
- tapply(1:3, c(a,b,a), sum) is a 1D-array in R, a vector in S.

-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] Pretty onscreen plots?

2003-02-19 Thread David Brahm
Seth Falcon [EMAIL PROTECTED] wrote:
 I'm looking for ideas for creating high-quality plots for use in projected
 presentations (powerpoint, etc) --- ideally high-quality png, jpg, bmp.

I recently struggled with the problem of generating plots from R on Unix that
could be used in PowerPoint on Windows.  I learned that png format works
reasonably well, but the default resolution from png() was inadequate.  I ended
up using:

  bitmap(myfile.png, type=png16m, height=8.5, width=11, res=300)

and you might try even higher resolutions (res=600).
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



Re: [R] download CRAN packages and proxy config.

2003-02-18 Thread David Brahm
Joao Pedro W. de Azevedo [EMAIL PROTECTED] wrote:
 install.packages(quantreg)
 To my surprise this command did not work...
 Error in download.file(url = paste(contriburl, PACKAGES, sep = /)...

It took me years to figure out how to get through our firewall, from my
Solaris 2.6 machine (now) running R-1.6.2.  There were 3 crucial steps:

1) In my .Rprofile:  options(download.file.method=wget)
   (The default method internal does not seem to work for me.)

2) In my .cshrc: setenv http_proxy some.proxy.server:8000

3) some.proxy.server is NOT the name I find in my web browser!  The web
   browser knows the machine that serves Proxy Auto-Configuration files, but
   I needed to get the name of an actual proxy server from our local guru.

Hope that helps!
-- 
  -- David Brahm ([EMAIL PROTECTED])

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help