Re: [R] topical guide to R packages

2005-07-16 Thread Duncan Murdoch
s for seasonal time > series > > I would like to see lists corresponding to other > categories of IMSL. Another classification system is > GAMS at http://gams.nist.gov/Classes.plain . Section > L, "Statistics, probability", would be relevant. I don't see a Task Vie

Re: [R] Is it possible to coerce R to continue proceeding the next command in a loop after an error message ?

2005-07-16 Thread Duncan Murdoch
lt;- try( some calculation ) if (inherits(value, "try-error")) handle the error else handle a correct calculation Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

Re: [R] R: stats

2005-07-19 Thread Duncan Murdoch
nts however can be obtained fairly easily. R can calculate the incomplete gamma function (see ?pgamma), so that's not necessarily a stumbling block. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] .gct file

2005-07-19 Thread Duncan Murdoch
How do you suggest reading in this file?? > .gct is not a standard filename extension. You need to know what is in that file. Where did you get it? What program created it? Chances are the easiest thing to do is to get the program that created it to export in a we

Re: [R] .gct file

2005-07-19 Thread Duncan Murdoch
t; the 3rd line in this gct file. I would just delete them, but I do not > know how to open a gct. file Use skip=2. See ?read.table. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

Re: [R] Taking the derivative of a quadratic B-spline

2005-07-19 Thread Duncan Murdoch
en the derivative 2ax + b, has 2a = f(1) - f(0) + f(-1), and b = (f(1) - f(-1))/2. You should be able to generalize this to the case where the spline is quadratic between knots k1 and k2 pretty easily. Duncan Murdoch __ R-help@stat.math.ethz.ch m

Re: [R] Taking the derivative of a quadratic B-spline

2005-07-19 Thread Duncan Murdoch
he derivatives. I don't know COBS, but doesn't predict just evaluate the B-spline? The point of what I posted is that the particular basis doesn't matter if you can evaluate the quadratic at 3 points. Duncan Murdoch > > Jim McDermott > > On 7/19/05, Duncan Murdoch

Re: [R] Taking the derivative of a quadratic B-spline

2005-07-20 Thread Duncan Murdoch
reporting all of the knots correctly. Watch out for coincident knots (zero length intervals); you don't care about the derivative on those, but they might cause overflows in some calculations. Duncan Murdoch > > Jim > > On 7/19/05, Duncan Murdoch <[EMAIL PROTECTED]> wr

Re: [R] R function to kill a process

2005-07-20 Thread Duncan Murdoch
s complicated, and I think the procedure is quite different in Unix and Windows. You want to give the process a chance at a clean shutdown if possible. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-

Re: [R] Prefix for colnames

2005-07-20 Thread Duncan Murdoch
test PREFIX.test [1,] NA NA NA NA [2,] NA NA NA NA [3,] NA NA NA NA Duncan Murdoch __ 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

Re: [R] is.Date ?!!!

