Re: [R] [Rd] Error: bad value problem

2008-12-18 Thread Martyn Plummer
This has all the hallmarks of a bug I found and fixed in R-devel (r46998). I did not port the patch over to the R release branch because I could not reproduce the bug. In R-devel, I was seeing problems with make test-Segfault. This would occasionally segfault, but most of the time would create

Re: [R] Calculating Sensitivity, Specificity, and Agreement from Logistics Regression Model

2008-12-18 Thread David Hajage
Deer Meir, You could take a look at lroc() from epicalc package. Or calculate all that yourself : the linear fit of the model are in yourmodel$linear.predicators Best regards, david 2008/12/18 Meir Preiszler pm...@itamar-medical.com Hi, Assume I have a variable Y having two discrete values

Re: [R] Problem with alignDailySwries in R-metrics

2008-12-18 Thread Yohan Chalabi
JK == John Kerpel john.ker...@gmail.com on Tue, 16 Dec 2008 13:26:27 -0600 JK DTB6-alignDailySeries(DTB6, method = interp,include.weekends = FALSE, JK units = NULL) JK Error in getDataPart(S4 object of class timeSeries) : JK no '.Data' slot defined for class timeSeries JK

[R] a ratio-variable predictor

2008-12-18 Thread Jeroen Ooms
Maybe this is more of a statistical question than an R question, but I am going to ask it anyway :) Cortisol and Testosteron are known to interact in the body, and some literature suggest that especially the ratio between the two is a good predictor. So I want to add the ratio predictor

Re: [R] Problem with ggplot2

2008-12-18 Thread ONKELINX, Thierry
Are you sure that you have all your packages updated? Because qplot(mpg, wt, data=mtcars) works without a problem on my machine. Please add the info of sessionInfo() when reporting bugs. The posting guide asked you to do so. Thierry sessionInfo() R version 2.8.0 (2008-10-20) i386-pc-mingw32

[R] lme4 error after Matrix update

2008-12-18 Thread Hans-Ruediger Pfister
Dear all, after recently updating my R-packages I am unable to work with lme4, since it does not load. What I get is this: Error in inDL(x, as.logical(local), as.logical(now), ...) : function 'cholmod_l_start' not provided by package 'Matrix' In addition: Warning messages: 1: package 'lme4'

[R] For and if confusion

2008-12-18 Thread Shruthi Jayaram
I have two date objects X - c(01-03-1993, 01-05-1997) #Mar 1993 and May 1997 Y - c(01-02-1995, 01-08-1999) #Feb 1995 and Aug 1999 and a time series object A - ts(rnorm(120), freq=12, start=c(1992,8)) #Aug 1992 to Aug 2002 I want to create a binary (0-1) vector B that is of length 1:(A). B

Re: [R] Parsing unusual date format

2008-12-18 Thread Shruthi Jayaram
Thanks so much everyone, these suggestions solve my problem in a very elegant way. A friend and I also came up with this brute force solution: T - c(1993m10) y - gsub(m., , T) m - gsub(.*m, , T) d - paste(y,-0,m,-,01, sep=) T - as.Date(d, format=%Y-%m-%d) Thought I would post it in any case.

Re: [R] Plot multiple lines, same plot, different axes?

