Re: [R] write.dta limits

2005-06-07 Thread David Whiting
Thomas Lumley [EMAIL PROTECTED] writes: On Mon, 6 Jun 2005, Jean Eid wrote: Hope everyone id doing great .. Just need some clarification over the limit of write.dta. I have some coauthors that use stata and I need to send them my data in .dta format. the data.frame is 41706x229 and I get

Re: [R] How to change the value of a class slot

2005-06-07 Thread Uwe Ligges
Ross Boylan wrote: On Sat, Jun 04, 2005 at 07:08:56PM +0200, Martin Maechler wrote: Ross nextPath - function(pm){ #pm is a CompletePathMaker Ross[EMAIL PROTECTED] - [EMAIL PROTECTED](1) Ross [etc] If your nextPath function has 'pm' as its last statement it will return the

Re: [R] Porting Matlab code to R

2005-06-07 Thread Gavin Simpson
[EMAIL PROTECTED] wrote: Hello, I'm looking at porting code written for Matlab to R. However, I don't have sufficient knowledge of Matlab to know whether it's feasible or appropriate. If there is anyone who has any experience in this and could provide some advice, I'd be grateful.

RE: [R] names of functions in a library

2005-06-07 Thread Prof Brian Ripley
On Mon, 6 Jun 2005, Liaw, Andy wrote: From: Duncan Murdoch On 6/6/2005 4:43 PM, Omar Lakkis wrote: How can I get a list of the names of all exported functions in a library? I load my library using library() and then want to dynamically get all functions that start with test. to

[R] R and MLE

2005-06-07 Thread Ajay Narottam Shah
I learned R MLE in the last few days. It is great! I wrote up my explorations as http://www.mayin.org/ajayshah/KB/R/mle/mle.html I will be most happy if R gurus will look at this and comment on how it can be improved. I have a few specific questions: * Should one use optim() or should one

[R] red noise

2005-06-07 Thread bongi
help Dear sirs,I'd like to add a red noise spectra to a periodogram: #given z as time series of 61 values z [1] 10500. 12044.6667 13589. 1. 9132.6667 7000. [7] 7000. 5464.6667 2735.1733 1048.3200 18843.0667 38235.2533 [13] 37907.4800 19892.2533 4269.0533

Re: [R] Building a R package under Windows XP

2005-06-07 Thread Uwe Ligges
Jagarlamudi, Choudary wrote: Hi all, I downloaded all the required r-tools from Dr.Brian Ripley's website. RCMD build dAnal Which version of R? The tools are no longer hosted on Brian Ripley's website, but on the one from Duncan Murdoch. So looks like your set of tools might be outdated.

[R] Variables values on intersected intervals

2005-06-07 Thread SAULEAU Erik-André
Dear R-list, i have a problem, in the framework of simulations, i want to vectorize for earning time: a variable, say X, has values on intervals and an other variable, say Y, has values on other intervals. For example Inf Sup X 0 2 1 2 42 4 63 and Inf

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread Chris Evans
On 6 Jun 2005 at 17:48, Sander Oom wrote: ... much snipped ... The whole point of a gallery is to show something to the user before the user knows what he is looking for. The R help functions currently available are hopeless when you have a picture of a graph in your head without knowing the

Re: [R] names of functions in a library

2005-06-07 Thread Henrik Bengtsson
For a generalization of this, see ll() in the R.oo package; library(R.oo) ll(mode=function, envir=base) member data.class dimension object.size 1 -function NULL 28 2 -.Datefunction NULL5996 3

Re: [R] how to create a variable to rank within subgroups

2005-06-07 Thread Denis Chabot
Thank you very much Andy, this is exactly what I was looking for. I did not know this function. Sincerely, Denis Chabot Le 06 juin 2005 à 21:21, Liaw, Andy a écrit : Try something like: g - gl(4, 5) x - sample(20) d - data.frame(g, x) d g x 1 1 10 2 1 3 3 1 11 4 1 12 5 1 20 6

Re: [R] how to create a variable to rank within subgroups

2005-06-07 Thread Peter Dalgaard
Denis Chabot [EMAIL PROTECTED] writes: Thank you very much Andy, this is exactly what I was looking for. I did not know this function. It's a horrible misnomer though (ave() is originally for replacing values with averages, but obviously has other uses). Any suggestions for a better name (or

[R] Conjoint in R

2005-06-07 Thread Cela, Jimmy (IHG)
Hello all, I am trying to apply a conjoint analysis in order to determine the best profile that captures the most preferred combination of levels of given categorical factors. For this a set of factors is given and initially a fractional factorial design has to be produced as a subset of all

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread Sander Oom
I agree that a wiki to facilitate submission of graph code could be very effective! Still needs to be well protected against vandalism. Seems a regular backup, to facilitate a clean restore, is the best approach. Romain, would you be willing to set up a wiki within the gallery. Think the wiki

Re: [R] (Off topic.) Observed Fisher information.

2005-06-07 Thread Duncan Murdoch
Rolf Turner wrote: I have been building an R function to calculate the ***observed*** (as opposed to expected) Fisher information matrix for parameter estimates in a rather complicated setting. I thought I had it working, but I am getting a result which is not positive definite. (One negative

Re: [R] A long digression on packages

2005-06-07 Thread Sander Oom
Oooops, already missed one: 5. search of the R mailing lists: http://maths.newcastle.edu.au/~rking/R/ ad5. never used this before. Think Google also does an excellent job finding these if you start search with R. Sander. Sander Oom wrote: Maybe some of this confusion about search

[R] Tabelle zu Matrix

2005-06-07 Thread Hansi Weissensteiner
Hallo! Ich habe ein Textdokument das folgenden Aufbau aufweisst: String Integer z.B. AAA10 BBB15 CCC12 BBB13 AAA11 DDD14 Mein Ziel ist es, die Daten in eine Matrix zu schreiben, ohne dabei mit Schleifen zu arbeiten. Ist dies möglich? Die entsprechende Matrix sollte dann

Re: [R] Conjoint in R

2005-06-07 Thread christian schulz
Hi, try package MNP for a starting point - which could be used for choice-based-conjoint! And here a paper which show you that a normal Conjoint design is nothing others than a regression analysis, which could ready easy used with little bit programming in R.

RE: [R] Conjoint in R

2005-06-07 Thread max.marinucci
Hi there Maybe you can find useful The isoreg {modreg} package which does Monotone regression. This is probably what you need to model your data. Nonetheless be aware you need to code properly your design matrix (use orthogonal polynomial codes) The difference in using MNP or ordered probit is

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread Nick Drew
I like the wiki idea! Does it make sense to connect the graph wiki to the existing R wiki? (http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl?RwikiHome) This might give the existing wiki a kickstart with some very valuable content. I realize they are maintained by different people but the whole

Re: [R] how to create a variable to rank within subgroups

2005-06-07 Thread Denis Chabot
I sure agree the name is not very helpful in guessing what it can do. May I suggest propagate? Denis Chabot Le 07 juin 2005 à 06:18, Peter Dalgaard a écrit : Denis Chabot [EMAIL PROTECTED] writes: Thank you very much Andy, this is exactly what I was looking for. I did not know this

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread Romain Francois
Le 07.06.2005 12:36, Sander Oom a écrit : I agree that a wiki to facilitate submission of graph code could be very effective! Still needs to be well protected against vandalism. Seems a regular backup, to facilitate a clean restore, is the best approach. Romain, would you be willing to set

Re: [R] how to create a variable to rank within subgroups

2005-06-07 Thread Gabor Grothendieck
On 07 Jun 2005 12:18:06 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: Denis Chabot [EMAIL PROTECTED] writes: Thank you very much Andy, this is exactly what I was looking for. I did not know this function. It's a horrible misnomer though (ave() is originally for replacing values with

Re: [R] Conjoint in R

2005-06-07 Thread James Reilly
Hi, The conf.design package should help you handle the experimental design side of your problem. Depending on your application, it may be unwise to assume that main effects will be enough, as interactions can often turn out to be important (at least in my experience with discrete conjoint).

Re: [R] Tabelle zu Matrix

2005-06-07 Thread Sander Oom
Why ask if you already know the answer. Did you try table()? Other commands related: reshape {stats} and xtabs {stats} I learned about this only a couple of days ago on this list! Meanwhile read the posting guide and send your requests in English. Good luck, Sander. Hansi Weissensteiner

[R] Smooth monotone estimation on R

2005-06-07 Thread Rafael Sebastian
Hello, We would like to apply the smooth monotone function to our data which correspond to a non-linear function. We follow the example posted on the web, but in our case it did not apply. We always get a straight line in response. Which parameters we should change. ind.basis =

[R] how to define functions in such a situation

2005-06-07 Thread Hu Chen
hi R folks, I need read a file from hardisk or www web. Then I need to define some new functions according to the contents of the read file. For example, i need write a package name mypackage like this: library(mypackage) read(some_file_on_web) #to see its content, suppose it contains:

[R] transform large matrix into list

2005-06-07 Thread Stefan Mischke
Dear List I need to transform a large matrix M with many NAs into a list L with one row for each non missing cell. Every row should contain the cell value in the first column, and its coordinates of the matrix in column 2 and 3. M: x1 x2 y1 1 2 y2 4 5 y3

[R] Re: how to define functions in such a situation

2005-06-07 Thread Hu Chen
I got a dirty way to solve this. write a temp .R source file including these new functions, then source(this_temp_file) but I don't know if there are some temp directory for R to store temp files? On 6/7/05, Hu Chen [EMAIL PROTECTED] wrote: hi R folks, I need read a file from hardisk or www

RE: [R] how to define functions in such a situation

2005-06-07 Thread Liaw, Andy
It't not clear to me exactly what you want and how you envision it could be done, but it probably helps to realize that functions in R (and S in general) are first class objects, so you can manipulate them pretty much like any other objects. You can compute them on-the-fly, e.g., by having a

[R] htlm3D made4

2005-06-07 Thread Navarre Sabine
Hi, I would like to know if people have found the package made4 to load! I would like the .zip If you have the @ on internet to load it please give me it! Thanks a lot, Sabine - [[alternative HTML version deleted]]

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread Sander Oom
Hi Romain, You have stuck your neck out which is great. You are however not responsible for all the work! Let others join in! Thus a wiki could provide opportunities for other people to contribute! I was suggesting that the wiki be used as a platform for people to submit code examples and

Re: [R] Re: how to define functions in such a situation

2005-06-07 Thread Sean Davis
Look at the documentation for source. You can source a file directly from the web: source('http://myserver.com/somefile_on_web.R') If that file contains R code for three functions, the functions will be visible and useable immediately in your workspace. Sean On Jun 7, 2005, at 8:58 AM, Hu

Re: [R] Re: how to define functions in such a situation

2005-06-07 Thread Uwe Ligges
Hu Chen wrote: I got a dirty way to solve this. write a temp .R source file including these new functions, then source(this_temp_file) Don't know if you really have to do it that way, but I also really don't understand what you are going to do... but I don't know if there are some

[R] factor2real strange!?

2005-06-07 Thread christian schulz
Hi, i get factors from oracle instead real or numeric, but have problems to convert. Where is my mistake? I can't rember have this difficulties like this? many thanks, christian vsub - subset(dm,select=c(DEBITS_POST3)) (vsub$DEBITS_POST3[1:4]) [1] 9,93 0 23,82 32,72 7936 Levels: 0 0,53

Re: [R] transform large matrix into list

2005-06-07 Thread Stefan Mischke
Ok, ok, I got it! Please don't laugh! My question is the example from the posting guide! Which even includes the answer. How embarrassing... Stefan Am 07.06.2005 um 14:55 schrieb Stefan Mischke: Dear List I need to transform a large matrix M with many NAs into a list L with one row for

Re: [R] transform large matrix into list

2005-06-07 Thread Dimitris Rizopoulos
one approach could be the following (maybe there is something better for large matrices): M - cbind(c(1, 4, 7, NA, 3, 2), c(2, 5, 8, 4, NA, 3)) ## d - dim(M) L - cbind(c(M), rep(1:d[2], each = d[1]), rep(1:d[1], d[2])) L[complete.cases(L), ] I hope it helps. Best, Dimitris

RE: [R] Re: how to define functions in such a situation

2005-06-07 Thread Liaw, Andy
help.search(temporary) tells you to look at ?tempfile. Andy From: Hu Chen I got a dirty way to solve this. write a temp .R source file including these new functions, then source(this_temp_file) but I don't know if there are some temp directory for R to store temp files? On 6/7/05,

RE: [R] htlm3D made4

2005-06-07 Thread Eric Lecoutre
have you tried using Google using keyword made4 ??? The second item gives: made4 Package: made4. Description: Multivariate data analysis and graphical display of microarray data. Functions include between group analysis and coinertia ...

RE: [R] transform large matrix into list

2005-06-07 Thread Liaw, Andy
Here's one way to do it: M x1 x2 y1 1 2 y2 4 5 y3 7 8 (L - cbind(v=c(M), x=c(col(M)), y=c(row(M v x y [1,] 1 1 1 [2,] 4 1 2 [3,] 7 1 3 [4,] 2 2 1 [5,] 5 2 2 [6,] 8 2 3 (The seemingly extraneous c()'s are to drop the dimensions of those matrices.) Are you sure your L[3, 3] is

[R] ordglm -- simple question

2005-06-07 Thread Anders Schwartz Corr
My attempt to test a model using ordglm code is running into problems, and I thought if you have a moment you might illucidate the situation. Here is the data: http://www.people.fas.harvard.edu/~corr/6.4.05.RData Here is the code: # I coerce tcn8 matrix data to a vector, because ordglm will

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread Dan Bolser
On Tue, 7 Jun 2005, Sander Oom wrote: Hi Romain, You have stuck your neck out which is great. You are however not responsible for all the work! Let others join in! Thus a wiki could provide opportunities for other people to contribute! I was suggesting that the wiki be used as a platform for

Re: [R] factor2real strange!?

2005-06-07 Thread Uwe Ligges
christian schulz wrote: Hi, i get factors from oracle instead real or numeric, but have problems to convert. Where is my mistake? I can't rember have this difficulties like this? many thanks, christian Please look at your numbers: 9,93, this includes , instead of the correct decimal point

RE: [R] transform large matrix into list

2005-06-07 Thread Jim Brennan
First it looks like in L you need a 3 in row 3 col 2. Anyway I think this is a non elegant way to do it without a loop that you can easily improve I imagine and should be faster than the loop. You will have to adjust the numbers to fit you matrix size etc.

Re: [R] write.dta limits

2005-06-07 Thread Thomas Lumley
On Tue, 7 Jun 2005, David Whiting wrote: When I have encountered this error message in the past seems to have resulted from a blank/empty level in a factor or an empty character. Thanks. That is useful. I wasn't claiming that was no bug, just that it wasn't a limit on the file size.

Re: [R] Strange characters in 2.1.0?

2005-06-07 Thread Martin Maechler
Dan == Dan Bolser [EMAIL PROTECTED] on Mon, 6 Jun 2005 14:48:50 +0100 (BST) writes: Dan On Mon, 6 Jun 2005, Douglas Bates wrote: On 6/6/05, Dan Bolser [EMAIL PROTECTED] wrote: Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Signif. codes: 0 8098***8099

Re: [R] Conjoint in R

2005-06-07 Thread Jonathan Baron
Another approach, not mentioned yet, is to use ace, in the acepack package. I have used this in an article (with Andy Gurmankin) coming out soon in Memory and Cognition, which I could send by email. It isn't obvious to me that this will (or that it won't) work with a fractional factorial design;