2005-07-20 Thread Duncan Murdoch
On 7/20/2005 10:41 AM, Omar Lakkis wrote: > Is there a way to test if a variable is a date? Yes, but there are several different things people might call dates. Which do you mean? For example, > today <- Sys.Date() > today [1] "2005-07-20" > inherits(today, "D

Re: [R] Issues with convolve

2005-07-20 Thread Duncan Murdoch
er function to work in log probabilities instead of probabilities, so that you can handle a larger dynamic range before you run into underflow problems, and you don't need to use convolve at all. Convert them back to probabilities at the very end. Duncan Murdoch _

Re: [R] The steps of building library in R 2.1.1

2005-07-21 Thread Duncan Murdoch
gt; the net (google for 'making creating R package') since I would > guess that just about everyone has significant problems in creating > their first package on Windows. As far as I can tell, those all predate the release of 2.1.0. I think your complaints are out of date.

Re: [R] The steps of building library in R 2.1.1

2005-07-21 Thread Duncan Murdoch
lease? Another thing you could do which would be valuable: get a student or someone else who is reasonably computer literate, but unfamiliar with R details, to do this while you sit watching and recording their mistakes. Duncan Murdoch __ 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

Re: [R] The steps of building library in R 2.1.1

2005-07-21 Thread Duncan Murdoch
ciding where it fits and what to replace, 2. correcting the errors, 3. writing it in texinfo format. I'd be happy to talk with someone who volunteers to do that. (I'd suggest the volunteer should do number 1 first, so as not to waste a lot of time on versions that don't fit.)

Re: [R] problems with submitting an eps-file created in R

2005-07-22 Thread Duncan Murdoch
der directly. It also suggests paper="special", and horizontal=FALSE. If that doesn't work, you'll have to ask whoever wrote the quality checking program what they're looking for. Duncan Murdoch > > Neither approach brought the favoured result. The error message I g

Re: [R] The steps of building library in R 2.1.1

2005-07-23 Thread Duncan Murdoch
bits that are missing from the R-Admin manual (and perhaps supply them)? It won't get better unless someone improves it. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

Re: [R] problem building R packages in windows xp

2005-07-24 Thread Duncan Murdoch
ules’. In this case the Help Workshop will not be needed." You can also do it on a case-by-case basis, as Uwe says, but I think editing MkRules makes more sense if you don't want to install HHC. Uwe's option is documented in ?INSTALL. Duncan Murdoch > [EMAIL PROTECTED]:~/src

Re: [R] The steps of building library in R 2.1.1

2005-07-24 Thread Duncan Murdoch
J. Hosking wrote: > Duncan Murdoch wrote: > > >>Could you point out the specific bits that are missing from the R-Admin >>manual (and perhaps supply them)? It won't get better unless someone >>improves it. > > > R-admin is fine. The problem is

Re: [R] Fortran function name not in load table

2005-07-24 Thread Duncan Murdoch
7;ll get this error. You might want to look at this page http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/index.html#badname or this one http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/fortran.html for more help. Duncan Murdoch __

Re: [R] how to write a periodic function in R?

2005-07-25 Thread Duncan Murdoch
) %% 4 - 2 The %% is the mod operator, so (x + 2) %% 4 adds 2 then maps all values into the range 0 to 4. You'll need a different formula for a different periodic function. Use plot(f, from=-7, to=7) to see that this works. Duncan Murdoch __ R-he

Re: [R] draw ellipse of equal concentration

2005-07-26 Thread Duncan Murdoch
variance matrix. The ellipse package can draw ellipses. Duncan Murdoch __ 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

Re: [R] / Right division.