2008-12-18 Thread Jim Lemon
zack holden wrote: Dear list, I would like to plot 2 series of numbers with very different ranges/scales as lines on the same plot. I assumed this is commonly done and easy, but I have not found any help files (e.g. axis() or matplot() that show how. I've searched many old posts to no

Re: [R] lme4 error after Matrix update

2008-12-18 Thread ONKELINX, Thierry
Dear Rüdiger, Try to uninstall AND fysically remove (delete) lme4 and Matrix from the harddisk. Then installing them again should do this trick. At least it did on my laptop. HTH, Thierry ir. Thierry Onkelinx

[R] Ploting 3D cylinder in RGL

2008-12-18 Thread megh
Dear all, I would like to draw a 3-D horizontal cylinder preferably in RGL device (because this gives the look from different angles). Basic idea is from http://www.tau.ac.il/cc/pages/docs/sas8/insight/chap18/sect3.htm. Below is the description exactly what I want to do. Please see at figure

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Simon Pickett
Wow, thats amazing, thanks very much!!! Simon. - Original Message - From: Henrique Dallazuanna To: Simon Pickett Cc: r-help@r-project.org Sent: Thursday, December 18, 2008 11:25 AM Subject: Re: [R] inserting zero instances with zeroes in a matrix Try this:

[R] Algorithm for calculating McCall's T-scores

2008-12-18 Thread Stefan Björk
I'm looking for a function or algorithm for calculating McCall's area transformed T-scores, but have not find any. An algorithm is described on http://www.visualstatistics.net/Visual Statistics Multimedia/normalization.htm, but this seem to be an overly complicated procedure for implementing in R.

Re: [R] X11 is not availble

2008-12-18 Thread Dennis Schmidt
Hi Fredrik, well I'm connecting via SSH onto the machine. Lateron the R scripts shall be executed via some Ruby scripts. The pdf export is working properly, but I think it would be very ugly to first create a pdf file and then convert it to my needed png (or any other pure image format).

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Gabor Grothendieck
Try this: as.data.frame(xtabs(count ~., d.f)) On Thu, Dec 18, 2008 at 6:25 AM, Henrique Dallazuanna www...@gmail.com wrote: Try this: with(d.f, {merge(data.frame(house = rep(unique(house), each = length(unique(pet))), pet = unique(pet)), d.f, by = c(house, pet), all = TRUE)

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Henrique Dallazuanna
Try this: with(d.f, {merge(data.frame(house = rep(unique(house), each = length(unique(pet))), pet = unique(pet)), d.f, by = c(house, pet), all = TRUE) } ) On Thu, Dec 18, 2008 at 8:58 AM, Simon Pickett simon.pick...@bto.orgwrote: Hi all, Suppose I had the below

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Simon Pickett
Thanks Gregor and Henrique for the eloquent and masterful replies, These solutions have saved me hours (maybe even days) of work in the future, I am very grateful. :-) Simon. - Original Message - From: Gabor Grothendieck ggrothendi...@gmail.com To: Henrique Dallazuanna

Re: [R] X11 is not availble

2008-12-18 Thread Dennis Schmidt
No, haven't seen this so far. But it quite looks like what I'm looking for, so thanks a lot :-) Dennis Am 18.12.2008 um 13:09 schrieb Fredrik Karlsson: Hi again, Sorry for bothering you, but have you seen this? http://www.stats.bris.ac.uk/R/web/packages/GDD/index.html or this one

[R] Random Number Generation using (Generalized) Extreme Value distribution and Pareto distribution

2008-12-18 Thread Maithili Shiva
Hi R helpers, Is there any function in R, which generates random numbers in case of (1) Generalized Extreme Value distribution and (2) Generalized PAreto distribution for the respective given set of parameters? Regards Maithili __

[R] Help: Some problem with gdata package when using Dates

2008-12-18 Thread Prabhanjan Tattar
Dear List: I encountered this strange problem. I want to read dates in a R program. This is a sample data: Dates 12/12/08 14/12/08 18/01/08 28/02/08 16/06/08 19/07/08 28/09/08 If I save these dates in a .csv file, and read it in R using read.csv, I can perfectly read the data, and the commands

Re: [R] Problem with ggplot2

2008-12-18 Thread Short, Tom
Yep, that was it. I had an out of date plyr. Hadley straightened me out. - Tom -Original Message- From: ONKELINX, Thierry [mailto:thierry.onkel...@inbo.be] Sent: Thursday, December 18, 2008 5:03 AM To: Short, Tom; r-help@r-project.org Subject: RE: [R] Problem with ggplot2 Are you

[R] Rr: For and if confusion

2008-12-18 Thread Matthieu Stigler
I have two date objects X - c(01-03-1993, 01-05-1997) #Mar 1993 and May 1997 Y - c(01-02-1995, 01-08-1999) #Feb 1995 and Aug 1999 and a time series object A - ts(rnorm(120), freq=12, start=c(1992,8)) #Aug 1992 to Aug 2002 I want to create a binary (0-1) vector B that is of length 1:(A).

Re: [R] X11 is not availble

2008-12-18 Thread Barry Rowlingson
2008/12/18 Dennis Schmidt dennis.schm...@student.hpi.uni-potsdam.de: No, haven't seen this so far. But it quite looks like what I'm looking for, so thanks a lot :-) The png() device does not need an X server to connect to. I think it used to in versions gone by, but not any more. Here I've