[R] How to detect a closed socket when writing?

2005-06-07 Thread rsubscriber
Hi, is it possible to detect, whether the other side has closed a socket connection when writing on this socket? When i am trying this with two R instances R 1 and R 2, i expected that the last writeLines would give an error, but the call seems to be successfull: R 1

[R] Downloading the basic package

2005-06-07 Thread Navarre Sabine \(stu\)
Hi, I search the basic package via internet! could you please help me if you have found it! Thanks Sabine [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] ordglm -- simple question

2005-06-07 Thread Achim Zeileis
On Tue, 7 Jun 2005 09:48:13 -0400 (EDT) Anders Schwartz Corr wrote: My attempt to test a model using ordglm code is running into problems, and I thought if you have a moment you might illucidate the situation. Please indicate which package you are using, I guess you are referring to ordglm()

[R] without a loop

2005-06-07 Thread Omar Lakkis
tmp - c(-1,NA,NA,1,1,NA,NA,1) without using a loop, how can I replace all NAs in the list above with the previous none NA value in the list? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Downloading the basic package

2005-06-07 Thread John Sorkin
From you message it is difficult to tell what you are looking for. If you are looking for R, try http://cran.r-project.org/. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC and University of Maryland School of Medicine Claude Pepper OAIC

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread David Forrest
On Tue, 7 Jun 2005, Dan Bolser wrote: ... I agree, but its hard to get people contributing without something centralized (some central autohrity). The problem with the existing wiki http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl?RwikiHome Is that it currenlty does not support images (afaik).