2005-07-26 Thread Duncan Murdoch
's solve(t(Y), x). If x is stored as a 1xn matrix, you'd use t(solve(t(Y), t(x)). If you're trying to do multiple operations at once, you probably need to use the second form. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing lis

Re: [R] Help: how to specify the current active window by mouse

2005-07-28 Thread Duncan Murdoch
o it. The logic is that being active means being the target of plot output, and essentially all plot output comes from executed commands, not from mouse clicks. Since you're executing commands already, why not put in one more? Duncan Murdoch

Re: [R] Console not found

2005-07-29 Thread Duncan Murdoch
ere are command line options to tell it to skip these; in particular, --vanilla tells it to skip all of them. I'd guess your problem is with Rconsole, because that's where the console settings are normally saved. Rename it to something else and your problems should go away. Duncan Murdo

Re: [R] Way to make R idle for some time and try something again later

2005-07-29 Thread Duncan Murdoch
he best way to do this in R? Sys.sleep(10) should give you a 10 second pause with very little impact on the system. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http:

Re: [R] Way to make R idle for some time and try something again later

2005-07-29 Thread Duncan Murdoch
ecific. In Windows, CPU usage measures in at 0% while in a Sys.sleep loop. (It's not really zero, because R checks for events to update the display, but it's very low). Duncan Murdoch > > If I use instead > system('sleep N') > cpu usage does not go up. >

Re: [R] Rgdal windows binary warning message

2005-08-02 Thread Duncan Murdoch
iler, but with others it is sufficient to ask R to set the FPU control word. Instructions are here: <http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/index.html#fpu> Duncan Murdoch > > On Tue, 2 Aug 2005, Tony Gill wrote: > > >>Hi all, >> >>I just

Re: [R] optim

2005-08-04 Thread Duncan Murdoch
it will actually improve efficiency: that depends on whether optim evaluates the gradient and function values at the same points or at different points. You would use this as follows, assuming your function is called f: f2 <- splitfn(f) optim(par, f2$fn, f2$gr, ...) Duncan Murdoch ___

Re: [R] Modifying the parameters for a function

2005-08-04 Thread Duncan Murdoch
rror when you did your edits. The line number information is fairly useless: R has concatenated all of the files together, you don't see the original line number. Your best strategy is to look at where you made changes. I'm hoping to improve the error reporting on parse errors

Re: [R] Help: how to stop the process when there is a mishandling

2005-08-04 Thread Duncan Murdoch
or here if it's base code. Be sure to give enough details that others can see things freeze. And if it really is frozen, you can use Ctrl-Alt-Del to open the Windows Task Manager, select the Rgui application, and "End task". Assuming you have permission, etc. Duncan Murdoch &g

Re: [R] Help: how to hide the buttons of a new opening device

2005-08-04 Thread Duncan Murdoch
r > "graphics.off()". There are no exposed functions to do that. You're going to have to look at the R source code, and add something. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/

Re: [R] Help: how to stop the process when there is a mishandling

2005-08-04 Thread Duncan Murdoch
. > > spencer graves Yes, I was talking about Rgui.exe. ESC doesn't stop Rterm.exe, which is what XEmacs is running. Duncan Murdoch > > Duncan Murdoch wrote: > >> On 8/4/2005 11:39 AM, Shengzhe Wu wrote: >> >>>and how about R on win

Re: [R] An small suggestion for the R team

2005-08-04 Thread Duncan Murdoch
t very common. Or... > > How to differentiating myValue: > > varOne = 100 > varTwo = 50 > myValue = varOne-varTwo > > from codes-deprecated, or ns-alt, for example. ...you could do it by context. codes-deprecated will only show up in *.Rd files as a possible search t

Re: [R] Problem configuring R-patched

2005-08-04 Thread Duncan Murdoch
ive that error. > > >>A solution - again given by the error message you quote! - is: >> >>./configure --enable-R-shlib --without-recommended-packages >> ^ >> >>That should clear things up. > >

Re: [R] How to set the floating point precision beyond e-22?

2005-08-05 Thread Duncan Murdoch
sv: system is exactly > singular You will have to find a different solution to the problem. To machine precision, that matrix looks singular. This usually indicates that it's not the right matrix to try to invert. Duncan Murdoch __ 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

Re: [R] How to set the floating point precision beyond e-22?

2005-08-05 Thread Duncan Murdoch
Peter Dalgaard wrote: > Duncan Murdoch <[EMAIL PROTECTED]> writes: > > >>You will have to find a different solution to the problem. To machine >>precision, that matrix looks singular. This usually indicates that it's >>not the right matrix to try to

Re: [R] Computing sums of the columns of an array

2005-08-05 Thread Duncan Murdoch
any complicated steps in my computation. > > Is there a faster way? You'd probably do better with matrix multiplication: rep(1, nrow(A)) %*% A Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Computing sums of the columns of an array

2005-08-05 Thread Duncan Murdoch
On 8/5/2005 12:43 PM, Uwe Ligges wrote: > Duncan Murdoch wrote: > >> On 8/5/2005 12:16 PM, Martin C. Martin wrote: >> >>>Hi, >>> >>>I have a 5x731 array A, and I want to compute the sums of the columns. >>>Currently I do: >>> >&

Re: [R] Latex error with Sweave example

2005-08-05 Thread Duncan Murdoch
uff yet. My web page http://www.murdoch-sutherland.com/Rtools/miktex.html is getting kind of old, but it does tell you how to avoid using e-TeX. Duncan Murdoch > > This is e-TeX, Version 3.141592-2.2 (MiKTeX 2.4) (preloaded format=latex > 2005.8.5) 6 AUG 2005 09:28 > entering e

Re: [R] problems with function-formating, please help

2005-08-06 Thread Duncan Murdoch
9.305764753298 * x1 * x3, where those coefficients come from some other calculation, just do it like this: makefn <- function(coeffs) { function(x1, x2, x3) coeffs[1] + coeffs[2]*x1 + coeffs[3]*x2 + coeffs[4]*x1*x3 } Then use it like this: f

Re: [R] signal handling

2005-08-11 Thread Duncan Murdoch
ction lets a function do cleanup, and there are various hooks available (see ?setHook), and finalizers (see ?reg.finalizer) for some kinds of objects. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] R-devel and bad magic number

