Re: [R] Time series indexes

2005-04-27 Thread Thomas Petzoldt
Fernando Saldanha schrieb: I tried to assign values to specific elements of a time series and got in trouble. The code below should be almost self-explanatory. I wanted to assign 0 to the first element of x, but instead I assigned zero to the second element of x, which is not what I wanted. Is

Re: [R] Re: how to add a column with string values to a data frame while still converting them to factors

2005-04-27 Thread Uwe Ligges
avneet singh wrote: i got the first part: agm.data$ProdCategory=as.factor(agm.data$ProdCategory) the second i am still struggling with For the second part, see ?is.na. Uwe Ligges On 4/26/05, avneet singh [EMAIL PROTECTED] wrote: I have 2 questions. In essence i am trying to create product

Re: [R] how to modify and compile R sourse codes

2005-04-27 Thread David Whiting
Zhongming Yang [EMAIL PROTECTED] writes: You can get the source code from the source package and modify it. You'll have to read the relevant documentation about the tools you need to compile it---see the archives, there was a discussion recently about this, and see the documenation that comes

Re: [R] how to modify and compile R sourse codes

2005-04-27 Thread Uwe Ligges
Zhongming Yang wrote: Dear All: I am working on writing some R functions to make statistical reports automatically. Dr. Harrell's Hmisc has all the wonderful stuff. But sometimes I need change some formats, so I want to read through it and make some modifications to fit my project. Ideally,

Re: [R] Re: how to add a column with string values to a data frame while still converting them to factors

2005-04-27 Thread Petr Pikal
Hi On 26 Apr 2005 at 16:18, avneet singh wrote: i got the first part: agm.data$ProdCategory=as.factor(agm.data$ProdCategory) the second i am still struggling with ?is.na is.na(whatever) is what you probably want. Cheers Petr On 4/26/05, avneet singh [EMAIL PROTECTED] wrote:

Re: [R] making table() work

2005-04-27 Thread Ale iberna
I belive that the problem is not with the table, but with your predictions which are not 0s and 1s. Ales Ziberna - Original Message - From: Stephen Choularton [EMAIL PROTECTED] To: 'R Help' r-help@stat.math.ethz.ch Sent: Wednesday, April 27, 2005 4:19 AM Subject: [R] making table() work

Re: [R] survreg with numerical covariates