Re: [R] transform large matrix into list

2005-06-07 Thread james . holtman
x.1 [,1] [,2] [1,]14 [2,]25 [3,] NA6 cbind(x.1[!is.na(x.1)], which(!is.na(x.1), arr.ind=TRUE)) row col [1,] 1 1 1 [2,] 2 2 1 [3,] 4 1 2 [4,] 5 2 2 [5,] 6 3 2 Jim __ James Holtman

Re: [R] without a loop

2005-06-07 Thread Achim Zeileis
On Tue, 7 Jun 2005 11:02:13 -0400 Omar Lakkis wrote: tmp - c(-1,NA,NA,1,1,NA,NA,1) without using a loop, how can I replace all NAs in the list above with the previous none NA value in the list? Package zoo contains a generic function na.locf (last observation carried forward) which handles

Re: [R] without a loop

2005-06-07 Thread Spencer Graves
How about the following: tmp - c(-1,NA,NA,1,1,NA,NA,1) replaceNA - function(x){ iNA - which(is.na(x)) if(length(iNA) %in% c(0, length(x))) return(x) iNA1 - iNA-1 iNA1[iNA==0] - length(x) x[iNA] - x[iNA1] replaceNA(x) }

Re: [R] without a loop

2005-06-07 Thread Gabor Grothendieck
On 6/7/05, Omar Lakkis [EMAIL PROTECTED] wrote: tmp - c(-1,NA,NA,1,1,NA,NA,1) without using a loop, how can I replace all NAs in the list above with the previous none NA value in the list? This is known as last occurrence carried forward (LOCF) and is implemented in both the 'zoo' and 'its'