2005-08-12 Thread Duncan Murdoch
/Desktop/Downloads/biomaRt/R/biomaRt.R') > > Error: bad restore file magic number (file may be corrupted) -- no data > loaded load() is for binary workspaces. Use source() to read source code. Duncan Murdoch __ R-help@stat.math.ethz.ch ma

Re: [R] scratch a figure

2005-08-15 Thread Duncan Murdoch
e the window; a new one will be created the next time you draw something. Duncan Murdoch __ 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

Re: [R] apologies if you aready received this ?

2006-06-08 Thread Duncan Murdoch
wait<-function() > { > cat("press return to continue") > unix("read stuff") > } You can also use par(ask=TRUE) to get R to pause the script whenever it is about to erase the graphics window. Duncan Murdoch > > and this worked nicely because I then > did

Re: [R] Using data=x or subset=y in user-defined functions

2006-06-08 Thread Duncan Murdoch
function(expr, data) { + x <- eval(substitute(expr), envir=data) + return(mean(x)) + } > eg.function(a, data.test) [1] 5.5 The "substitute" says to give back the unevaluated expression used for the argument. Duncan Murdoch > > Manuel > >> Thanks! Just to be sur

Re: [R] Formatting numbers for printing

2006-06-08 Thread Duncan Murdoch
> accomplish this. > I think you need to do the separation into two parts as you did (or using %/%), but it can all be one sprintf: sprintf("%03d-%03d", Number %/% 1000, Number %% 1000) Duncan Murdoch __ R-help@stat.math.ethz

Re: [R] Re-binning histogram data