2005-04-27 Thread Ales Ziberna
As you can se from the example bellow, survreg works prefeclty fine with numerical values. (I'm runing R2.0.1 on WinXP(SP2) and 32bit AMD with survival version 2.17.). As the posting guide asks, plese provide a small example. Ales Ziberna library(survival) Loading required package: splines

Re: [R] good editor for R sources ? - Thanks

2005-04-27 Thread vincent
Thank you very much for all the useful answers. __ 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

[R] libz library missing while installing RMySQL

2005-04-27 Thread Sebastian Leuzinger
Hello Trying to install the MySQL package, I get the following error. The help archive contains something on this issue but did not help. I work on linux suse 9.3 Configuration error: Could not locate the library libz required by MySQL. The library libz however is not on any mirrors I

Re: [R] survreg with numerical covariates

2005-04-27 Thread Richard Mott
Ales - I have identified the problem. It is caused by missing data. In my previous posting I was analysing a dataset which happened to have 190 missing values in the covariate. I compared two models: r0 - survreg(s ~1) r1 - survreg(s~x) anova(r0,r1) I was using anova to investigate the

[R] dyn.load(), DLL, Fortran, TLNise software

2005-04-27 Thread accetta
Dear all, I would like to call TLNise (Two-Level Normal indipendent sampling estimation) software within R. This software estimates a hierarchical model and it can be download from Philip Everson's website at http://www.swarthmore.edu/NatSci/peverso1/TLNise/tlnise.htm;. The TLNise software

[R] DLL problem when using gcc+gsl

2005-04-27 Thread Vumani Dlamini
Dear list; This might sound a bit naive, but then I am new to linking C DLL's to R. I have built a DLL using GCC and am able to load the DLL in R (is.loaded(contents)==TRUE). When I include it in my function it returns NaN for all the variables. My R function is, dyn.load(c:/data/tempdll.dll)

Re: [R] dyn.load(), DLL, Fortran, TLNise software

2005-04-27 Thread Martin Maechler
accetta == accetta [EMAIL PROTECTED] on Wed, 27 Apr 2005 11:55:56 +0200 writes: accetta Dear all, I would like to call TLNise (Two-Level accetta Normal indipendent sampling estimation) software accetta within R. accetta This software estimates a hierarchical model and it

Re: [R] good editor for R sources ? CE is supported

2005-04-27 Thread Michael Grant
Just for the record and to avoid confusion: R IS supported in Crimson Editor. Look under syntax files 568 and 314. I've used it for a couple of years to no ill effect. It is fine for light use to moderate use. However, given the updates in R, maybe the syntax files are a little long in tooth in a

[R] Take a levels

2005-04-27 Thread Muhammad Subianto
Dear all, How can I take a levels from a dataset. For example, data(iris) x.iris - iris[,1:4] y.iris - iris[,5] y.iris [1] setosa setosa setosa setosa setosa setosa [7] setosa setosa setosa setosa setosa setosa [139] virginica virginica

Re: [R] Take a levels

2005-04-27 Thread Sean Davis
On Apr 27, 2005, at 8:21 AM, Muhammad Subianto wrote: Dear all, How can I take a levels from a dataset. For example, data(iris) x.iris - iris[,1:4] y.iris - iris[,5] y.iris [1] setosa setosa setosa setosa setosa setosa [7] setosa setosa setosa setosa setosa

Re: [R] Take a levels

2005-04-27 Thread Dimitris Rizopoulos
probably you want: levels(y.iris) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web:

Re: [R] Take a levels

2005-04-27 Thread Muhammad Subianto
Thanks you very much. levels(y.iris) Best regards, Muhammad Subianto [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

RE: [R] Take a levels

2005-04-27 Thread Eric Lecoutre
Well... did you look at the help page on factors??? Did you even make a search? The answer is within your question: levels(iris[,5]) [1] setosa versicolor virginica Eric -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muhammad Subianto

Re: [R] Time series indexes

2005-04-27 Thread Gabor Grothendieck
On 4/26/05, Fernando Saldanha [EMAIL PROTECTED] wrote: I tried to assign values to specific elements of a time series and got in trouble. The code below should be almost self-explanatory. I wanted to assign 0 to the first element of x, but instead I assigned zero to the second element of x,

Re: [R] Error using e1071 svm: NA/NaN/Inf in foreign function call

2005-04-27 Thread Achim Zeileis
On Wed, 27 Apr 2005 10:25:55 +0100 João Mendes Moreira wrote: My mistake. I am sending the ImageBeforeError.RData file. No, no, no! Please the read the posting guide and please read the answers that were posted for you. As you obviously did not do that, let me read it to you again: Z

[R] Split dataset as factor and numeric

2005-04-27 Thread Jan Sabee
Dear all, If I have dataset like, A125 B 2 AA0 C 0 A11 B 3 A10 C 3 B 0 A145 A17 C 0 B 0 A10 B 6 B 3 Is there any function to split like, A125 A11 A10 A145 A17 A10 or AA0 C 0 A10 B 0 B 0

[R] R for Windows MSI Installation File

2005-04-27 Thread Richard Abraham
Hi, Just wondering if anyone has created (or knows where one is available from) an MSI installation file for R v2.0.1? Many thanks, Richard. Richard Abraham Senior Information Systems Officer Department of Social Medicine, University of

Re: [R] Split dataset as factor and numeric

2005-04-27 Thread Sundar Dorai-Raj
Jan Sabee wrote on 4/27/2005 5:58 AM: Dear all, If I have dataset like, A125 B 2 AA0 C 0 A11 B 3 A10 C 3 B 0 A145 A17 C 0 B 0 A10 B 6 B 3 Is there any function to split like, A125 A11 A10 A145 A17 A10 or AA

[R] date format

2005-04-27 Thread alessandro carletti
Hi, I'm trying to convert a vector containing dates in character format (dd/mm/yy): mdy.date (from date package) seems to be able to do that, but it returns to me a vector containing julian dates... but negative! for example: 16/12/03 is converted into -20470 it is because R recognizes year

Re: [R] lattice plot problem!

2005-04-27 Thread Deepayan Sarkar
On Tuesday 26 April 2005 21:52, Ivy_Li wrote: Hello everybody, Could I consult you two questions? Recently I write some code about lattice plot. 1) bwplot function I know the lattice default background color is grey and the box color is green, but I don't like the color. So I change the

Re: [R] date format

2005-04-27 Thread Dimitris Rizopoulos
you could use as.Date(), i.e., ss - 16/12/03 as.Date(ss, %d/%m/%y) julian(as.Date(ss, %d/%m/%y)) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel:

Re: [R] date format

2005-04-27 Thread Prof Brian Ripley
You haven't even begun to tell us how you are doing this. R does not itself convert dates to numbers, to wit: as.Date(16/12/03, %d/%m/%y) [1] 2003-12-16 Here's one way: x - as.Date(16/12/03, %d/%m/%y) xx - as.POSIXlt(x) xx$year - xx$year-100 as.Date(xx) On Wed, 27 Apr 2005, alessandro carletti

Re: [R] R for Windows MSI Installation File

2005-04-27 Thread Philippe Grosjean
Richard Abraham wrote: Hi, Just wondering if anyone has created (or knows where one is available from) an MSI installation file for R v2.0.1? Many thanks, Richard. The setup program build by Inno Setup, as you find it in the binaries section of CRAN is much better than what you would get with

Re: [R] R for Windows MSI Installation File

2005-04-27 Thread Prof Brian Ripley
On Wed, 27 Apr 2005, Richard Abraham wrote: Brian, I can use an MSI installer package to install R on any number of Windows PCs without leaving my desk by using Windows' Group Policy. Is this possible using R's own scriptable installer? The FAQ doesn't say. Well, did you look at the reference

[R] How to add some of data in the first place dataset

2005-04-27 Thread Muhammad Subianto
Dear R-help, First I apologize if my question is quite simple. I need add some of data in the first place my dataset, how can I do that. I have tried with rbind, but I did not succes. 0.1 3.6 0.4 0.9 rose 4.1 4.0 1.2 1.2 rose 4.4

Re: [R] R for Windows MSI Installation File

2005-04-27 Thread Richard Abraham
Brian, I can use an MSI installer package to install R on any number of Windows PCs without leaving my desk by using Windows' Group Policy. Is this possible using R's own scriptable installer? The FAQ doesn't say. Thanks, Rich. --On 27 April 2005 14:17 +0100 Prof Brian Ripley [EMAIL PROTECTED]

Re: [R] Time series indexes

2005-04-27 Thread Fernando Saldanha
Thanks, Gabor. Reading your suggestion (and a previous one as well) I realized I surely expressed myself quite badly when asking the question. Luckily one person privately suggested the following solution, which is exactly what I was looking for: x[time(x)==2] - 0 This works wonderfully.

[R] Error list and debugging R code

2005-04-27 Thread Tuszynski, Jaroslaw W.
Hi, I am trying to debug my code and looking for any tool to help me out with it. My main problem is with the error messages I can not figure out where they come from (what function produced them) and what do they mean. Is there such a think as list of error messages produced by R and standard R

[R] How to add some of data in the first place dataset

2005-04-27 Thread Tyler Smith
Try this: x- matrix(1:12, nrow = 4, byrow = T) y - matrix (13:24, nrow=4, by.row=T) To add the rows of y before the rows of x: rbind(y,x) -- Tyler Smith __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] How to add some of data in the first place dataset

