Hi,
I recently encountered an error using the command "savePlot" when trying to
save the third of 3 open graph windows. After successfully saving and
closing the first two windows I receive an "Invalid device number in
savePlot" error. The following is copied and pasted from an example session
to
In this simple case you can just coerce directly to a vector like so:
> foo <- by(dat, dat$GROUP, function(x) {weighted.mean(x$VALUE,
x$FREQUENCY)})
> bar <- as.vector(foo)
but look at the examples for ?by; in particular the use of 'sapply'.
Norm
-Original Message-
From: Dan Bolser [mai
The dashed line can be added to the plot with a call to "lines" after
removing the NAs from your x/y vectors (I'm assuming 'missing' means NA).
> plot(x,y,type='l')
> lines(x[!is.na(y)],y[!is.na(y)],lty=2)
Vertical lines can be accomplished with "segments".
norm
-Original Message-
From:
Look at ?assign, one possible answer is shown in the examples. Modified for
your example:
for (i in 1:nrow(a)) {
nam <- paste("r",i, sep=".")
assign(nam, a[i,])
}
would give you four separate objects r.1 to r.4 containing the 4 vectors.
Not sure if that's exactly what you wanted
Muhammad,
Here's one option:
barplot(1:5,col=gray(seq(0,1,length=5)))
Norm Olsen
Fisheries and Oceans Canada
-Original Message-
From: [EMAIL PROTECTED]
To: R-help@stat.math.ethz.ch
Sent: 5/13/2005 11:40 AM
Subject: [R] How to convert color to black & white
Dear all,
Could someone please
Hi,
The recent thread on how to send mail from R got me thinking about a
solution to clearing the rgui console under WinXP (something I've often
wanted to do and I've seen others ask about). If you create a small vb
script, say called "RClear.vbs":
Dim wsh
Set wsh = CreateObject("WScript.Shell")
This seems to work but it's a bit ugly with the loop (I'm sure you could
replace the loop with "apply").
asc2mat <- function(fname) {
x <- sapply(scan(fname, "character", sep="\n"), strsplit, "")
rlen <- sapply(x, length)
res <- matrix(nrow=length(bar), ncol=max(rlen))
for (i in 1:nrow(
At the risk of beating this to death ... if you use Outlook mail on Windows,
you can create a simple 'sendmail' vbscript:
' start ===
Dim pOutlook, pMail, fso, f
Set pOutlook = CreateObject("Outlook.Application")
Set pMail = pOutlook.CreateItem(olMailItem)
Set fso = CreateObject("Scripting.F
One way is to define your own function to use as the "error" option value.
E.g.
my.error.fun <- function() {
cat(geterrmessage(), file="rerr.txt", append=T)
}
then,
options("error"=my.error.fun)
Norm
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of C
use quiet=T
help("scan")
norm
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hua Li
Sent: Thursday, April 28, 2005 12:32 PM
To: r-help@stat.math.ethz.ch
Subject: [R] environment variables
In R, is there any way that I can let R not printing out the "
10 matches
Mail list logo