2006-06-09 Thread Duncan Murdoch
f > world would that be?! :-) Now, if you were to suggest that the stem() function is a bizarre simulation of a stone-age tool on a modern computer, I might agree. Duncan Murdoch > > -- Bert Gunter > > > >> -Original Message- >> From: [EMAIL PROTEC

Re: [R] sqlSave() and rownames=TRUE makes my Rgui crash

2006-06-09 Thread Duncan Murdoch
on win2K, MySQL version 5.0.21-community-nt I don't know why you're using DBI; perhaps it interferes with RODBC somehow. If that's not it, then you might want to try lower level methods than sqlSave: perhaps use sqlQuery to send an INSERT command to the database. Build up from

Re: [R] sqlSave() and rownames=TRUE makes my Rgui crash

2006-06-09 Thread Duncan Murdoch
uot;('", id, "','", col1, "','", col2, "')", sep="", collapse=",") query <- paste("INSERT INTO example(id, col1, col2) VALUES", inserts) sqlQuery(chan, query) (This isn't even tested to see if I got

Re: [R] NA values

2006-06-12 Thread Duncan Murdoch
of vectors, so you could iterate through the list, using one of the apply functions (or even a for loop): apply(x, 2, function(col) {col[is.na(col)] <- 1000; col} ) which is essentially a short form for for (i in 1:ncol(x)) { col <- x[,i] col[is.na(col)] <- 1000 x[,i] <- c

Re: [R] Saving R graphics with version 2.3.1

2006-06-15 Thread Duncan Murdoch
ave it as PNG, for instance. > You can type the extension when you save it, if you're typing the filename. The default names generally include the extension. > Previous R versions work without problems. > Could you give a detailed description to reproduce the problem? Duncan Murd

Re: [R] Standard Deviation Distribution

2006-06-18 Thread Duncan Murdoch
ction(s,n) { > sig2 <- n*s*s/(n-1) > 2*(n/(2*sig2))^((n-1)/2) / gamma((n-1)/2) * exp(-n*s*s/(2*sig2)) * s^(n-2) > } > > Your initial factor looks a lot different from theirs. I think you believed your variable name (i.e. sig2 is sigma^2), but didn't define it that

Re: [R] can I call user-created functions without source() ?

2006-06-19 Thread Duncan Murdoch
the beginning. You can also use a file named .Rprofile to contain commands to run; it is searched for in the current directory, then the user's home directory. So you could put your source("blahblah.R") into .Rprofile if you want these functions to always be available. Duncan

Re: [R] can I call user-created functions without source() ?

2006-06-19 Thread Duncan Murdoch
; I have put these in my ".Rprofile". But this is loaded from > my home directory, not from the directory where I was when I > started R, so it is the same every time. Which version of R are you using? This is not the current documented behaviour. It looks in the current directory

Re: [R] can I call user-created functions without source() ?

2006-06-19 Thread Duncan Murdoch
t; for (i in fl) {cat(paste('source("',i,'")\n',sep="")); source(i)} > rm(i,fl) > > in this way you at least don't need a separate `.Rprofile' in each > project dir. Another alternative if you want something special in the project is

Re: [R] can I call user-created functions without source() ?

2006-06-19 Thread Duncan Murdoch
On 6/19/2006 10:19 AM, Joerg van den Hoff wrote: > Duncan Murdoch wrote: >> Just a few comments below on alternative ways to do the same things: >> >> On 6/19/2006 8:19 AM, Joerg van den Hoff wrote: >> >>> for short term usage of some specialized functions

Re: [R] can I call user-created functions without source() ?

2006-06-19 Thread Duncan Murdoch
ons that you don't use every day, or when using functions written by someone else. Duncan Murdoch > > I find that procedure simpler than learning the package mechanism. It > is easy to add new functions periodically. > > Not long ago, I posted the R code I used to automa

Re: [R] Function hints

2006-06-19 Thread Duncan Murdoch
Search("keyword", restrict="functions") (or even without the "restrict" part). Duncan Murdoch __ 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

Re: [R] multi-dimension array of raw

2006-06-20 Thread Duncan Murdoch
ou to fix this. It needs to be done in the internals of R (function ArrayAssign, in src/main/subassign.c, if you're interested). I'll try to take a look and see if it looks reasonable to add. Duncan Murdoch __ 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

Re: [R] multi-dimension array of raw

2006-06-20 Thread Duncan Murdoch
>> b <- array(as.raw(1:6),c(1,2,3)) >> b[1,,] > [,1] [,2] [,3] > [1,] 01 03 05 > [2,] 02 04 06 >> b[1,1,] <- raw(3) > Error: incompatible types (from raw to raw) in array subset assignment > > I can work around this with computed i

[R] rank(x,y)?

2006-06-21 Thread Duncan Murdoch
input. Is there a simple way to get what I want? E.g. > x <- c(1,2,3,4,1,2,3,4) > y <- c(1,2,3,1,2,3,1,2) > rank(x+y/10) [1] 1 3 6 7 2 4 5 8 gives me the answer I want, but only because I know the range of y and the size of gaps in the x values. What do I do in

Re: [R] rank(x,y)?

2006-06-21 Thread Duncan Murdoch
Peter Dalgaard wrote: > Duncan Murdoch <[EMAIL PROTECTED]> writes: > > >> Suppose I have two columns, x,y. I can use order(x,y) to calculate a >> permutation that puts them into increasing order of x, >> with ties broken by y. >> >> I'd lik

Re: [R] Basic package structure question

2006-06-22 Thread Duncan Murdoch
missed that > explains this, I would be grateful. > I think the "organized in a certain way" part is actually important. Using R CMD install --build is the documented way to achieve this. It's not trivial to do this on Windows, because you need to set up a build env

Re: [R] rank(x,y)?

2006-06-22 Thread Duncan Murdoch
Gabor Grothendieck wrote: > On 6/21/06, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > >> Peter Dalgaard wrote: >> >>> Duncan Murdoch <[EMAIL PROTECTED]> writes: >>> >>> >>> >>>> Suppose I have two columns,

Re: [R] Basic package structure question

2006-06-23 Thread Duncan Murdoch
neccessarily, I know) to > Sun/Solaris). so the strategy is not restricted to transfer from Linux > -> Windows. > > and it is useful (if it is not 'accidental' that it works at all): in > this way one can keep very easily in sync several local incarnations of

Re: [R] Patch for rgl with gcc 4.0 in R 2.3.0 on OS X

2006-06-26 Thread Duncan Murdoch
. Duncan Murdoch On 6/26/2006 9:08 AM, Balaji S. Srinivasan wrote: > Hi, > > I recently had a problem installing the rgl package on OS X and put together > a simple patch. The patched package is available here: > > http://jinome.stanford.edu/files/rgl_0.66-patched_for_gcc4.tar

Re: [R] Puzzled with contour()

2006-06-26 Thread Duncan Murdoch
ient to do something like this: zmat <- matrix(NA, 3, 19) zmat[cbind(20*x + 1, y/10 - 1)] <- z x <- (0:2)/20 y <- (2:20)*10 contour(x,y,zmat) Duncan Murdoch > > x y z > [1,] 0.00 20 1.000 > [2,] 0.00 30 1.000 > [3,] 0.00 40 1.0

Re: [R] Puzzled with contour()

2006-06-26 Thread Duncan Murdoch
On 6/26/2006 10:39 AM, Gabor Grothendieck wrote: > I think it would be helpful if this were added to the contour help file. You mean an example of building up the z matrix from points, or just a general discussion of the issue? Duncan Murdoch > > On 6/26/06, Duncan Murdoch <[EMA

Re: [R] Problem running one of the rgl demo scripts...

2006-06-26 Thread Duncan Murdoch
If it dies the same way, you could perhaps try to diagnose what is going wrong and send a patch if it's an rgl bug. Given the age of your video driver (9/20/2000), you might be able to update it and fix a bug there. Duncan Murdoch __ R-help@st

Re: [R] questions on local customized R distribution CD

2006-06-26 Thread Duncan Murdoch
> If the customized distribution CD is OK, I also hope to get some technical > help/advice from the core group members if any one is interested. See the R Installation and Administration manual first. It tells how to build R installers with non-standard included packages. Hopefully f

Re: [R] questions on local customized R distribution CD

2006-06-27 Thread Duncan Murdoch
On 6/27/2006 8:05 AM, Liaw, Andy wrote: > > From: Duncan Murdoch >> >> On 6/26/2006 3:14 PM, Dongseok Choi wrote: >> > Hello all! >> > >> > I hope this is the right place to post this question. >> > >> > The Oregon Chapter

Re: [R] Puzzled with contour()

2006-06-27 Thread Duncan Murdoch
implementations, so there isn't much motivation to spend several hours doing the necessary work. But if you want to contribute this, please do. Be careful about where you get the code: the interp implementation in akima is not licensed freely enough to be included in R ("

Re: [R] RMySQL...Can't initialize driver???

2006-06-27 Thread Duncan Murdoch
d DBI, presumably because one is newer than the other. I have always found it easier to use RODBC. Because it uses the more general ODBC interface, it may be slower than a package that is tuned to a particular database, but it works, which is a substantial advantage. Duncan Murdoch

Re: [R] Possible to get a definition of a function from a package to use without invoking the package?

2006-06-27 Thread Duncan Murdoch
ovides different results in some cases, e.g. > -5 %% 2 [1] 1 > mod(-5, 2) [1] -1 so be careful about your definitions. I don't know a simple substitute for instring(). Duncan Murdoch I'm pretty sure that mod() and > instring() are very basic and don't have any exoti

Re: [R] read file with readBin (the file was saved with a C-routine)

2006-06-28 Thread Duncan Murdoch
ize=4 ) > Xmin <- readBin( con, numeric(), n=1, size=4 ) > Ymin <- readBin( con, numeric(), n=1, size=4 ) > > I think there is a problem if I read the character. Have you any ideas ??? > > Thanks for help. > Jörn Schulz. I would also worry about the alignment of the

Re: [R] y-axis label location relative to tick label width?

2006-06-28 Thread Duncan Murdoch
to draw them yourself. That is, draw the plot with axes=FALSE, then draw the axes using the axis() function, using pretty() to calculate the tick locations. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] numerical integration problem