2005-04-27 Thread Henric Nilsson
Muhammad Subianto said the following on 2005-04-27 15:48: Dear R-help, First I apologize if my question is quite simple. I need add some of data in the first place my dataset, how can I do that. I have tried with rbind, but I did not succes. Can you send a reproducible example where rbind

Re: [R] libz library missing while installing RMySQL

2005-04-27 Thread Sebastian Leuzinger
Thanks Jari although these libraries are installed now, I get the following message: Configuration error: could not find the MySQL installation include and/or library directories. Manually specify the location of the MySQL libraries and the header files and re-run R CMD INSTALL. Somebody

Re: [R] How to add some of data in the first place dataset

2005-04-27 Thread Arne Henningsen
If you want to add rows to a data frame using rbind, your additional rows must be in a data frame with the same (column) names. R data( iris ) R a - data.frame( Sepal.Length=c(1:4), Sepal.Width=c(2:5), Petal.Length=c(3:6), Petal.Width=c(4:7), Species=rep(rosa,4)) R b - iris[1:10,] R

[R] How to break data in quantiles properly?

2005-04-27 Thread Eric Rodriguez
Hi, I would like to break a dataset in n.classes quantiles. Till now, I used the following code: Classify.Quantile - function (dataset, nclasses = 10) { n.probs - seq(0,1,length=nclasses+1) n.labels = paste(C, 1:nclasses-1, sep=) n.rows - nrow(dataset) n.cols -

[R] Re: How to add some of data in the first place dataset

2005-04-27 Thread Muhammad Subianto
Thanks all for your help. Kind regards, Muhammad Subianto __ 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] Error list and debugging R code

