Re: [R] starting html help for a package?

2009-11-13 Thread Duncan Murdoch
Liviu Andronic wrote: On 11/12/09, Duncan Murdoch murd...@stats.uwo.ca wrote: help(package=boot, help_type = html) The page displayed there was never an HTML page. In the future it probably should be, but it hasn't been implemented yet. At the moment is there a way to call

Re: [R] how to pass matrices from C to R effectively

2009-11-13 Thread Duncan Murdoch
pointer and generate the required matrix along the length of the array? If this is not what you meant, would you please give me a small example? Yes, that is what I meant. Duncan Murdoch Jeff On Thu, November 12, 2009 6:53 pm, Duncan Murdoch wrote: On 12/11/2009 6:45 PM, Hao Cen

Re: [R] Splus

2009-11-13 Thread Duncan Murdoch
, or use their mailing list. Duncan Murdoch __ R-help@r-project.org 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-contained

Re: [R] Simple if else statement problem

2009-11-13 Thread Duncan Murdoch
it, and not accept the following else. So putting braces around the whole thing is another workaround, but putting the else on the same line as the first closing brace is probably better. Duncan Murdoch anna_l wrote: Hello, I am getting an error with the following code: if( P2 P1) + { + P-P2

Re: [R] random numbers in C

2009-11-13 Thread Duncan Murdoch
(or misunderstand). At a minimum, you forgot to call GetRNGState and PutRNGState. See Writing R Extensions for details. But if you are running this from outside of R, you'll also need to read about building a standalone Mathlib. Duncan Murdoch

Re: [R] update.lm question

2009-11-15 Thread Duncan Murdoch
(linModel, bquote(. ~ . - .(as.name(termName removeTerm - function(linModel, termName) update(linModel, substitute(. ~ . - x, list(x=as.name(termName Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] update.lm question

2009-11-15 Thread Duncan Murdoch
On 15/11/2009 11:28 AM, Duncan Murdoch wrote: On 15/11/2009 9:23 AM, Karsten Weinert wrote: Hello, at the Rgui command line I can easily remove a term from a fitted lm object, like fit - lm(y~x1+x2+x3, data=myData) update(fit, .~.-x1) However, I would like to do this in a function with term

Re: [R] How to name a tag in a list or a data.frame from a string?

2009-11-15 Thread Duncan Murdoch
- list(1:3) names(x) - string y - data.frame(dummy=1:3) names(y) - string You can also build expressions and parse and evaluate them, but the lines above are the easiest way. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread Duncan Murdoch
give you what you want. Duncan Murdoch Consider the following foo - c(V_7_101110_V, V_7_101110_V, V_9_101110_V, V_9_101110_V, V_9_s101110_V, V_9_101110_V, V_9_101110_V, V_11_101110_V, V_11_101110_V, V_11_101110_V, V_11_101110_V, V_11_101110_V, V_17_101110_V, V_17_101110_V) what I'm

Re: [R] No Visible Binding for global variable

2009-11-16 Thread Duncan Murdoch
it gives a false alarm here. Right. And if you want to keep it quiet, something like Zobs - NULL # to satisfy codetools near the start of the function should work. Duncan Murdoch Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com result - list(pairs = c(row.names

Re: [R] Where are usages like == 2L documented?

2009-11-16 Thread Duncan Murdoch
, Constants. Duncan Murdoch Thanks, Bryan * Bryan Hanson Acting Chair Professor of Chemistry Biochemistry DePauw University, Greencastle IN USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Where are usages like == 2L documented?

2009-11-16 Thread Duncan Murdoch
know why not? This is part of the syntax of the language. It has nothing to do with the integer() function, which is what ?integer is asking about. Duncan Murdoch Best Steve McKinney -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org

Re: [R] Where are usages like == 2L documented?

2009-11-17 Thread Duncan Murdoch
the help system. One way to do this is to link the manuals into the help system, and I did some work on this last year, but unfortunately this requires a newer version of Texinfo than we are allowed to use because of FSF license restrictions. Duncan Murdoch On 16/11/2009 9:09 PM, Steven

Re: [R] Normal distribution test

2009-11-17 Thread Duncan Murdoch
alone isn't sufficient to let me calculate a probability of the null being true. Duncan Murdoch Thank you. Kevin Johannes Graumann johannes_graum...@web.de wrote: Markus Mehrwald wrote: Hi all, I am completely new to R and my knowledge of statistics is quite small so I hope you

Re: [R] Where are usages like == 2L documented?

2009-11-17 Thread Duncan Murdoch
On 16/11/2009 7:52 PM, Gabor Grothendieck wrote: On Mon, Nov 16, 2009 at 7:25 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 16/11/2009 6:47 PM, Steven McKinney wrote: ?NumericConstants will bring up a help page that mentions All other numeric constants start with a digit or period

Re: [R] source(,echo=T) doesn't echo final comments

2010-04-13 Thread Duncan Murdoch
, but I'll look into this, because as documented, they should be shown. (My preference would be to completely hide the \dontrun lines in example(), but that's not what is documented to happen, and that's not what happens when they are followed by code.) Duncan Murdoch Thank you, Alexandre Kuhn

Re: [R] R documentation

2010-04-13 Thread Duncan Murdoch
the configuration to connect with the html help? Use options(help_type=html). Duncan Murdoch __ R-help@r-project.org 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] Using object.size inside a function

2010-04-13 Thread Duncan Murdoch
]) } Duncan Murdoch __ R-help@r-project.org 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-contained, reproducible code.

Re: [R] - how/when/why do you use it?

2010-04-13 Thread Duncan Murdoch
will get 2, even though the first and last pairs of lines look very similar. It's generally confusing to mix - assignments to outer variables with - assignments to locals having the same name. Just use different names. Duncan Murdoch __ R-help@r

Re: [R] fitting a quadratic function - poly?

2010-04-14 Thread Duncan Murdoch
, a different parametrization. You can see the difference if you ask for model.matrix(fit1) and model.matrix(fit2). (You can plot these using matplot(model.matrix(fit1)), etc.) Duncan Murdoch Thanks in advance, Stefan __ R-help@r-project.org mailing list

Re: [R] curve

2010-04-15 Thread Duncan Murdoch
as the other variable, e.g. f - function(x, y) { x^2 + y^2 } curve(f(x, 2), from= ) curve(f(3, x), from= ) or wrap the function in a one variable function if you want to follow some complicated path, e.g. curve(function(t) f(t, t^2), from=) Duncan Murdoch

Re: [R] Problem with ONE of the Special German Characters

2010-04-15 Thread Duncan Murdoch
) You might want to try perl=TRUE in the gsub() call; it seems to handle strange characters in regular expressions better than the default TRE library does. Duncan Murdoch This letter is displayed as Ãoe (as before), but R is no longer able to find this character. The problem seems

Re: [R] error at R CMD check

2010-04-16 Thread Duncan Murdoch
with column names and row names. No description in DESCRIPTIOn file yet. data1.Rd shouldn't be a dataset, it should be a help file describing a dataset. In a more recent version of R you might get a more informative error message, telling you where the error was in that file. Duncan

Re: [R] Return a variable name

2010-04-16 Thread Duncan Murdoch
of a. Duncan Murdoch fun - function(x){ return(substitute(x)); } a - data.frame(b=1:10); fun(a$b) ... returns a$b, but this is a type language, thus I can't use it as a character string, can I? How? Thanks for help, Sören __ R-help@r

Re: [R] source(,echo=T) doesn't echo final comments

2010-04-18 Thread Duncan Murdoch
On 13/04/2010 8:50 AM, Duncan Murdoch wrote: On 12/04/2010 7:14 PM, Kuhn, Alexandre (NIH/NIA/IRP) [V] wrote: Hi, source(file,echo=T) will not echo the last comment in file if it is the last line in the file. For instance, when sourcing a file containing the following lines #comment 1 a-1

Re: [R] update of a function

2010-04-18 Thread Duncan Murdoch
On Sun, Apr 18, 2010 at 3:40 PM, carol white wht_...@yahoo.com wrote: text format only. You just copy those into the data subdirectory, assuming you're using one of the formats listed in the Data in packages section of Writing R Extensions, and have named it as described there. Duncan Murdoch

Re: [R] update of a function

2010-04-18 Thread Duncan Murdoch
On Sun, Apr 18, 2010 at 4:05 PM, carol white wht_...@yahoo.com wrote: But shouldn't they be with rda extension like other data sets in data folder? You can use text format or rda format. Read the manual. Duncan Murdoch --- On Sun, 4/18/10, Duncan Murdoch murdoch.dun...@gmail.com wrote

Re: [R] update of a function

2010-04-18 Thread Duncan Murdoch
a function's source into the R directory of the package. Data is a little more complicated, because there are lots of different possible formats for it. What format is your data originally? Duncan Murdoch You should never have to run package.skeleton more than once per package, and it could

Re: [R] local and global variables

2010-04-20 Thread Duncan Murdoch
: bilanci_subsets - list(2005 = bilanci1[ANNO==2005,], 2006 = bilanci1[ANNO==2006,], 2007 = bilanci1[ANNO==2007,] ) Then you can use for (i in names(bilanci_subsets)) { bilanci_subsets[[i]] Duncan Murdoch assign(paste(bilanci

Re: [R] Exporting an rgl graph

2010-04-20 Thread Duncan Murdoch
On 20/04/2010 10:43 AM, l...@stat.uiowa.edu wrote: On Fri, 16 Apr 2010, Michael Friendly wrote: l...@stat.uiowa.edu wrote: The current issue of JCGS (Vol 18 No 1, http://pubs.amstat.org/toc/jcgs/19/1) has an editorial on including animations, 3D visualizations, and movies in on-line PDF

Re: [R] shift and pop equivalent in R

2010-04-20 Thread Duncan Murdoch
. It is possible to write it yourself, but you need to watch out for weird cases like shift(x + y) where it's not at all clear what the side effect should be. Duncan Murdoch Thanks a lot. Best Regards, Xie Chao __ R-help@r-project.org mailing list https

Re: [R] VERY basic question about S4 classes

2010-04-21 Thread Duncan Murdoch
) {print(obj...@amount)} ) setGeneric(name=myMethod2, def=function(object){standardGeneric(myMethod2)} ) setMethod(f = myMethod2, signature = SomeClass, definition=function(object) {print(myMethod1 * 2)} You should have used myMethod1(object), not just myMethod1. Duncan Murdoch ) instance

Re: [R] How to stamp my graphs with date and time

2010-04-21 Thread Duncan Murdoch
, line=4, at=par(usr)[1]) (You will need to play with the side=, line= and at= specifications to get the location you want.) Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] problem of R CMD check

2010-04-21 Thread Duncan Murdoch
package before and did not find errors. Any ideas on this? Thanks a lot. Look for more details in the stam.Rcheck directory, particularly in the stam-Ex.* files. And please follow up on R-devel, rather than R-help. Duncan Murdoch __ R-help@r

Re: [R] install or uncompress package build in one platform in another platform

2010-04-22 Thread Duncan Murdoch
for the Mac. Duncan Murdoch __ R-help@r-project.org 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-contained, reproducible code.

Re: [R] compare variables and take largest value?

2010-04-22 Thread Duncan Murdoch
entries in v1,v2,v3 and in v4 to put largest value (NA=0). For example. first line v4 would be 1, but last line v4 would be 3. What function should I use? pmax. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Unable to make bitmapdll files on windows 7 64 bit machine

2010-04-23 Thread Duncan Murdoch
; ls is in the Rtools. I forget how you change permissions in Windows 7 without chmod, but I think it's a matter of working with the Properties you see when you right click the file. (Or you can install Cygwin, and then you'll get chmod.) Duncan Murdoch Thanks in advance. Alan- Alan T

Re: [R] 3D Plot

2010-04-23 Thread Duncan Murdoch
). Duncan Murdoch __ R-help@r-project.org 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-contained, reproducible code

Re: [R] method dispatching vs inheritance/polymorphism (re-post)

2010-04-25 Thread Duncan Murdoch
. Duncan Murdoch __ R-help@r-project.org 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-contained, reproducible code.

Re: [R] how to make read in a vector of 0s and 1s with no space between them

2010-04-25 Thread Duncan Murdoch
convert them to digits using ifelse(), e.g. chars - readChar(filename, nchar=1) digits - ifelse(chars==1, 1, ifelse(chars == 0, 0, NA)) if (any(is.na(digits))) stop(not all 0s and 1s!) Duncan Murdoch __ R-help@r-project.org mailing list https

Re: [R] plot dates

2010-04-26 Thread Duncan Murdoch
, it will happen automatically. If you don't like the tickmark locations or the date format, you can use axis.POSIXct to change them. For example, x - as.POSIXct(c(2010/01/01, 2010/05/01)) plot(x, 1:2, xaxt=n) axis.POSIXct(1, x, format=%b%Y) Duncan Murdoch

Re: [R] Sweave: centering with echo=TRUE

2010-04-26 Thread Duncan Murdoch
}* *Are you seeing the echoed source being centred? Duncan Murdoch Sweave-manual.pdf gives the following code chunk results=tex,echo=FALSE= for(i in 1:4){ file=paste(myfile, i, .eps, sep=) postscript(file=file, paper=special, width=6, height=6) plot(rnorm(100)+i) dev.off() cat

Re: [R] write.csv size limit in R 2.11.0 -- crashes

2010-04-26 Thread Duncan Murdoch
: CRAN is offline, and the mirrors I checked hadn't updated to this version yet.) You could also try an R-devel build; it never had the bug. Duncan Murdoch P.S. Bug discussions are generally better in R-devel rather than R-help __ R-help@r

Re: [R] when setting environment: target of assignment expands to non-language object

2010-04-26 Thread Duncan Murdoch
-.corSPT)) - environment(getS3method(coef-, : target of assignment expands to non-language object What should I do? If you want to change the coef-.corSPT object, use backquotes to treat it as a name: environment(`coef-.corSPT`) - ... Duncan Murdoch Thanks. Mike [[alternative

Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-26 Thread Duncan Murdoch
(userMatrix) into r3dDefaults$userMatrix, if you want to change the orientation of the default view.) Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] R with command line

2010-04-27 Thread Duncan Murdoch
On 27/04/2010 6:15 PM, Duke wrote: Hi all, I am testing R by trying R on command line (ie without opening R console) on a Mac Pro with 10.6. So I created a file plot.R: x11(width=5,height=3.5) plot(1:10,1:10) So I have two questions below (please forgive me if the questions have been asked

Re: [R] What is the best way to plots surfaces in 3 dimensions?

2010-04-28 Thread Duncan Murdoch
, + aspect = c(61/87, 0.4), + light.source = c(10,0,10)) Error: could not find function wireframe The wireframe function is in the lattice package, so you need library(lattice) first. (The persp3d function is in rgl.) Duncan Murdoch Sincerely, Andrea [[alternative

Re: [R] R with command line

2010-04-28 Thread Duncan Murdoch
On 28/04/2010 9:38 AM, Duke wrote: On 4/27/10 8:04 PM, Duncan Murdoch wrote: On 27/04/2010 6:15 PM, Duke wrote: Hi all, I am testing R by trying R on command line (ie without opening R console) on a Mac Pro with 10.6. So I created a file plot.R: x11(width=5,height=3.5) plot(1:10,1:10

Re: [R] JRI API: sourcing from Java String

2010-04-28 Thread Duncan Murdoch
string to an R string and calling eval and parse directly. Alternatively, if you need the bells and whistles, you can use textConnection to create a connection from an R string and source() that. Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] R with command line

2010-04-28 Thread Duncan Murdoch
On 28/04/2010 10:03 AM, Duke wrote: On 4/28/10 9:53 AM, Duncan Murdoch wrote: On 28/04/2010 9:38 AM, Duke wrote: On 4/27/10 8:04 PM, Duncan Murdoch wrote: On 27/04/2010 6:15 PM, Duke wrote: Hi all, I am testing R by trying R on command line (ie without opening R console) on a Mac

Re: [R] unexpected result from format(x, digits)

2010-04-28 Thread Duncan Murdoch
of significant figures in each case. All the other numbers are rendered to match. If you want to specify decimal places rather than significant digits, you should probably use sprintf() rather than format(). Duncan Murdoch R set.seed(2);print(x-rexp(5)) [1] 1.86535 0.40475 0.14665 1.73071 0.08953

Re: [R] unexpected result from format(x, digits)

2010-04-28 Thread Duncan Murdoch
. However, if all the elements then have trailing zeroes, the number of decimal places is reduced until at least one element has a non-zero final digit; see also the argument documentation for |big.*|, |small.*| etc, above. Duncan Murdoch __ R-help@r

Re: [R] Help in web browser

2010-04-29 Thread Duncan Murdoch
in the usual pop-up style. Is there a way to set/do it ?? Please inform. Set options(help_type=text) for the plain text popups. (This was an installation option; you could reinstall R to set it in your profile, or edit it into RHOME/etc/Rprofile.site yourself.) Duncan Murdoch

Re: [R] Sweave question

2010-04-29 Thread Duncan Murdoch
). (You'll get a file Rplots.pdf created.) Duncan Murdoch If I do: \begin{figure}[h] figA=true,echo=F,fig=T,results=hide= a rnorm(1000) plot(a) @ \caption{Weekly estimates.} \label{figure:ggplot1} \end{figure} The graphic doesn't get displayed but gets printed on the document but the code below

Re: [R] Random numbers with PDF of user-defined function

2010-04-29 Thread Duncan Murdoch
How do I generate random numbers with a probability distribution that exactly maps the above function? You can use sample() with the prob argument set to the values of f(x). You probably want replace=TRUE as well. Duncan Murdoch Nick This email and any attachments may contain

Re: [R] dump not evaluating promises?

2010-04-29 Thread Duncan Murdoch
or the new dimension that you put into foo2? I think you need to be more explicit about what output you were expecting, and why. Duncan Murdoch P.S. I've tried this on versions 2.11 and 2.9 and the results are the same. __ R-help@r-project.org

Re: [R] a question on autocorrelation acf

2010-04-29 Thread Duncan Murdoch
On 29/04/2010 6:22 PM, zhenjiang xu wrote: Hi R users, where can I find the equations used by acf function to calculate autocorrelation? See the reference listed in ?acf. Duncan Murdoch I think I misunderstand acf. Doesn't acf use following equation to calculate autocorrelation? [image: R

Re: [R] Find solution for an error in the condition of if

2010-04-30 Thread Duncan Murdoch
. The result is a vector with as many entries as you have rows in df. Only the first of them will be compared to data[pa, k]. Duncan Murdoch 2: In if ((data[pa, k] == df[, j]) (data[ch, k] == i)) { ... : la condition a une longueur 1 et seul le premier élément est utilisé ch=3 pa=c(1,2

Re: [R] apply fun to df returning a matrix

2010-04-30 Thread Duncan Murdoch
))) abc a 385 935 1485 b 935 2485 4035 c 1485 4035 6585 To me this looks clearer: result - matrix(NA, 3,3) for (i in 1:3) for (j in 1:3) result[i,j] - f(df[,i], df[,j]) Duncan Murdoch On 30.04.2010, at 12:59, Mohamed Lajnef wrote: Hi Soeren Apply or aggregate functions best

Re: [R] dump not evaluating promises?

2010-04-30 Thread Duncan Murdoch
) are expressions, and they evaluate to different things. (1:6 is an integer vector, the other is a numeric vector, stored in floating point.) dump() is just trying to give more concise output. Look more closely at Peter's example. Duncan Murdoch I think that either my understanding of what

Re: [R] Problem with format(,%G-%V) - Segfault

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 1:17 PM, Matthias Rieber wrote: Hi, I've some problems with the new R version converting date to year-week: R version 2.11.0 (2010-04-22) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 load(test.data.R) str(test.data) Class 'Date' num

Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-30 Thread Duncan Murdoch
, and then convert back to an image. But you'd be better off cropping in an image editor. Duncan Murdoch thanks again!! i've racked my brains trying to do this for over a week now, and still no solution... On Mon, Apr 26, 2010 at 10:31 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: Mandy Xu

Re: [R] closest match in R to c-like struct?

2010-05-01 Thread Duncan Murdoch
if you just want to remove the restrictive structure of the dataframe, use a list, but if you need the defined structure of a struct, use S4. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Text dependent on a variable in a R function

2010-05-02 Thread Duncan Murdoch
that need to be names, and expressions that can consist of nothing but a name, but can also be something else. So this function f - function(x) deparse(substitute(x)) will return 1 + 1 if you call it as f(1 + 1). Duncan Murdoch __ R-help@r-project.org

Re: [R] Set encoding when load()-ing workspaces?

2010-05-02 Thread Duncan Murdoch
in a Swedish locale. If you have an example where you know the correct version of the string and you can show us what you're getting, together with charToRaw() applied to it, someone will probably be able to make a guess at the encoding. Duncan Murdoch And now I'm stuck. Any suggestions on where

Re: [R] Text dependent on a variable in a R function

2010-05-03 Thread Duncan Murdoch
Jim Lemon wrote: On 05/02/2010 10:00 PM, Duncan Murdoch wrote: ... I've seen this description a couple of times lately, and I think it's worth pointing out that it's misleading. The deparse(substitute(x)) trick returns the *expression* that was passed to the argument x. Sometimes that's

Re: [R] Find solution for an error in the condition of if

2010-05-03 Thread Duncan Murdoch
]) data[ch, k] == i The says not to bother with the second test if the first one fails. Duncan Murdoch Best Regards 2010/4/30 Duncan Murdoch murdoch.dun...@gmail.com On 30/04/2010 4:19 AM, anderson nuel wrote: Dear r-help, Could you help me to find a solution for this error: Il y a eu