2006-06-29 Thread Duncan Murdoch
is >> what the "integrate" description refers to)? >> > > Just put a "for"-loop in your function to iterate over t. Or use Vectorize(). vlambdat <- Vectorize(lambdat) should give a function that can be passed to integrate(), assuming that lambdat wor

Re: [R] Way to convert data frame to matrix

2006-06-30 Thread Duncan Murdoch
rame" attribute. This means you can extract the columns as if they were just lists. So if your columns are named A, B, and C, and the dataframe is dataf, you get them as vectors using dataf$A, dataf$B, and dataf$C Duncan Murdoch __ R-help@stat.

Re: [R] macro facility in R

2006-07-03 Thread Duncan Murdoch
sed substitute twice: the inner call gets the unevaluated expression that was passed as "dependent"; the outer one puts that in place of the "dep" variable. Duncan Murdoch __ 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

Re: [R] IMPORTING FILE FROM EXCEL

2006-07-04 Thread Duncan Murdoch
backslashes ("\") as escape characters. It's easier just to use forward slashes, i.e. c:/Documents..., and easiest of all is to use the function file.choose() which pops up a file selection dialog. Duncan Murdoch > Warning message: > file.show(): file 'C:Documents and Settin

Re: [R] auto load package splines

2006-07-05 Thread Duncan Murdoch
above); you're probably better off working with .Rprofile. Duncan Murdoch __ 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