2005-04-27 Thread Uwe Ligges
Tuszynski, Jaroslaw W. wrote: Hi, I am trying to debug my code and looking for any tool to help me out with it. My main problem is with the error messages I can not figure out where they come from (what function produced them) and what do they mean. Is there such a think as list of error messages

[R] Fitting a kind of Proportional Odds Modell using nlme, polr, lrm or ordgee

2005-04-27 Thread Henning Henke
Hello, I'm trying to fit a special kind of proportional odds model from: Whitehead et al. (2001). Meta-analysis of ordinal outcome using individual patient data. Statistics in medicine 20: 2243-2260. (model 2) The data are as follows: library(nlme) library(geepack) library(Design)

[R] Data() and CSV files

2005-04-27 Thread McGehee, Robert
Hello, For reasons I don't understand, data() imports CSV (Comma-Separated Values) as if they were delimited by semicolons instead of commas. (Are semicolon-separated Comma-Separated-Value files common somewhere?) Given that this is the case, if I choose to put comma-delimited CSV files in my

RE: [R] Error list and debugging R code

2005-04-27 Thread Berton Gunter
I have found the tools listed by Uwe to be sufficient for my needs, but you may also be interested in Mark Bravington's debug package. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. -

[R] R/Splus--Perl Interface ssh

2005-04-27 Thread XIAO LIU
Hi: I'm using RSPerl_0.6-3 calling R from Perl under UNIX system. My perl programs with the RSPerl work well in my computer. If submitting these programs to a UNIX system by 'ssh' or to GNQS system by 'qsub', these programs do not work even though both systems can run R. Details are

Re: [R] How to break data in quantiles properly?