Re: [R] Ploting 3D cylinder in RGL

2008-12-18 Thread Duncan Murdoch
megh wrote: Dear all, I would like to draw a 3-D horizontal cylinder preferably in RGL device (because this gives the look from different angles). Basic idea is from http://www.tau.ac.il/cc/pages/docs/sas8/insight/chap18/sect3.htm. Below is the description exactly what I want to do. Please

[R] autologistic modelling in R

2008-12-18 Thread Charlotte Bell
Hi, I have spatially autocorrelated data (with a binary response variable and continuous predictor variables). I believe I need to do an autologistic model, does anyone know a method for doing this in R? Many thanks C Bell __ R-help@r-project.org

Re: [R] replacing elements of a zoo object

2008-12-18 Thread tolga . i . uzuner
Thanks Gabor. Just tried that... it didn't work for some reason, even though it also did not complain about an error this time. x[as.Date(2008-12-14)] 2008-12-14 NA x[as.Date(2008-12-14)]-1 x[as.Date(2008-12-14)] 2008-12-14 NA Regards, Tolga Tolga Uzuner

Re: [R] R2HTML and output from a function

2008-12-18 Thread bartjoosen
Hello, did you try to replace the print commands with HTML? But first you have to specify a file through HTMLStart and at the end of the function HTMLStop. Including plots is no problem, but you have to save them and then with the HTMLInsertGraph function insert them into your report. Kind

Re: [R] Random Number Generation using (Generalized) Extreme Value distribution and Pareto distribution

2008-12-18 Thread Jorge Ivan Velez
Dear Maithili, For (1) see [1] and for (2) see page 24 in [2]. HTH, Jorge [1] http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/evd/html/gev.html [2] http://cran.r-project.org/web/packages/fExtremes/fExtremes.pdf On Thu, Dec 18, 2008 at 3:17 AM, Maithili Shiva

Re: [R] replacing elements of a zoo object

2008-12-18 Thread Gabor Grothendieck
I didn't notice the second question and was only answering your first question: library(zoo) x - zoo(c(361.667, 389.875, NA, NA, 397.822, 395.667), as.Date(2008-12-11) + 0:5) x[as.Date(2008-12-14)] 2008-12-14 NA For the second question use window (window also works for the first

Re: [R] X11 is not availble

2008-12-18 Thread Dennis Schmidt
Hi Barry, this is the output of my capabilities() call: jpeg png tifftcltk X11 aqua http/ftp sockets FALSEFALSEFALSEFALSEFALSEFALSE TRUE TRUE libxml fifo clediticonv NLS profmemcairo TRUE TRUE TRUE TRUE

Re: [R] Help: Some problem with gdata package when using Dates

2008-12-18 Thread Gabor Grothendieck
Convert the date column to Date class and then access that column, not the entire data frame: library(gdata) Dates - read.xls(/tmp2/date.xls, header = FALSE) Converting xls file to csv file... Done. Reading csv file... Done. months(as.Date(Dates[[1]], %m-%d-%y)) [1] December December January

[R] Indicator function for merged times (was: Re: Rr: For and if confusion)