Re: [R] Strange characters in 2.1.0?

2005-06-07 Thread Dan Bolser
On Tue, 7 Jun 2005, Martin Maechler wrote: Dan == Dan Bolser [EMAIL PROTECTED] on Mon, 6 Jun 2005 14:48:50 +0100 (BST) writes: Dan On Mon, 6 Jun 2005, Douglas Bates wrote: On 6/6/05, Dan Bolser [EMAIL PROTECTED] wrote: Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread Dan Bolser
On Tue, 7 Jun 2005, David Forrest wrote: On Tue, 7 Jun 2005, Dan Bolser wrote: ... I agree, but its hard to get people contributing without something centralized (some central autohrity). The problem with the existing wiki http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl?RwikiHome Is that it

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread David Forrest
On Tue, 7 Jun 2005, Dan Bolser wrote: On Tue, 7 Jun 2005, David Forrest wrote: On Tue, 7 Jun 2005, Dan Bolser wrote: ... I agree, but its hard to get people contributing without something centralized (some central autohrity). The problem with the existing wiki

Re: [R] Unable to compile R-2.1.0

2005-06-07 Thread Rainer Hurling
Prof Brian Ripley wrote: This has been reported to R-bugs twice already (and also on the lists): it seems autoconf and FreeBSD are making different assumptions. If you look in today's R-devel archive you will see the requests for information I set on the second report. It seems no one using