Re: [R] superscript

2010-05-04 Thread Duncan Murdoch
, expression(paste(4^th, root transformation))) Duncan Murdoch __ R-help@r-project.org 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

Re: [R] Using R with screenreading software

2010-05-04 Thread Duncan Murdoch
solution. There are also other front ends available that may work: running R from within Emacs, or using the JGR front end (see the article on p. 9 of http://stat-computing.org/newsletter/issues/scgn-16-2.pdf). Duncan Murdoch __ R-help@r-project.org

Re: [R] Idiomatic looping over list name, value pairs in R

2010-05-04 Thread Duncan Murdoch
]]) } sapply(names(d), do_both) My choice would be the first version, but yours might differ. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] Kernel density estimate plot for 3-dimensional data

2010-05-04 Thread Duncan Murdoch
what does not work means. The example above works (though I don't like the axes in the first plot; I prefer what you get with plot(fhat, box=FALSE)). What problem are you having? Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Kernel density estimate plot for 3-dimensional data

2010-05-04 Thread Duncan Murdoch
on. Those points all lie in a plane (y = 11-x); I imagine that causes the density estimate to overflow. I get the same problem with your data, but not with non-planar data. Duncan Murdoch fhat - kde(x, H=H) plot(fhat) plot(fhat, axes=FALSE, box=FALSE, drawpoints=TRUE); axes3d(c('x','y','z

Re: [R] rgl: plane3d or abline() analog

2010-05-04 Thread Duncan Murdoch
around to adding it. Maybe soon. Duncan Murdoch __ R-help@r-project.org 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

Re: [R] Two Questions on R (call by reference and pre-compilation)

2010-05-04 Thread Duncan Murdoch
. There's an experimental compiler, but I don't know if there's a predicted release date for it. R is not an easy language to compile. Duncan Murdoch Thanks in advance. Best Regards, Ruihong

Re: [R] Lazy evaluation in function call

2010-05-05 Thread Duncan Murdoch
problem, just make a copy of the function and modify it. Duncan Murdoch __ R-help@r-project.org 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

Re: [R] readLines with space-delimiter?

2010-05-05 Thread Duncan Murdoch
the space-delimiter issue. You can read a fixed number of lines, then process them; then you can repeat. The key is to open the file as a connection before calling read.table, and don't close it after each read. But you were probably doing that with readLines. Duncan Murdoch

Re: [R] puzzles with assign()

2010-05-05 Thread Duncan Murdoch
. Duncan Murdoch Thanks __ R-help@r-project.org 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-contained, reproducible code.

Re: [R] Supressing axes 3 and 4 when using plot()

2010-05-06 Thread Duncan Murdoch
', but then the newly created axes do not intercept. Use bty=L, e.g. plot(1, bty=L) See ?par for other possible values. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] What is the best way to have R output tables in an MS Word format? (shaping R core)

2010-05-07 Thread Duncan Murdoch
sense to ask Microsoft to handle that part than it makes to ask R Core to do it. Duncan Murdoch 2) Do it myself: I wish! I'm a terrible programmer and work 50-70 hoursa week in my main jobs (I'm so outspoken here at the moment partly because I'm off work post-op.) I'm quite a good

Re: [R] P values

2010-05-07 Thread Duncan Murdoch
they be real if they are small? Duncan Murdoch __ R-help@r-project.org 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-contained

Re: [R] Problem with nested functions - functions nested too deeply in source code

2010-05-07 Thread Duncan Murdoch
a depth like that is reasonable. Duncan Murdoch I found out that the problem is in the so called refinement procedure of the algorithm which consists of 10 different functions, returning an adjacency matrix. I¹m calling the refinement procedure with M - refine1(M, A, B, p_A, p_B, FAIL) (note

Re: [R] Problem with nested functions - functions nested too deeply in source code

2010-05-07 Thread Duncan Murdoch
Maximilian Kofler wrote: Duncan Murdoch murdoch.duncan at gmail.com writes: I doubt if that was the error message. More likely you saw Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Exactly this was the error message I recieved This isn't

Re: [R] Problem with install.packages(); getting out-of-date version.

2010-05-07 Thread Duncan Murdoch
version newer than you've got. (2.11.0 is current, you tried 2.10.1.) That doesn't appear to be the case now, but maybe it was when you tried? I'd try again, try a different mirror, etc. Duncan Murdoch Checking the CRAN mirror that I used (New Zealand) via Firefox, I found that version 1.18-4

Re: [R] Problem with nested functions - functions nested too deeply in source code

2010-05-07 Thread Duncan Murdoch
Duncan Murdoch wrote: Maximilian Kofler wrote: Duncan Murdoch murdoch.duncan at gmail.com writes: I doubt if that was the error message. More likely you saw Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Exactly this was the error

Re: [R] P values

2010-05-07 Thread Duncan Murdoch
Robert A LaBudde wrote: At 07:10 AM 5/7/2010, Duncan Murdoch wrote: Robert A LaBudde wrote: At 01:40 PM 5/6/2010, Joris Meys wrote: On Thu, May 6, 2010 at 6:09 PM, Greg Snow greg.s...@imail.org wrote: Because if you use the sample standard deviation then it is a t

Re: [R] help with RCMDR - can't get install to work

2010-05-07 Thread Duncan Murdoch
on Mac OSX. (R runs on lots of platforms, so you should say which one you're using when problems come up.) If so, take a look at the download page on CRAN: it mentions that Tcl/Tk needs to be installed separately, it's not included in the regular download. Duncan Murdoch

Re: [R] matrix cross product in R different from cross product in Matlab

2010-05-08 Thread Duncan Murdoch
-of-squares.aspx . The one you describe below is the one from 3 dimensional vector geometry. You can get that one in R in a few different packages, but it's not really used much in statistics, so it's not in base R. (It's called xprod in RFOC and RSEIS, extprod3d in geometry.) Duncan Murdoch

Re: [R] Using R with screenreading software

2010-05-08 Thread Duncan Murdoch
is a partially blinking one. Optionally the current solid cursor or a fully blinking one can be used. Duncan Murdoch For my last exam she used R in a Dosbox as workaround, but encountered other problems, esp. with scrolling. So: Is it possible to change the cursor type/behavior in R-Console? She uses

Re: [R] P values

2010-05-08 Thread Duncan Murdoch
-values are probably associated with larger departures from the null. But the p-value is not a good way to estimate that distance. Use a parameter estimate instead. Duncan Murdoch Essentially, a p-value is as real as your assumptions. In that way I can understand what Robert wants to say

Re: [R] Plot polygon in 3D with rgl

2010-05-09 Thread Duncan Murdoch
[,2])) triangles3d(cbind(triangles, zfit), col=green) Duncan Murdoch __ R-help@r-project.org 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

Re: [R] scope of a function + lazy evaluation

2010-05-10 Thread Duncan Murdoch
Even if I dont evaluate the function tmp[[1]] before i.e I do rm(list=ls()) f - function(y) function() y tmp - vector(list, 5) for (i in 1:5) tmp[[i]] - f(i) z - f(6) tmp[[1]]() # it still returns 5; it should return 6 ideally right ??? See above. Duncan Murdoch [[alternative HTML

Re: [R] Problems executing cor(dataset) function in R 2.11.0 for OS X ( It works fine in R 2.10.1)

2010-05-10 Thread Duncan Murdoch
this problem? I would think the first step would be to ask Mr. Quick what's wrong. Duncan Murdoch __ R-help@r-project.org 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] Rd files must have a non-empty \title

2010-05-10 Thread Duncan Murdoch
over all the Rd files, read them, substitute for the default title line, and write them back. If you don't want informative help files, it's really not much work to make uninformative ones. Duncan Murdoch THX for the help Assa R.version platform i386-pc-mingw32 arch i386

Re: [R] empty matrix

2010-05-10 Thread Duncan Murdoch
: matrix(numeric(0), 0,0) This gives a 0 by 0 matrix. Duncan Murdoch __ R-help@r-project.org 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

Re: [R] predict() without generating the model within R

2010-05-10 Thread Duncan Murdoch
together enough information for predict() to work properly. However, you can do predictions for many models just from their definition, and you may have enough information to calculate errors as well. But you'll need to program the formulas yourself. Duncan Murdoch Thanks, Bimal PS-yes, I know

Re: [R] Revolution R and the R Community?

2010-05-11 Thread Duncan Murdoch
. (Disclaimer: I did a small amount of contract work for them a couple of years ago.) Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Revolution R and the R Community?

2010-05-11 Thread Duncan Murdoch
, as the Wikipedia article mentions. And Bill Dunlap of Tibco has been making valuable contributions to S and S-PLUS for years, and more recently to R on this mailing list. Duncan Murdoch Would have acted more in a similar way. (And if they do, I didn't know about it and would like to have been more

Re: [R] compiling an R script

2010-05-12 Thread Duncan Murdoch
for the R-devel list. And he may not get much sympathy there: R is an open source project, and developing ways to hide code is not something that interests most of us. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Duncan Murdoch
bits. So you'd probably get what you want with x - iconv(x, , UTF-8) x (though you may need to declare the input encoding; it is likely CP1252 on Windows). Duncan Murdoch Regards, Erich [[alternative HTML version deleted]] __ R

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Duncan Murdoch
don't know if you can specify the output encoding; it won't help to do it in the document code chunks). You also need to put the line \usepackage[utf8]{inputenc} into the document preamble, but it sounds as though Lyx has already done that for you. Duncan Murdoch Regards, Erich

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