2008-12-18 Thread Gabor Grothendieck
Please start a new thread for a new topic and use a meaningful subject for sake of the archives and everyone trying to follow. Using your Int1, correcting your Int2 and using your Y (which goes to Jul not Aug as per the comment): library(zoo) as.ts(with(merge.zoo(Int1, Int2, Y, fill = 0),

Re: [R] Indicator function for merged times (was: Re: Rr: For and if confusion)

2008-12-18 Thread Gabor Grothendieck
My initial comment was wrong. I see that this is really an answer rather than the question but it was confusing because it started a new thread. Please try to use the same thread in answering the question. On Thu, Dec 18, 2008 at 9:39 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: Please

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Simon Pickett
Actually, Both these solutions create contingency tables, with frequency rather than the original count values. Is there a way to retain the original count values? Thanks again, Simon. - Original Message - From: Simon Pickett simon.pick...@bto.org To: Gabor Grothendieck

Re: [R] inserting zero instances with zeroes in a matrix

2008-12-18 Thread Gabor Grothendieck
It does retain the original count values. Its only the column name that has changed. To change that you can use: as.data.frame(xtabs(count ~., d.f), responseName = count) # compare d.f[order(d.f$house, d.f$pet), ] house pet count 2 house1cats 1 1 house1dogs 2 3 house2

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Kenn Konstabel
Hi, On Tue, Dec 16, 2008 at 9:13 AM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: ... but this is also legal if you really hate - : foo({x = 2}) # assign to x, pass to foo as a This is legal but doesn't do what you probably expect -- although documentation for `-` says

Re: [R] a ratio-variable predictor

2008-12-18 Thread Greg Snow
A good article to read before using ratios is: Kronmal, RA. Spurious Correlation and the Fallacy of the Ratio Standard Revisited. Journal of the Royal Statistical Society. Series A, Vol 156, No. 3 (1993), 379-392. It shows some of the traps that misusing ratios can lead to along with

Re: [R] Semi-random movement inside a circle

2008-12-18 Thread Yihui Xie
Hi, I've simplified the bouncing off part as choosing another place to go (with no consideration of the bouncing details): ## set.seed(1234) par(pty = s, pch = 19, ann = FALSE, xaxt = n, yaxt = n, bty = n) theta = seq(0, 2 * pi, length = 512) n = 20 nmax = 500 x = runif(n, -1, 1) y =

Re: [R] X11 is not availble

2008-12-18 Thread Dirk Eddelbuettel
On Thu, Dec 18, 2008 at 08:31:09AM -0600, Dirk Eddelbuettel wrote: On Thu, Dec 18, 2008 at 02:52:40PM +0100, Dennis Schmidt wrote: Hi Barry, this is the output of my capabilities() call: jpeg png tifftcltk X11 aqua http/ftp sockets FALSEFALSEFALSE

Re: [R] surface contour plot help

2008-12-18 Thread Brad B
that was able to work.  Thank you! its a little clumsy in getting a certain view, but you can get to it eventually. Is their a way to do it with plot3d so that you can use the mouse to rotate the surface plot around?   Brad Date: Wednesday, December 17, 2008, 10:09 AM Look at rotate.wireframe

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Kenn Konstabel
On Thu, Dec 18, 2008 at 5:26 PM, Peter Dalgaard p.dalga...@biostat.ku.dkwrote: bar - foo({x = 42}) bar [1] 42 What you're seeing is effectively foo(invisible(42)) i.e. the result is there, just not printing. Thanks for explaining. This is cleverer and much less obscure than I

Re: [R] RcmdrPlugin doesn't work under R280

2008-12-18 Thread John Fox
Dear Irina, Some more information might help: Which plug-in package? What OS? What are the errors? You might try the development version of the Rcmdr package on R-Forge, which makes some changes to the handling of plug-ins, and which can be installed via

[R] R crash with dyn.load

2008-12-18 Thread Thibault Helleputte
Hello, I try to incorporate C code in R. suppose I have the following C code: #include R.h #include stdio.h int main(int *n) { int i; for(i=0; i *n; i++) { printf(Hello, world!\n); } } in a file named hello.c. First I make: g++ -c hello.c -o hello.o -I

Re: [R] R crash with dyn.load

2008-12-18 Thread Martyn Plummer
On Thu, 2008-12-18 at 17:18 +0100, Thibault Helleputte wrote: Hello, I try to incorporate C code in R. suppose I have the following C code: #include R.h #include stdio.h int main(int *n) { int i; for(i=0; i *n; i++) { printf(Hello, world!\n); } } in a

[R] svyglm fit method?

2008-12-18 Thread Corey Sparks
Dear list, I am using svyglm in the survey library to fit a binomial logistic regression accounting for sample design. The documentation says the models are not fit by maximum likelihood, so my question is what is the fitting method? Pseudo likelihood? Generalized least squares?

[R] Contextstack overlow

2008-12-18 Thread Ranney, Steven
All - I have a number of rows that I am assigning length classes to via l.class-with(wae, ifelse((Length=120)(Length130),125, ifelse((Length=130)(Length140),135, ifelse((Length=140)(Length150),145, ifelse((Length=150)(Length160),155, ifelse((Length=160)(Length170),165,

Re: [R] Contextstack overlow

2008-12-18 Thread Charles C. Berry
SR, My answer to the question you posed is Someone must know, but I do not know. However, I suspect the answer to the question you should have asked is: See ?cut and ?findInterval HTH, Chuck On Thu, 18 Dec 2008, Ranney, Steven wrote: All - I have a number of rows

Re: [R] Contextstack overlow

2008-12-18 Thread Duncan Murdoch
On 12/18/2008 12:00 PM, Ranney, Steven wrote: All - I have a number of rows that I am assigning length classes to via l.class-with(wae, ifelse((Length=120)(Length130),125, ifelse((Length=130)(Length140),135, ifelse((Length=140)(Length150),145, ifelse((Length=150)(Length160),155,

[R] big data file versus ram memory

2008-12-18 Thread Mauricio Calvao
Hi there I am new to R and would like to ask some questions which might not make perfect sense. Anyhow, here they are: 1) I would like very much to use R for processing some big data files (around 1.7 or more GB) for spatial analysis, wavelets, and power spectra estimation; is this possible

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Wacek Kusnierczyk
Kenn Konstabel wrote: Hi, On Tue, Dec 16, 2008 at 9:13 AM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: ... but this is also legal if you really hate - : foo({x = 2}) # assign to x, pass to foo as a This is legal but doesn't do what you probably expect --

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Wacek Kusnierczyk
Kenn Konstabel wrote: If you really hate -, you should do either foo({(x=42)}) # or foo({x=42; x}) # or even ... foo(a=force(x=43)) if you think the use of force guarantees that x is assigned 43, you're wrong. foo = function(a) 0 x = 1 foo(a=force(x=2)) x foo = function(a)

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: Kenn Konstabel wrote: Hi, On Tue, Dec 16, 2008 at 9:13 AM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: ... but this is also legal if you really hate - : foo({x = 2}) # assign to x, pass to foo as a This is legal

[R] Confused about behavior of an S4 object containing a ts object

2008-12-18 Thread Lyman, Mark
I am trying to define an S4 class that contains a ts class object, a simple example is shown in the code below. However, when I try to create a new object of this class the tsp part is ignored, see below. Am I doing something wrong, or is this just a peril of mixing S3 and S4 objects?

Re: [R] big data file versus ram memory

2008-12-18 Thread Stephan Kolassa
Hi Mauricio, Mauricio Calvao schrieb: 1) I would like very much to use R for processing some big data files (around 1.7 or more GB) for spatial analysis, wavelets, and power spectra estimation; is this possible with R? Within IDL, such a big data set seems to be tractable... There are some

[R] RODBC crashes connecting to Teradata

2008-12-18 Thread Francisco Javier Perez Caballero
Hi, I'm trying to connect to a Teradata database via RODBC on a Linux 64 machine (Red Hat Enterprise Linux 5). The ODBC driver is properly configured and queries sent via unixODBC's isql tool work properly. However, this is what happens when I try to connect via RODBC: library(RODBC) conn =

Re: [R] Algorithm for calculating McCall's T-scores

2008-12-18 Thread Stefan Björk
I seem to have solved this on my own: t.score.table - data.frame(T=10:90,F=pnorm(10:90,mean=50.5,sd=10)) t.score - function(x) { p - ecdf(x) t - cut(p(x),breaks=c(t.score.table$F,Inf),labels=t.score.table$T) t - as.numeric(levels(t))[as.integer(t)] return(t) } /S 2008/12/18 Stefan Björk

Re: [R] big data file versus ram memory

2008-12-18 Thread David Winsemius
On Dec 18, 2008, at 3:07 PM, Stephan Kolassa wrote: Hi Mauricio, Mauricio Calvao schrieb: 1) I would like very much to use R for processing some big data files (around 1.7 or more GB) for spatial analysis, wavelets, and power spectra estimation; is this possible with R? Within IDL, such

Re: [R] RODBC crashes connecting to Teradata

2008-12-18 Thread Prof Brian Ripley
On Thu, 18 Dec 2008, Francisco Javier Perez Caballero wrote: Hi, I'm trying to connect to a Teradata database via RODBC on a Linux 64 machine (Red Hat Enterprise Linux 5). The ODBC driver is properly configured and queries sent via unixODBC's isql tool work properly. However, this is what

[R] EMMA

2008-12-18 Thread Alexandre Swarowsky
Hey, Have some one work with End-Member Mixing Analysis in R? Is there a specific package? Thanks, Alex -- Alexandre Swarowsky Soils and Biogeochemistry Graduate Group University of California at Davis One Shields Avenue Davis CA 95618 Office: (530)752-4131 cell: (530)574-3028

[R] formatting print statements with multiple lines

2008-12-18 Thread Brigid Mooney
When executing the command: print(cat(paste(Input criteria does not meet specifications. Check input against the following requirements: a = 0 b = 0 c = 0 , sep=), )) I get: Input criteria does not meet specifications. Check input against the following

Re: [R] formatting print statements with multiple lines

2008-12-18 Thread John Fox
Dear Brigid, cat() prints by default to standard output and invisibly returns NULL, which print() prints. I think that what you want is cat(Input criteria do not meet specifications. Check input against the following requirements: a = 0 b = 0 c = 0 \n) I

[R] understanding recursive functions

2008-12-18 Thread joseph . g . boyer
I'm trying to understand the use of recursive functions described on page 45 of An Introduction to R by the R core development team. A function is a list of expressions, which all get executed with only the last being assigned to a global variable, right? So if a function refers recursively to

Re: [R] understanding recursive functions

2008-12-18 Thread Jeffrey Horner
joseph.g.bo...@gsk.com wrote on 12/18/2008 04:22 PM: I'm trying to understand the use of recursive functions described on page 45 of An Introduction to R by the R core development team. A function is a list of expressions, which all get executed with only the last being assigned to a global

Re: [R] understanding recursive functions

2008-12-18 Thread Ted Harding
On 18-Dec-08 22:33:28, Jeffrey Horner wrote: joseph.g.bo...@gsk.com wrote on 12/18/2008 04:22 PM: I'm trying to understand the use of recursive functions described on page 45 of An Introduction to R by the R core development team. A function is a list of expressions, which all get executed

Re: [R] How to make a smooth ( linear ) CDF plot? -- Thanks!

2008-12-18 Thread Mike Williamson
All, Thanks for all of your help advice! I created a plot starting with qqnorm, if I remember right, but I had to add a LOT of extras. I was surprised that it doesn't include the probability (e.g. 50% at mean) and instead provides the standard deviations (e.g., 0 at mean) on the axis.

Re: [R] understanding recursive functions

2008-12-18 Thread Wacek Kusnierczyk
Jeffrey Horner wrote: joseph.g.bo...@gsk.com wrote on 12/18/2008 04:22 PM: I'm trying to understand the use of recursive functions described on page 45 of An Introduction to R by the R core development team. A function is a list of expressions, which all get executed with only the last being

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Stavros Macrakis
On Thu, Dec 18, 2008 at 1:37 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Kenn Konstabel wrote: ...foo({x = 2}) ... This is legal but doesn't do what you probably expect -- although documentation for `-` says the value (returned by -) is 'value' i.e. whatever is

Re: [R] understanding recursive functions

2008-12-18 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: it's a pity that - is not explained in ?`-` clearly enough: The operators '-' and '-' cause a search to made through the environment for an existing definition of the variable being assigned. If such a variable is found (and its binding is not

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: On Thu, Dec 18, 2008 at 1:37 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Kenn Konstabel wrote: ...foo({x = 2}) ... This is legal but doesn't do what you probably expect -- although documentation for `-` says the

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Peter Dalgaard
Stavros Macrakis wrote: On Thu, Dec 18, 2008 at 1:37 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Kenn Konstabel wrote: ...foo({x = 2}) ... This is legal but doesn't do what you probably expect -- although documentation for `-` says the value (returned by -) is

Re: [R] understanding recursive functions

2008-12-18 Thread Peter Dalgaard
Wacek Kusnierczyk wrote: Wacek Kusnierczyk wrote: it's a pity that - is not explained in ?`-` clearly enough: The operators '-' and '-' cause a search to made through the environment for an existing definition of the variable being assigned. If such a variable is found (and its

Re: [R] Is = now the same as - in assigning values

2008-12-18 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: On Thu, Dec 18, 2008 at 1:37 PM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: who said = is more intuitive for assignments? i said i prefer it, and that's because of aesthetics, silly me. in an earlier post, someone said it is more natural

Re: [R] understanding recursive functions

2008-12-18 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ted.hard...@manchester.ac.uk Sent: Thursday, December 18, 2008 2:52 PM To: r-help@r-project.org Cc: joseph.g.bo...@gsk.com Subject: Re: [R] understanding recursive functions

[R] Lattice Plot Ordering?

2008-12-18 Thread Haoda Fu
Hi, When I plot multi-panel in R by using lattice package, the order is always starting from bottom to the top, e.g., panel 1,2,3,4 will looks like the following, 3,4 1,2 How can I change it to 1,2 3,4 ? many thanks! Best, Haoda __

Re: [R] Lattice Plot Ordering?

2008-12-18 Thread Rolf Turner
On 19/12/2008, at 2:03 PM, Haoda Fu wrote: Hi, When I plot multi-panel in R by using lattice package, the order is always starting from bottom to the top, e.g., panel 1,2,3,4 will looks like the following, 3,4 1,2 How can I change it to 1,2 3,4 ? many thanks! Use the ``as.table''

Re: [R] understanding recursive functions

2008-12-18 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Nordlund, Dan (DSHS/RDA) Sent: Thursday, December 18, 2008 5:00 PM To: r-help@r-project.org Subject: Re: [R] understanding recursive functions -Original Message-

[R] how to manipulate ... within a function

2008-12-18 Thread Dan Kelley
Is there a way a function ('parent', say) can manipulate the ... argument, and then pass the manipulated value into another function ('child', say) that it calls? What I'm trying to do is to use some plotting defaults within 'parent' that are not part of parent's argument list, but to let the

[R] using jackknife in linear models

2008-12-18 Thread Mark Heckmann
Hi R-experts, I want to use the jackknife function from the bootstrap package onto a linear model. I can't figure out how to do that. The manual says the following: # To jackknife functions of more complex data structures, # write theta so that its argument x # is the set of observation

[R] can a function alter the ... argument and passed the result to another function?

2008-12-18 Thread Dan Kelley
Is there a way a function ('parent', say) can manipulate the ... argument, and then pass the manipulated value into another function ('child', say) that it calls? What I'm trying to do is to use some plotting defaults within 'parent' that are not part of parent's argument list, but to let

Re: [R] understanding lexical scope

2008-12-18 Thread Antonio, Fabio Di Narzo
2008/12/18 joseph.g.bo...@gsk.com: I am trying to understand the concept of lexical scope in An Introduction to R by the R Core development team. I'd appreciate it if someone would explain why the following example does not work: q - function(y) {x + y}; w - function(x){q(x)}; w(2);

Re: [R] how to manipulate ... within a function

2008-12-18 Thread Duncan Murdoch
On 18/12/2008 7:19 PM, Dan Kelley wrote: Is there a way a function ('parent', say) can manipulate the ... argument, and then pass the manipulated value into another function ('child', say) that it calls? What I'm trying to do is to use some plotting defaults within 'parent' that are not part of

Re: [R] autologistic modelling in R

2008-12-18 Thread milton ruser
Hi Charlotte, I suggest you give a look ate Hmisc and Design packages. May be there you can find some solution. Good luck miltinho, brazil ...User R!... On Thu, Dec 18, 2008 at 10:14 AM, Charlotte Bell charlotte.b...@sheffield.ac.uk wrote: Hi, I have spatially autocorrelated data (with a

Re: [R] Trouble pulling data from a messy ASCII file...

2008-12-18 Thread jim holtman
Here is an example of some code that might do it for you:: input - readLines(textConnection(19 c:/data/WF-100/2008/20080911/trk/20080911.013115.007.17.txt + 10 s name of program that wrote this file trkplt name of program that wrote this file + 10 GORDON machine that generated this file

Re: [R] svyglm fit method?

2008-12-18 Thread Thomas Lumley
On Thu, 18 Dec 2008, Corey Sparks wrote: Dear list, I am using svyglm in the survey library to fit a binomial logistic regression accounting for sample design. The documentation says the models are not fit by maximum likelihood, so my question is what is the fitting method? Pseudo

Re: [R] understanding lexical scope

2008-12-18 Thread Thomas Lumley
On Thu, 18 Dec 2008 joseph.g.bo...@gsk.com wrote: I am trying to understand the concept of lexical scope in An Introduction to R by the R Core development team. I'd appreciate it if someone would explain why the following example does not work: q - function(y) {x + y}; w - function(x){q(x)};

Re: [R] sliding window over a large vector

2008-12-18 Thread Carl Witthoft
Because I had too much time on my hands, here's a little function that will do whatever you want over a window you specify. No, I haven't done any time trials :-( # my own boxcar tool, just because. # use bfunc to specify what function to apply to the windowed # region. boxcar-function(x,

Re: [R] using jackknife in linear models

2008-12-18 Thread Simon Knapp
The definition of jackknife implies that the result of theta must be a numeric scalar. So, presuming you wanted to jackknife a coefficient, theta would need to be something like: theta - function(x, xdata, coefficient) coef(lm(model.lm, data=xdata[x,]))[coefficient] and would be called something

[R] How do I generate one vector for every row of a data frame?

2008-12-18 Thread Bill McNeill (UW)
I am trying to generate a set of data points from a Gaussian mixture model. My mixture model is represented by a data frame that looks like this: gmm weight mean sd 10.30 1.0 20.2 -2 0.5 30.44 0.7 40.15 0.3 I have written the following function that generates

[R] 'Error: C stack usage is too close to the limit' when adding an overarching function

2008-12-18 Thread Jean-Michel.Perraud
Hi, I encountered an error of type 'C stack usage is too close to the limit', and could not find information so far to get unstuck. The error occurs when subsetting columns from a data frame (see stack trace below). However if I step through the sequence of code found in the 'topmost'

[R] 'Error: C stack usage is too close to the limit' when adding an overarching function

2008-12-18 Thread Jean-Michel.Perraud
Hi, I encountered an error of type 'C stack usage is too close to the limit', and could not find information so far to get unstuck. The error occurs when subsetting columns from a data frame (see stack trace below). However if I step through the sequence of code found in the 'topmost'

Re: [R] How do I generate one vector for every row of a data frame?

2008-12-18 Thread Simon Knapp
Your code will always generate the same number of samples from each of the normals specified on every call, where the number of samples from each is (roughly) proportional to the weights column. If the weights column in your data frame represents probabilities of draws coming from each

Re: [R] How do I generate one vector for every row of a data frame?

2008-12-18 Thread Simon Knapp
... actually, the scaling of the weights was not required as it is done by sample anyway. On Fri, Dec 19, 2008 at 5:16 PM, Simon Knapp sleepingw...@gmail.com wrote: Your code will always generate the same number of samples from each of the normals specified on every call, where the number of

Re: [R] How do I generate one vector for every row of a data frame?

2008-12-18 Thread andrew
I think this should work rgmm - function(n, gmm) { M - sample(1:4, n, replace = TRUE, prob= gmm$weight) mean - gmm[M, ]$mean sd - gmm[M, ]$sd return(gmm[M,]$sd*rnorm(n) + gmm[M,]$mean) } hist(rgmm(1, gmm), breaks = 500) On Dec 19, 4:14 pm, Bill McNeill (UW)