Re: [R] Comparing two matrices

2006-07-06 Thread Duncan Murdoch
> pmin(table(tb)) V2 V1 A M O S Apple 1 0 1 1 Mango 1 1 0 1 Orange 1 0 1 1 > pmin(table(tb[,2:1])) V1 V2 Apple Mango Orange A 1 1 1 M 0 1 0 O 1 0 1 S 1 1 1 Duncan Murdoch > > >

Re: [R] package download numbers

2006-07-06 Thread Duncan Murdoch
see how the author would like to be cited, or a default format if the author hasn't specified. Duncan Murdoch __ 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

Re: [R] Summary Statistics for data.frame

2006-07-08 Thread Duncan Murdoch
On 7/8/2006 3:44 PM, justin rapp wrote: > I apologize for my constant questions but I am new to R and trying to > gain an appreciation for its capabilities. The following task is easy > in Excel and I was hoping somebody could give me a quick explanation > for how it can be acheived in R so I can

Re: [R] Summary Statistics for data.frame

2006-07-08 Thread Duncan Murdoch
ad of var(x). Whether that makes sense depends on the context of your problem. Duncan Murdoch > > When I use: > by(data.logistic,data.logistic$Ydrafted,summary) > > I receive no errors. I cut and pasted your mysummary function directly > into my r console. Should I have made

Re: [R] Hunting for snow...

2006-07-09 Thread Duncan Murdoch
sults. For example, in the case of FracSim, the error occurred when trying to run the fracsim.1d example. Apparently the example gave no finite values so plot() couldn't set up a coordinate system. (You can see this if you click on the "ERROR" link in the summary.) Since t

Re: [R] string problems with "\\" (Windows)

2006-07-09 Thread Duncan Murdoch
basename() works. If you're on a system that doesn't think \\ is a path separator, you could do something like x <- "C:\\Documents and Settings\\myName\\My Documents\\RProjects\\Project1\\file.name.csv" basename(gsub('\\\\','/',x)) Duncan Murdoch

Re: [R] 10^x instead 10EX on plot axes. How?