RE: [R] transform large matrix into list

2005-06-07 Thread Huntsinger, Reid
This is almost the triplet representation of sparse matrices, except the triplet representation excludes zero entries. If you have a lot of zeros, it would be worth a look at SparseM and Matrix. Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] R Graph Gallery : categorization of the graphs

2005-06-07 Thread David Forrest
On Tue, 7 Jun 2005, Dan Bolser wrote: ... http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl?Tips_And_Examples Great! We would need an image bin to support this though (for the average user). Hi Dan all http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl?UsePictures This page demonstrates the use

[R] reading non-existing files

2005-06-07 Thread Dave Evens
Dear all, I'm trying to read to a collection of files in a loop using odbcConnectExcel - but not all of the files exist. This is the code I have for(i in 1:no.of.subs){ channel - odbcConnectExcel(paste(working.dir, subs[i], .xls, sep=)) datafiles[[i]] - as.matrix(sqlFetch(channel, Data))

[R] Functions within functions in R and S-Plus

2005-06-07 Thread Victor Gravenholt
Sorry to bother you about a S-Plus related problem, but I hope someone can help. I have tried to translate some code from R to S-Plus (I have colleague that insists on using S-Plus. And yes, I have tried to make him change to R...) The following code works out fine in R, but in S-Plus (S-PLUS

[R] Function inside tapply

2005-06-07 Thread dscully
I'm new to R and not an experienced writer of programs, which may help explain my question. I wish to create a table or data frame which contains the quantiles of the columns in the data frame DF.I wish to produce a table T where T[1] shows me the quantiles of column DF[1] right up

[R] user-defined spatial correlation structure in geeglm/geese

2005-06-07 Thread Swantje Löbel
Dear all, We have got data (response and predictor variables) for each country of the world; I started by fitting standard GLM and tested for spatial correlation using variogram models (geoR) fitted to the residuals of the GLM. Spatial autocorrelation is significant. Therefore, I think about

RE: [R] reading non-existing files

2005-06-07 Thread bogdan romocea
file.exists(): if(!file.exists(your.file)) next Or, try(): your.data - try(as.matrix(whatever)) if (class(your.data) == try-error) {something went wrong / the file doesn't exist - just for logging, the code will not fail} -Original Message- From: Dave Evens [mailto:[EMAIL PROTECTED]

RE: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Liaw, Andy
The easiest way, perhaps, is to assign the internal functions to frame 1: mainfunc - function(x){ + + est - function(x,par){ + abs(sum(par*x)) + } + + func - function(par,x){ + est(x,par) + } + + est.theta - function(x){ + optimize(func,lower=-10, upper=20,x=x)$minimum + } + +

RE: [R] Function inside tapply

2005-06-07 Thread Liaw, Andy
Is this what you want to do? DF - data.frame(matrix(runif(500), ncol=5)) (DFq - sapply(DF, quantile, probs=seq(.1, .9, by=.1))) X1 X2X3 X4X5 10% 0.1175181 0.05375085 0.1023331 0.09187593 0.1508769 20% 0.2139076 0.20185996 0.2193513 0.21401223 0.2211100

Re: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Sundar Dorai-Raj
Victor Gravenholt wrote: Sorry to bother you about a S-Plus related problem, but I hope someone can help. I have tried to translate some code from R to S-Plus (I have colleague that insists on using S-Plus. And yes, I have tried to make him change to R...) The following code works out fine

Re: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Spencer Graves
How about the following: mainfunc - function(x){ est - function(x,par){ abs(sum(par*x)) } func - function(par,x, est.=est){ est.(x,par) } est.theta - function(x, func.=func, est.=est){ optimize(func.,lower=-10, upper=20,x=x, est.=est.)$minimum } est.theta(x,

Re: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Spencer Graves
p.s. This modification gave the same answer for me in both S-Plus 6.2 and R 2.1.0 patched under Windows XP. Spencer Graves wrote: How about the following: mainfunc - function(x){ est - function(x,par){ abs(sum(par*x)) } func - function(par,x, est.=est){ est.(x,par) } est.theta -

[R] about tables

2005-06-07 Thread secretario academico FACEA
Hi dear all I'm doing some contingency tables and I'd like to know if it is posible to make only one table in R that shows me the responses of people who visit a place with some frecuency about one question with two posibilities (they are treated like two variables with options). I'm thinking

[R] multiple plots

2005-06-07 Thread alex diaz
Hi: I am learning to use R and I am experiencing some difficulties in writing a function to produce multiple plots. This is a single plot Subset(myframe, color==”blue” class==1) Plot(myframe$p1, myframe$p2) My problem is that I have six colors (blue, red, green,) and 10 classes, that is

[R] Error calling read.table from Python

2005-06-07 Thread Weimin Wang
Hello,Everybody, Now I am using R (D)COM Server from Python to manipulate some data. When I try to use read.table function to read some data, an error occurred. However these statements work well when they are input to R directly. It is so odd. The Python scripts are as the following, from

[R] Help with possible bug (assigning NA value to data.frame)?

2005-06-07 Thread Dan Bolser
This 'strange behaviour' manifest itself within some quite complex code. When I created a *very* simple example the behaviour dissapeared. Here is the simplest version I have found which still causes the strange behaviour (it could be quite unrelated to the boot library, however).

RE: [R] How to change the value of a class slot

2005-06-07 Thread Ross Boylan
On Mon, 2005-06-06 at 14:15 -0700, Berton Gunter wrote: I'm puzzled: It looks as if instances of class objects are best thought of as immutable once created. what then is setReplaceMethod() for? assignment operators do the whole object replacement behind the scenes, at least

Re: [R] multiple plots

2005-06-07 Thread Chuck Cleland
How about this: myframe - expand.grid(p1 = rnorm(10), p2 = rnorm(10), classes = paste(class, 1:10, sep=), colors = c(blue, red, green, yellow, orange, purple)) library(lattice) xyplot(p2 ~ p1 | classes * colors, data=myframe) If you want the 60

Re: [R] How to change the value of a class slot

2005-06-07 Thread Ross Boylan
On Tue, 2005-06-07 at 08:36 +0200, Uwe Ligges wrote: Ross Boylan wrote: On Sat, Jun 04, 2005 at 07:08:56PM +0200, Martin Maechler wrote: Ross nextPath - function(pm){ #pm is a CompletePathMaker Ross[EMAIL PROTECTED] - [EMAIL PROTECTED](1) Ross [etc] If your nextPath

[R] Specifying medoids in PAM?

2005-06-07 Thread David Finlayson
I am using the PAM algorithm in the CLUSTER library. When I allow PAM to seed the medoids using the default __build__ algorithm things work well: pam(stats.table, metric=euclidean, stand=TRUE, k=5) But I have some clusters from a Hierarchical analysis that I would like to use as seeds for the

RE: [R] Help with possible bug (assigning NA value to data.frame) ?

2005-06-07 Thread Liaw, Andy
There's something peculiar that I do not understand here. However, did you realize that the thing you are assigning into parts of `a' is NULL? Check you're my.test.boot.ci.1: It's NULL. Be that as it may, I get: a - data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA) a X1 X2 X3 X4 1 1 3 NA NA

RE: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Thomas Lumley
On Tue, 7 Jun 2005, Liaw, Andy wrote: The easiest way, perhaps, is to assign the internal functions to frame 1: Another easy way is to use the MC() function in section 3.3.1 of the R FAQ, which makes function closures in a way that works in S-PLUS. -thomas

Re: [R] write.dta limits

2005-06-07 Thread Thomas Lumley
On Tue, 7 Jun 2005, David Whiting wrote: When I have encountered this error message in the past seems to have resulted from a blank/empty level in a factor or an empty character. For example: I've sent a fixed version to CRAN. The C standard says that the return value of fwrite() is equal

RE: [R] How to change the value of a class slot

2005-06-07 Thread Berton Gunter
Second, in my experiments I couldn't get setReplacementMethod to work: bumpIndex- - function(pm, value) { [EMAIL PROTECTED] - [EMAIL PROTECTED](value) pm } # I get an error without the next function definition bumpIndex - function(pm) [EMAIL PROTECTED] setReplaceMethod(bumpIndex,

Re: [R] R and MLE

2005-06-07 Thread Kjetil Brinchmann Halvorsen
Ajay Narottam Shah wrote: I learned R MLE in the last few days. It is great! I wrote up my explorations as http://www.mayin.org/ajayshah/KB/R/mle/mle.html I will be most happy if R gurus will look at this and comment on how it can be improved. I have a few specific questions: * Should

Re: [R] How to change the value of a class slot

2005-06-07 Thread Henrik Bengtsson
Berton Gunter wrote: Second, in my experiments I couldn't get setReplacementMethod to work: bumpIndex- - function(pm, value) { [EMAIL PROTECTED] - [EMAIL PROTECTED](value) pm } # I get an error without the next function definition bumpIndex - function(pm) [EMAIL PROTECTED]

Re: [R] reading non-existing files

2005-06-07 Thread Patrick Connolly
On Tue, 07-Jun-2005 at 09:48AM -0700, Dave Evens wrote: | | Dear all, | | I'm trying to read to a collection of files in a loop | using odbcConnectExcel - but not all of the files | exist. This is the code I have Try try(). Use a condition on what you get back to avoid attempting to do things

Re: [R] Help with possible bug (assigning NA value to data.frame) ?

2005-06-07 Thread James Reilly
This seems to have more to do with NULLs than NAs. For instance: a - data.frame(matrix(1:8, nrow=2)) a X1 X2 X3 X4 1 1 3 5 7 2 2 4 6 8 a[a$X2 == 4,]$X1 - NULL a X1 X2 X3 X4 1 1 3 5 7 2 4 6 8 4 James On 8/06/2005 7:15 a.m., Liaw, Andy wrote: There's something peculiar

[R] fun with S4 method recursion

2005-06-07 Thread Ross Boylan
Apparently using an existing function as the definition for a method is a no-no (at least as I'm doing it), producing infinite recursion. setClass(A, representation(model=ANY) ) fiddle - function(self) { 1 } setMethod(fiddle, signature(self=A), definition =

[R] Two ways to inherit in S4?

2005-06-07 Thread Ross Boylan
I'm puzzled that it seems possible to specify inheritance via the representation and contains arguments to setClass. The examples that I've seen all seem to use contains only. Is there some subtle distinction between these two approaches? Originally I thought one had to repeat the same

RE: [R] How to change the value of a class slot [INFO]

2005-06-07 Thread Ross Boylan
On Tue, 2005-06-07 at 13:49 -0700, Berton Gunter wrote: Second, in my experiments I couldn't get setReplacementMethod to work: bumpIndex- - function(pm, value) { [EMAIL PROTECTED] - [EMAIL PROTECTED](value) pm } # I get an error without the next function definition

[R] A question about lars

2005-06-07 Thread Mark Wong
Hi, I am trying to use lars on my data. After getting the model and did the prediction, I compare the predicted value and the coefficients and it seems like there should be a constant term in the model. I have gone through the documentation of the lars package and I can't seem to find how to get

[R] Bounding or constraining parameters in non-linear regressions

2005-06-07 Thread mwdavis
Dear R-Users, Being an engineer and not a statistician, my desired course of action may either be impossible or very simple. I am attempting to fit a non-linear model to some measured data. One term in the model contains a square-root, but in the course of regression, this term turns

RE: [R] A question about lars

2005-06-07 Thread Liaw, Andy
It's the mean of the response, which is in object$mu, where `object' is the lars model object. Andy From: Mark Wong Hi, I am trying to use lars on my data. After getting the model and did the prediction, I compare the predicted value and the coefficients and it seems like there should

Re: [R] Variables values on intersected intervals

2005-06-07 Thread Gabor Grothendieck
On 6/7/05, SAULEAU Erik-André [EMAIL PROTECTED] wrote: Dear R-list, i have a problem, in the framework of simulations, i want to vectorize for earning time: a variable, say X, has values on intervals and an other variable, say Y, has values on other intervals. For example Inf Sup

Re: [R] Re: how to define functions in such a situation

2005-06-07 Thread Hu Chen
Sorry for my confusing expression. I need create some new temp functions after the package is loaded. And these new functions should be visible and usable. Functions could be returned as a object, as Liaw mentioned. However I can't find some examples in R-intro. I also want to know whether

RE: [R] Re: how to define functions in such a situation

2005-06-07 Thread Liaw, Andy
I've already given you an example (ecdf). You can look at the polynom package as well. Try: install.packages(polynom) library(polynom) as.function.polynomial Here's one trivial example: f - function(type) { g - if (type == 1) cos else sin; g; } myfun1 - f(1) myfun2 - f(2) myfun1(pi) [1]

[R] how to run a script at the beginning of an interacive session ?

2005-06-07 Thread Mike R
Hi All, How does one create an executable R-script, similar to an executable python script, or shell script except that when the R-script is finished, the R session remains open and becomes interactive. If I do this: R script.r then R exits when finished. On the other hand, starting R

[R] Tree Structured Survival Analysis

2005-06-07 Thread Bernardo Rangel Tura
Hi People! Have someone package with: Tree Structured Survival Analysis in R? Thanks in advance Bernardo Rangel Tura, MD, MSc National Institute of Cardiology Laranjeiras Rio de Janeiro Brazil -- No virus found in this outgoing message. Checked by AVG Anti-Virus.

  1   2   >