2005-04-27 Thread Frank E Harrell Jr
Eric Rodriguez wrote: Hi, I would like to break a dataset in n.classes quantiles. Till now, I used the following code: Classify.Quantile - function (dataset, nclasses = 10) { n.probs - seq(0,1,length=nclasses+1) n.labels = paste(C, 1:nclasses-1, sep=) n.rows - nrow(dataset) n.cols -

Re: [R] Data() and CSV files

2005-04-27 Thread Peter Dalgaard
McGehee, Robert [EMAIL PROTECTED] writes: Hello, For reasons I don't understand, data() imports CSV (Comma-Separated Values) as if they were delimited by semicolons instead of commas. (Are semicolon-separated Comma-Separated-Value files common somewhere?) Given that this is the case, if I

[R] Recursive calculation of a series of values

2005-04-27 Thread Luis Torgo
Dear R-users, I'm felling kind of blocked on a quite simple problem and I wonder if someone could give me a help with it. My problem: x[0] = 100 x[1] = (1+v[1])*x[0] x[2] = (1+v[2])*x[1] ... i.e. x[i] = (1+v[i])*x[i-1] and x[0]=k Given a set of v values I wanted to obtain the corresponding x

[R] Question about R initial message

2005-04-27 Thread Laura Holt
Dear R: First of all, nothing is wrong! I just had a question about the following Natural language support but running in an English locale What does than mean, please? Thanks in Advance R 2.1.0 Windows Laura Holt mailto: [EMAIL PROTECTED] __

RE: [R] Recursive calculation of a series of values

2005-04-27 Thread Berton Gunter
Algebra: cumprod(1+v)*x[0] -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

[R] its package: inexplicable date-shifting ?!

2005-04-27 Thread Chalasani, Prasad
Can someone please explain to me why the dates get shifted by one day when I create an its ( irregular time-series ) object from a matrix for which I've assigned row names. E.g. in the example run below, why does the its object have dates one-shifted from my original dates?

Re: [R] Order of boxes in boxplot()

2005-04-27 Thread Jim Porzak
On Thu, 7 Apr 2005, michael watson (IAH-C) wrote: Sorry for such an inane question - how do I control the order in which the boxes are plotted using boxplot() when I pass it a formula and a data.frame? It seems that the groups are plotted in alphabetical order... I want to change this

[R] Density curve over a histogram

2005-04-27 Thread Paul Smith
Dear All I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? Thanks in advance, Paul __ R-help@stat.math.ethz.ch

Re: [R] R/Splus--Perl Interface ssh

2005-04-27 Thread Prof Brian Ripley
On Wed, 27 Apr 2005, XIAO LIU wrote: I'm using RSPerl_0.6-3 calling R from Perl under UNIX system. My perl programs with the RSPerl work well in my computer. If submitting these programs to a UNIX system by 'ssh' or to GNQS system by 'qsub', these programs do not work even though both systems

Re: [R] Question about R initial message

2005-04-27 Thread Prof Brian Ripley
On Wed, 27 Apr 2005, Laura Holt wrote: I just had a question about the following Natural language support but running in an English locale What does than mean, please? See the `R Installation and Administration' manual, which does explain this. In short it means that your version of R has NLS

Re: [R] Density curve over a histogram

2005-04-27 Thread Achim Zeileis
On Wed, 27 Apr 2005 19:06:07 +0100 Paul Smith wrote: Dear All I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? To quote Simon `Yoda' Blomberg: This is R.

Re: [R] Density curve over a histogram

2005-04-27 Thread Uwe Ligges
Paul Smith wrote: Dear All I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? Yes. If you like to know how, see e.g. ?hist and ?curve. Uew Ligges Thanks in

Re: [R] Question about R initial message

2005-04-27 Thread Peter Dalgaard
Laura Holt [EMAIL PROTECTED] writes: Dear R: First of all, nothing is wrong! I just had a question about the following Natural language support but running in an English locale What does than mean, please? $ LANG=pt_BR.UTF8 ~/r-devel/BUILD/bin/R R : Copyright 2005, The R Foundation

Re: [R] Density curve over a histogram

2005-04-27 Thread Vincent Goulet
Le 27 Avril 2005 14:06, Paul Smith a écrit : I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? Sure. See curve() with add=TRUE. Don't forget to use prob=TRUE

Re: [R] Density curve over a histogram

2005-04-27 Thread Paul Smith
On 4/27/05, Achim Zeileis [EMAIL PROTECTED] wrote: I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? To quote Simon `Yoda' Blomberg: This is R. There is

Re: [R] Density curve over a histogram

2005-04-27 Thread Peter Dalgaard
Paul Smith [EMAIL PROTECTED] writes: Dear All I would like to draw a picture with the density curve of a normal distribution over a histogram of a set of random numbers extracted from the same normal distribution. Is that possible? Yes. If you look at the scripts that go with the ISwR

Re: [R] its package: inexplicable date-shifting ?!

2005-04-27 Thread Gabor Grothendieck
I don't use 'its' enough to really know but usually when you see dates off by one and are using POSIXct (which has time zone support) -- POSIXct is what 'its' uses, it signals that the time zone is different than what you expected. Try to specify the time zone explicitly if 'its' supports it.

[R] Closing RGui help windows

2005-04-27 Thread Ronnen Levinson
Hi. I often wind up with many help windows cluttering my RGui screen when running Windows R 2.0.1. Is there an R instruction to close one or more help windows, or an RGui command to close all help windows? Yours truly, /Ronnen. /P.S. E-mailed CC:s of posted replies appreciated.

[R] interval censoring case 1 or current status data

2005-04-27 Thread Chao Zhu
Dear all, Is there a function in R dealing with the NPMLE for current status data or interval censored case 1 data? Thanks, Jimmy [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

[R] Defining binary indexing operators

2005-04-27 Thread Ali -
Assume we have a function like: foo - function(x, y) how is it possible to define a binary indexing operator, denoted by $, so that x$y functions the same as foo(x, y) __ R-help@stat.math.ethz.ch mailing list

[R] assign to an element of a vector

2005-04-27 Thread Fernando Saldanha
I am trying to find a way to assign values to elements of a vector that will be defined by a user. So I don't have the name of the vector and cannot hard code the assignment in advance. In the example below I have to get() the vector using its name. When I try to assign to an element I get an

Re: [R] interval censoring case 1 or current status data

2005-04-27 Thread Robert Gentleman
Yes, the Icens package handles all forms of censored data (1-dim) On Apr 27, 2005, at 11:59 AM, Chao Zhu wrote: Dear all, Is there a function in R dealing with the NPMLE for current status data or interval censored case 1 data? Thanks, Jimmy [[alternative HTML version deleted]]

RE: [R] assign to an element of a vector

2005-04-27 Thread Chalasani, Prasad
how about assign( 'a', { z - get('a'); z[1] - 0; z } ) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fernando Saldanha Sent: Wednesday, April 27, 2005 3:22 PM To: Submissions to R help Subject: [R] assign to an element of a vector I am trying to

[R] [R-pkgs] GPArotation package

2005-04-27 Thread Paul Gilbert
We have just put a package GPArotation on CRAN. The functions in this package perform an number of different orthogonal and oblique rotations for factor analysis, using the gradient projection algorithm described in Coen A. Bernaards and Robert I. Jennrich (2005), Gradient Projection

RE: [R] Defining binary indexing operators

2005-04-27 Thread Huntsinger, Reid
That sounds like a recipe for headaches. If you want to use x$y because you want a certain kind of x to act like a list with components for certain y, then you probably want to make a class of objects (x) which have x$y implemented as foo(x,y). That way you won't break existing code. Reid

Re: [R] Closing RGui help windows

2005-04-27 Thread Prof Brian Ripley
No, and in 6 years of that interface, no one else has asked. (The information on open windows is not even retained.) You might like to try the single-window pager option in the preferences. On Wed, 27 Apr 2005, Ronnen Levinson wrote: I often wind up with many help windows cluttering my RGui

RE: [R] Defining binary indexing operators

2005-04-27 Thread Huntsinger, Reid
I should have added that if you're not wedded to $ you can do $ %f% - function(x,y) foo(x,y) for whatever name f you want, and then %f% is a binary infix operator form of foo(). Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

Re: [R] Defining binary indexing operators

2005-04-27 Thread Gabor Grothendieck
On 4/27/05, Ali - [EMAIL PROTECTED] wrote: Assume we have a function like: foo - function(x, y) how is it possible to define a binary indexing operator, denoted by $, so that x$y functions the same as foo(x, y) Here is an example. Note that $ does not evaluate y so you have

RE: [R] Advice for calling a C function

2005-04-27 Thread Huntsinger, Reid
You have the dimensions switched, in double x [*MATDESC][*OBJ]; so when the dimensions aren't equal you do get odd things. You might be better off defining functions to index into mat with a pair of subscripts directly (.C() copies the argument anyway). Come to think of it, there might be

Re: [R] Defining binary indexing operators

2005-04-27 Thread Tony Plate
It's not necessary to be that complicated, is it? AFAIK, the '$' operator is treated specially by the parser so that its RHS is treated as a string, not a variable name. Hence, a method for $ can just take the indexing argument directly as given -- no need for any fancy language tricks

Re: [R] Defining binary indexing operators

2005-04-27 Thread Ali -
Assume we have a function like: foo - function(x, y) how is it possible to define a binary indexing operator, denoted by $, so that x$y functions the same as foo(x, y) Here is an example. Note that $ does not evaluate y so you have to do it yourself: x - structure(3, class =

[R] tcl/tk problem

2005-04-27 Thread Jennifer Skene
I have JUST started using R. I am using R 2.0.1 on a mac (os x) to run another program (called GRASPER, Generalized Regression Analysis and Spatial Prediction for R). When I try to run Grasper, I get an error for tcl/tk: library(grasper) Loading required package: mgcv This is mgcv 1.1-8

[R] Getting the name of an object as character

2005-04-27 Thread Ali -
This could be really trivial, but I cannot find the right function to get the name of an object as a character. Assume we have a function like: getName - function(obj) Now if we call the function like: getName(blabla) and 'blabla' is not a defined object, I want getName to return blabla. In

[R] How to specify the hierarchical structure of a split plot using lmer ??

2005-04-27 Thread Søren Højsgaard
I have a problem getting the lmer function of the lme4 package to use the appropriate degrees of freedom for testing. Consider the Semiconductor data from the SASmixed package: library(SASmixed) Semi.lme - lme(resistance ~ ET * position, random=~1|Grp, data=Semiconductor) anova(Semi.lme)

Re: [R] Defining binary indexing operators

2005-04-27 Thread Tony Plate
Excuse me! I misunderstood the question, and indeed, it is necessary be that complicated when you try to make x$y behave the same as foo(x,y), rather than foo(x,y) (doing the former would be inadvisible, as I think someelse pointed out too.) Tony Plate wrote: It's not necessary to be that

[R] Is this a bug in R?

2005-04-27 Thread Revilla,AJ (pgt)
Dear all, I am trying to fit a nonlinear model with a autocorrelation term, but everytime I type in the command, I got an error message from Winwows and R closes itself. The command line is as follows: mod1-nlme(V~A*exp(-B*A.O)*Vac.t.1.,data,fixed=A+B~1,random=A+B~1|ORDINAL,+

Re: [R] Getting the name of an object as character

2005-04-27 Thread Marc Schwartz
On Wed, 2005-04-27 at 23:03 +, Ali - wrote: This could be really trivial, but I cannot find the right function to get the name of an object as a character. Assume we have a function like: getName - function(obj) Now if we call the function like: getName(blabla) and 'blabla'

Re: [R] Defining binary indexing operators

2005-04-27 Thread Gabor Grothendieck
On 4/27/05, Ali - [EMAIL PROTECTED] wrote: Assume we have a function like: foo - function(x, y) how is it possible to define a binary indexing operator, denoted by $, so that x$y functions the same as foo(x, y) Here is an example. Note that $ does

RE: [R] assign to an element of a vector

2005-04-27 Thread Liaw, Andy
You did not explain the full context of what you are trying to do. Perhaps this could help: varName - as.name(bahbah) varName bahbah substitute(a[1] - 0, list(a=varName)) bahbah[1] - 0 So you could perhaps eval() this expression. Andy From: Fernando Saldanha I am trying to find a way

Re: [R] How to specify the hierarchical structure of a split plot using lmer ??

2005-04-27 Thread Douglas Bates
Søren Højsgaard wrote: I have a problem getting the lmer function of the lme4 package to use the appropriate degrees of freedom for testing. Consider the Semiconductor data from the SASmixed package: library(SASmixed) Semi.lme - lme(resistance ~ ET * position, random=~1|Grp, data=Semiconductor)

Re: [R] Advice for calling a C function

2005-04-27 Thread Tyler Smith
Thank you. I can't believe how much time I spent going over that short bit of code without noticing that I had switched the dimensions. I was sure there was some arcane bit of pointer-lore that was eluding me. Patrick Burns pointed out an alternative approach to me, leaving the data in the

Re: [R] Defining binary indexing operators

2005-04-27 Thread Ali -
Here is an example. Note that $ does not evaluate y so you have to do it yourself: x - structure(3, class = myclass) y - 5 foo - function(x,y) x+y $.myclass - function(x, i) { i - eval.parent(parse(text=i)); foo(x, i) } x$y # structure(8, class = myclass) If I got it right, in the

Re: [R] its package: inexplicable date-shifting ?!

2005-04-27 Thread Dirk Eddelbuettel
On 27 April 2005 at 13:45, Chalasani, Prasad wrote: | Can someone please explain to me why | the dates get shifted by one day | when I create an its ( irregular time-series ) | object from a matrix for which I've | assigned row names. I think you initiated the its() object the wrong way --

Re: [R] Defining binary indexing operators

2005-04-27 Thread Gabor Grothendieck
On 4/27/05, Ali - [EMAIL PROTECTED] wrote: Here is an example. Note that $ does not evaluate y so you have to do it yourself: x - structure(3, class = myclass) y - 5 foo - function(x,y) x+y $.myclass - function(x, i) { i - eval.parent(parse(text=i)); foo(x, i)

Re: [R] Is this a bug in R?

2005-04-27 Thread Prof Brian Ripley
You are in fact using the contributed package 'nlme', not just R. Please read both the section on BUGS in the FAQ and the posting guide, and send a reproducible example to the nlme maintainer. One thing the posting guide asks for is a useful subject line. Something like `A crash when