2006-07-10 Thread Duncan Murdoch
1000) > plot(vec,vec,log="xy", axes=F) > axis(1, at=10^c(0,2,4,6), labels=expression(1, 10^2, 10^4, 10^6)) > axis(2, at=10^c(0,2,4,6), labels=expression(1, 10^2, 10^4, 10^6)) > box() Duncan Murdoch __ R-help@stat.math.ethz.ch

Re: [R] Source code for R graphics devices

2006-07-10 Thread Duncan Murdoch
ot;. > > I can't seem to find it! > > So where should I be looking? The devices are in the grDevices package. Look in the src directory there for the C code. XFig is in the devPS.c file. Duncan Murdoch > > Also -- a more general question on this topic -- presumably &g

Re: [R] file.choose but for folder/directory?

2006-07-10 Thread Duncan Murdoch
On 7/10/2006 8:51 PM, Randy Zelick wrote: > Hello there, > > This question is relative to WindowsXP, using R 2.2.1: Time to upgrade. choose.dir (mentioned by Rich) was introduced in the next release. Duncan Murdoch > > I am looking for a function that allows a user to interac

Re: [R] --no-save and --save toggle from inside R? + BATCH stderr

2006-07-10 Thread Duncan Murdoch
The same question applies to "--no-restore-data", > although this presumably would have to be decided in a .First() > function or something like it. > This one can't currently be changed. Duncan Murdoch > on a similar note, I would love a CMD BATCH invokation to output jus

Re: [R] --no-save and --save toggle from inside R? + BATCH stderr

2006-07-11 Thread Duncan Murdoch
This looks to me like a good suggestion, but I generally don't make modifications to platform-specific things on platforms I don't use, so I'd suggest posting this to R-devel or on the bug list as a wishlist item. Otherwise it might get lost. Duncan Murdoch _

Re: [R] use of NULL environment is deprecated?

2006-07-11 Thread Duncan Murdoch
gs into errors, so traceback will work. A common situation where I've seen that error is with binary saves from earlier versions of R being loaded into current versions. For example, if you installed a package before, but didn't re-install it with 2.3.1, or if you are reloading a works

Re: [R] use of NULL environment is deprecated?

2006-07-11 Thread Duncan Murdoch
On 7/11/2006 6:59 PM, Patrick Connolly wrote: > On Tue, 11-Jul-2006 at 06:41PM -0400, Duncan Murdoch wrote: > > [] > > |> > |> options(warn=2) will convert warnings into errors, so traceback will work. > |> > |> A common situation where I've

Re: [R] R-help in a newsgroup

2006-07-18 Thread Duncan Murdoch
hat. If you prefer the newsgroup interface, you should also look at gmane. Gabor G posted a list of the newsgroups here: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/75239.html recently. Duncan Murdoch > > Best, Darren > > __ > R

Re: [R] voronoi tessellations

2006-07-19 Thread Duncan Murdoch
way: library(tripack) y <- runif(100) x <- runif(100) vm <- voronoi.mosaic(x,y) plot(vm) points(x,y,col='blue') and if you want the axes, axis(1) axis(2) box() Duncan Murdoch > plot(x,y,col='blue') > > when you look at the plot of the mosaic overlayed with the raw d

Re: [R] Correspondence analysis with R

2006-07-20 Thread Duncan Murdoch
> profiles, how do i put them in a single figure with labels identifying each > one of them? > This thing is getting me almost crazy... See the corresp() function in MASS and the cca() function in vegan. Both of these can produce biplots. Duncan Murdoch

Re: [R] Using corStruct in nlme

2006-07-20 Thread Duncan Murdoch
mistaken. > > I am running R 2.3.1 and have recently updated all packages. I reproduced this once in R-patched, but since then have been unable to do so. I can reproduce it reliably with "set.seed(1)" at the start in R 2.3.1. So it looks to me as though we've pro

Re: [R] How do I modify an exported function in a locked environment?

2006-07-20 Thread Duncan Murdoch
n function that calls the one in zoo and modifies the result. I don't think you should modify zoo without really careful thought: you should assume that the package has been tested the way it was written, and may give incorrect results if you go in and change one function without considering

<    1   2   3   4   5   6   7   8   9   10   >