Re: [R] nlm behaviour and error

2008-06-02 Thread Prof Brian Ripley
It says the value is *missing* (NA), not that the length is wrong. My quess is that term*bexp is NaN, but you have given us no context to go on. On Tue, 3 Jun 2008, Redding, Matthew wrote: Hi R-Gurus, I've been cutting along quite nicely with nlm, until I threw in the following condition in

Re: [R] 'asymmetric span' for 2D loess?

2008-06-02 Thread Prof Brian Ripley
On Mon, 2 Jun 2008, Tokuyasu, Taku wrote: Hello, I am interested in performing a 2D loess smooth on microarray data, i.e. log2 ratios on a 2D grid, using different spans in the horizontal and vertical directions (the immediate reason being that replicate spots are laid out in the horizontal dir

Re: [R] Error/Crash on start up of R (Ubuntu and Wine within Ubuntu)

2008-06-02 Thread Prof Brian Ripley
Either you have a corrupt .RData file in the directory you are starting R in or the file is being read incorrectly (e.g. because of a corrupted file system or hardware issues). Reinstalling etc will not remove the .RData file, and you need to do so yourself. Starting R with --vanilla is alwa

[R] nlm behaviour and error

2008-06-02 Thread Redding, Matthew
Hi R-Gurus, I've been cutting along quite nicely with nlm, until I threw in the following condition in the function that nlm is minimising: if (((term*bexp) < 0.0001)) { #warning(term*bexp, "=term*bexp",psi,"=psi") theta<-2000 } Now when I run this function anywhere

[R] 'asymmetric span' for 2D loess?

2008-06-02 Thread Tokuyasu, Taku
Hello, I am interested in performing a 2D loess smooth on microarray data, i.e. log2 ratios on a 2D grid, using different spans in the horizontal and vertical directions (the immediate reason being that replicate spots are laid out in the horizontal direction). Is it possible to do this in R? Fu

Re: [R] Partitioning a large data frame and writing output CSVs

2008-06-02 Thread Moshe Olshansky
Assuming that your data is in a data.frame d, you could do the following: for (i in 1:999) { df <- d[564*(i-1)+(1:564),] g <- paste("group",i,sep="") group <- rep(g,564) newdf <- data.frame(group,df) filename <- paste("file",i,".csv",sep="") write.csv(newdf,filename) } --- On Tue, 3/6/08, joshga

Re: [R] NOT-SO-SIMPLE function!

2008-06-02 Thread T.D.Rudolph
I am continually amazed at how many ways there are to skin a cat in R! Gabor Grothendieck wrote: > > In the following cs increases by 1 for each nonzero > entry in x. Thus the zeros plus the preceding nonzero > form runs in cs. seq(cs)-match(cs,cs) assigns 0 > to the first element of each suc

Re: [R] some problems I have met in LARS

2008-06-02 Thread David Winsemius
feathersea <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I loaded the LARS package,and input: data(diabetes),load the > embedded data then I found the varialbes are in this form: > > x.age,x.bmi..(10 of them),X2.age,X2.bmi(64 of them) > When I input x,R gave me all 10 varialb

Re: [R] NOT-SO-SIMPLE function!

2008-06-02 Thread Gabor Grothendieck
In the following cs increases by 1 for each nonzero entry in x. Thus the zeros plus the preceding nonzero form runs in cs. seq(cs)-match(cs,cs) assigns 0 to the first element of each such run, 1 to the next, 2 to the next and so on. Thus shifting it forward and adding 1 gives the number of prece

Re: [R] NOT-SO-SIMPLE function!

2008-06-02 Thread Gabor Grothendieck
In the following cs increases by 1 for each nonzero entry in x. Thus the zeros plus the preceding nonzero form runs in cs. seq(cs)-match(cs,cs) assigns 0 to the first element of each such run, 1 to the next, 2 to the next and so on. Thus shifting it forward and adding 1 gives the number of prece

[R] some problems I have met in LARS

2008-06-02 Thread feathersea
Hi: I loaded the LARS package,and input: data(diabetes),load the embedded data then I found the varialbes are in this form: x.age,x.bmi..(10 of them),X2.age,X2.bmi(64 of them) When I input x,R gave me all 10 varialbes,and input X2,it gave me 64 variables,but if I input

Re: [R] Lengthy delay in sourcing a large function

2008-06-02 Thread Gregory. R. Warnes
For such a large chunk of code, you might profit greatly from constructing an R package containing your functions. This will avoid the need to parse in the entire set every time, since the functions will be "pre-parsed" during the package installation. -G On Jun 2, 2008, at 5:45PM , Dunca

Re: [R] exit function in R?

2008-06-02 Thread Gregory. R. Warnes
Since Frederico indeicated he was running a script, rather than a function, I suspect that he would be better served by the quit("no") function. Jun 2, 2008, at 5:15PM , Rolf Turner wrote: > > On 3/06/2008, at 1:18 AM, Federico Abascal wrote: > > > Hi, > > This is likely an stupid

[R] reading a file incrementally

2008-06-02 Thread Scot W. McNary
Hi, I'm trying to read a file containing html markup (discussion board posts) and output the various parts of each post to an field in a record in an output file (date, author, title, body). This is a one-off job and I'm trying to use R to do it. The file looks something like this: Create

Re: [R] transforming output of grid.locator() to coordinates of a leaf viewport

2008-06-02 Thread Paul Murrell
Hi Wittner, Ben, Ph.D. wrote: > Hadley, In my application the leaf viewports will not overlap, but I guess > that > would not necessarily be the case for all applications. In any event, do you > happen to know how to transform coordinates in the top-level viewport to > coordinates in another vie

Re: [R] NOT-SO-SIMPLE function!

2008-06-02 Thread Moshe Olshansky
Just a correction - it should be: > x <- c(3,2,0,1,0,2,0,0,1,0,0,0,0,4,1) > y <- rep(NA,length(x)) > z <- which(x != 0) > l <- z - c(0,z[-length(z)]) > y[z] <- log(x[z]/l) > y [1] 1.0986123 0.6931472 NA -0.6931472 NA 0.000 NA NA -1.0986123 [10] NA

Re: [R] wildcard symbol or character

2008-06-02 Thread Jorge Ivan Velez
Dear John, Assuming that your information is in the list x, does substr(x,1,2) work for you? HTH, Jorge On Mon, Jun 2, 2008 at 10:07 PM, john.polo <[EMAIL PROTECTED]> wrote: > hello all, > > i want to split a list into smaller lists. the list looks like this: > CW-W730 CW-W720 CW-W710 CW

Re: [R] merging two data sets with no column header

2008-06-02 Thread David Winsemius
kayj <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > I have two data sets data1 and data2 with no column names( No > header). The first coluimn in both data sets represents the case ID. > How can I tell R to merge the two data sets by the case ID if there > is no header? Also, In data1

Re: [R] {Spam?} Re: High resolution figures for a paper?

2008-06-02 Thread Richard Rowe
zhijie zhang wrote: Thanks for the above mentioned methods. I will try them one by one. Thanks again. On 6/3/08, Sarah Goslee <[EMAIL PROTECTED]> wrote: The production of "publication-quality graphics" has been discussed at great length on R-sig-eco over the past week or so. The archive is

Re: [R] NOT-SO-SIMPLE function!

2008-06-02 Thread Moshe Olshansky
A simpler solution would be: > x <- c(3,2,0,1,0,2,0,0,1,0,0,0,0,4,1) > y <- rep(NA,length(x)) > y [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > z <- which(x != 0) > l <- z - c(1,z[-length(z)]) > y[z] <- log(x[z]/(l+1)) > y [1] 1.0986123 0.000 NA -1.0986123 NA -0.405465

[R] wildcard symbol or character

2008-06-02 Thread john.polo
hello all, i want to split a list into smaller lists. the list looks like this: CW-W730 CW-W720 CW-W710 CW-W700 CW-W690 CW-W680 CW-W670 CW-W660 CE-W997 CE-W987 CE-W977 CE-W967 CE-W956 CE-W944 CE-W934 CE-W924 7W-W760 7W-W750 7W-967W-941 7W-932 7W-923 7W-914 7W-905 7

Re: [R] Partitioning a large data frame and writing output CSVs

2008-06-02 Thread jim holtman
This might give you a hint of how to do it. BTW, were the dimensions 563436x4? test <- matrix(runif(100*4),ncol=4) # create groups of 10 rows group <- rep(1:10, each=10) new.test <- cbind(test, group=group) # now get indices to write out indices <- split(seq(nrow(test)), new.test[, 'group']) # no

[R] boost package help

2008-06-02 Thread maomao bao
Hi, Is there anyone have some experience in the boost package. I used the logitboost function to do the two-class classification. This is the format I used. logitboost(xtrain, ytrain, xtest, presel = 2, mfinal = 100) # with feature selection logitboost(xtrain, ytrain, xtest, presel =

[R] Error/Crash on start up of R (Ubuntu and Wine within Ubuntu)

2008-06-02 Thread Patrick M. Joyce
Hello, I'm having issues operating R under Ubuntu (Hardy 8.04) though I suspect this is not necessarily the malady. I have attempted to run R in ubuntu as is which worked for awhile and then stopped (using RKWard as the windowing environment). I tried removing then re-installing the software and

[R] Partitioning a large data frame and writing output CSVs

2008-06-02 Thread joshgage
Hello, I have a large dataset [536436,4] I'd like to partition the dataset into 999 groups of 564 rows and output each group as a CSV files... Obviously I could do this longhand but I know it is somehow possible to write a loop to do the same thing... I'd like to group such that the first grou

[R] merging two data sets with no column header

2008-06-02 Thread kayj
I have two data sets data1 and data2 with no column names( No header). The first coluimn in both data sets represents the case ID. How can I tell R to merge the two data sets by the case ID if there is no header? Also, In data1 I have more cases and I would like the result of the merge to have al

Re: [R] High resolution figures for a paper?

2008-06-02 Thread zhijie zhang
Thanks for the above mentioned methods. I will try them one by one. Thanks again. On 6/3/08, Sarah Goslee <[EMAIL PROTECTED]> wrote: > > The production of "publication-quality graphics" has been discussed at > great length on R-sig-eco over the past week or so. The archive is > available here: >

Re: [R] RJDBC cant find driver class in JDBC jar file

2008-06-02 Thread David Scott
I can't comment on problems with RJDBC but I can say that if you want to access MySQL from R, I have had very little difficulty doing it with RODBC. The only difficulty I have experienced is in getting the MySQL 5.0 server started, which after hours of trying I avoided by using MySQL 5.1. S

Re: [R] Need advise in grab the line number of sorted list in R

2008-06-02 Thread Jason Lee
Hi, If there are more than one item having the same value, how can i use R to take the average of the position. E.g:- X Y Z 131 22.2 3.4 4.4 132 20.0 3.4 4.4==>Position 2 if queried 150 20.0 12.2 4.5 =>Position 3 if queried 134 20.0 3.4 4.4 ==> Position4 if queried 159 20.0

[R] RJDBC cant find driver class in JDBC jar file

2008-06-02 Thread Dan Montgomery
I would like to set up a Windows XP environment with R and MySQL. This set-up was recommended by a friend who uses this set up, but I have been unable to get RJDBC to work. I have installed all of the software today (June 2 2008), first deleting and then replacing old versions of software. The er

[R] probleme with R CMD check

2008-06-02 Thread cgenolin
Hi the list. I got a probleme with R CMD check. I run a package.skeleton on a very simple code (four toy function, no probleme with the R CMD build). But on the R CMD check packClassique, I get : * checking for unstated dependencies in R code ... WARNING Erreur dans .find.package(package, lib

Re: [R] Lengthy delay in sourcing a large function

2008-06-02 Thread Duncan Murdoch
On 02/06/2008 5:28 PM, Dennis Fisher wrote: Colleagues, I have a script that contains ~ 10,000 lines of code. Most of it is written as small functions. However, for various reasons, the final function is ~1500 lines of code. I realize that this may not be optimal but the code evolved th

[R] Lengthy delay in sourcing a large function

2008-06-02 Thread Dennis Fisher
Colleagues, I have a script that contains ~ 10,000 lines of code. Most of it is written as small functions. However, for various reasons, the final function is ~1500 lines of code. I realize that this may not be optimal but the code evolved that way and breaking it into smaller pieces i

Re: [R] exit function in R?

2008-06-02 Thread Rolf Turner
On 3/06/2008, at 1:18 AM, Federico Abascal wrote: Hi, This is likely an stupid question, but I cannot find the solution. I am searching for an "exit" function, to end the execution of an R script if some condition is not filled. Any clue? Others have suggested using stop(). It might be the c

Re: [R] boxplot with text and symbols on x

2008-06-02 Thread Greg Snow
An alternative way to draw the symbols (or some approximation of them) is to use the my.symbols function from the TeachingDemos package along with ms.male and ms.female (or your improvement of these, also from the TeachingDemos package). See the 4th example from ?ms.male (or ?ms.female). Hope

Re: [R] Ancova: formula with a common intercept

2008-06-02 Thread Rolf Turner
On 3/06/2008, at 2:56 AM, Daniel Brewer wrote: I have some data with two categorises plus/minus (p53) and a particular time (Time) and the outcome is a continuous vairable (Result). I set up a maximum model. ancova <- lm(Result~Time*p53) summary(ancova) .. Coefficients: Esti

Re: [R] NOT-SO-SIMPLE function!

2008-06-02 Thread T.D.Rudolph
You are absolutely correct Marc; thank you for making this assumption! While it will take some time for me to rightfully understand the logical ordering of your proposed function, it certainly seems to produce the result I was looking for, and economically at that. rle is indeed highly useful

Re: [R] Get all X iterations in optim output when controls(trace=6)

2008-06-02 Thread Greg Snow
Here is an alternative approach to saving the itterations: testfunc <- function(data) { ms.mat <- matrix(nrow=0, ncol=2) f1 <- function(ms, data){ ms.mat <<- rbind(ms.mat, ms) -sum( dnorm(data, mean=ms[1], sd=ms[2], log=TRUE) ) } ou

[R] Random Forests regression by strata

2008-06-02 Thread [EMAIL PROTECTED]
Hello, I'm trying to sample in Random Forests by a factor, but it is a regression problem and I can't figure out how to do this (I can only see how to sample by strata in classification). Thanks Jesse Lasky __ R-help@r-project.org mailing list https:/

Re: [R] more columns that column names

2008-06-02 Thread Jorge Ivan Velez
Dear Paul, Perhaps read.delim2() can do the job easily. HTH, Jorge On Mon, Jun 2, 2008 at 3:41 PM, Paul Adams <[EMAIL PROTECTED]> wrote: > Hello to everyone, > I have gotten my file to print to screen but when I use read.table I am > getting an error message that > says there are" more colum

Re: [R] NOT-SO-SIMPLE function!

2008-06-02 Thread Marc Schwartz
on 06/02/2008 01:30 PM T.D.Rudolph wrote: I am trying to set up a function which processes my data according to the following rules: 1. if (x[i]==0) NA 2. if (x[i]>0) log(x[i]/(number of consecutive zeros immediately preceding it +1)) The data this will apply to include a variety of whole num

Re: [R] more columns that column names

2008-06-02 Thread Julian Burgos
Hi Paul, The easiest thing to to is to open the file using a text editor (Notepad will do) and examine the first few lines. You can add add a column name if needed. Julian Paul Adams wrote: Hello to everyone, I have gotten my file to print to screen but when I use read.table I am getting

[R] more columns that column names

2008-06-02 Thread Paul Adams
Hello to everyone, I have gotten my file to print to screen but when I use read.table I am getting an error message that says there are" more columns than column names."This is a file that was not created by me so I am not sure how to investigate and solve this problem.I looked in the help file

[R] [R-pkgs] updated RcmdrPlugin.epack is ready

2008-06-02 Thread Erin Hodgess
Dear R People: I have updated the RcmdrPlugin.epack with new menus, and added: additive decomposition; HoltWinters; Exponential smoothing. Thanks to many for their help in the process! Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences Univer

[R] trellis device

2008-06-02 Thread hanx
Hello all, I used pushViewport to create a viewport with a 9*8 layout(using layout: lay<-grid.layout(9,8).) In each cell, I used lattice to draw plots. In the final output, if I used the trellis.device(),i.e., the default device, the 9*8 plots I intend to draw seem ok in terms of the letter size

Re: [R] print and read.table commands

2008-06-02 Thread Jorge Ivan Velez
Dear Paul, Probably what is happening is that the file is not located where you're telling it to R (did you move it recently?). Do you have headers in your data set? If so, you can try mydata=read.table(file="C:\\Document and Settings\\All Users\\Desktop\\colon cancer.txt",header=TRUE) otherwise

Re: [R] print and read.table commands

2008-06-02 Thread Richardson, Patrick
?read.table And don't forget the " at the end of your filename HTH -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Adams Sent: Monday, June 02, 2008 2:34 PM To: r-help@r-project.org Subject: [R] print and read.table commands Hello to everyone, I

Re: [R] print and read.table commands

2008-06-02 Thread Henrique Dallazuanna
Try this: path <- file.choose() 1) read.table(path) 2) file.show(path) On Mon, Jun 2, 2008 at 3:33 PM, Paul Adams <[EMAIL PROTECTED]> wrote: > Hello to everyone, > I am new to programming in R and am having trouble with the following > two commands > 1.I am running a simple 1 line script "re

[R] print and read.table commands

2008-06-02 Thread Paul Adams
  Hello to everyone, I am new to programming in R and am having trouble with the following two commands 1.I am running a simple 1 line script "read.table(file="C:\\Document and Settings\\All Users\\Desktop\\colon cancer.txt) and the error message I get is "Error in file (file, "r"): cannot open

[R] NOT-SO-SIMPLE function!

2008-06-02 Thread T.D.Rudolph
I am trying to set up a function which processes my data according to the following rules: 1. if (x[i]==0) NA 2. if (x[i]>0) log(x[i]/(number of consecutive zeros immediately preceding it +1)) The data this will apply to include a variety of whole numbers not limited to 1 & 0, a number of which

[R] [R-pkgs] New glmnet package on CRAN

2008-06-02 Thread Trevor Hastie
glmnet is a package that fits the regularization path for linear, two- and multi-class logistic regression models with "elastic net" regularization (tunable mixture of L1 and L2 penalties). glmnet uses pathwise coordinate descent, and is very fast. Some of the features of glmnet: * by default

Re: [R] Problemas usando jri0.4-1 y R 2.7.0

2008-06-02 Thread Julian Burgos
Hola Borja, Creo que vas a tener muy pocas respuestas a menos que escribas a la lista en inglés. Lamentablemente yo conozco poco de Java y no puedo responder tu pregunta. Saludos, Julian Borja Soto Varela wrote: Hola, es la primera vez que mando un correo a cualquiera de las listas de cor

[R] RBloomberg date error

2008-06-02 Thread stephen bond
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] gsub and multiple replacements

2008-06-02 Thread Hans-Jörg Bibiko
On 02.06.2008, at 17:27, Ng Stanley wrote: I would like to replace "A B" by "A-B" and "AA (DD)" by "AA" using a single gsub. Is that possible besides using two gsub ? Could you be a bit more precisely? If you are dealing with two fix strings then you can write if

Re: [R] High resolution figures for a paper?

2008-06-02 Thread Duncan Murdoch
On 6/2/2008 11:12 AM, zhijie zhang wrote: Dear Rusers, My manuscript has been conditionally accepted recently. The problem to generate the high resolution figures in R for the manuscript cannot be solved by me. The journal editor ask me to generate the figures with a minimum resolution of 500

Re: [R] High resolution figures for a paper?

2008-06-02 Thread Sarah Goslee
The production of "publication-quality graphics" has been discussed at great length on R-sig-eco over the past week or so. The archive is available here: https://stat.ethz.ch/pipermail/r-sig-ecology/2008-May/thread.html and the thread is very near the bottom. Very detailed recommendations have been

Re: [R] Plotting horizontal dendrograms

2008-06-02 Thread Matthias Kohl
Dear Charles, the sample code you cite has an additional "as.dendrogram" compared to your code. Hence, dend1 is of class dendrogram (class(dend1)) and if you call plot(dend1) the method for dendrograms (i.e., plot.dendrogram) is executed which has a horiz argument; confer ?plot.dendrogram. Whe

Re: [R] Help on Calculating day differences

2008-06-02 Thread Gabor Grothendieck
This was already answered by two people when you posted it the first time. On Mon, Jun 2, 2008 at 12:34 PM, Thorsten Muehge <[EMAIL PROTECTED]> wrote: > Hello R Freaks, > I calculate the difference in days between two events with the following > litte R expresseion: > > T1a <- strptime(T1,"%m/%d/%

[R] High resolution figures for a paper?

2008-06-02 Thread zhijie zhang
Dear Rusers, My manuscript has been conditionally accepted recently. The problem to generate the high resolution figures in R for the manuscript cannot be solved by me. The journal editor ask me to generate the figures with a minimum resolution of 500 dpi. I have tried the *menu-driven method* t

Re: [R] LDA and centroids

2008-06-02 Thread Prof Brian Ripley
On Mon, 2 Jun 2008, Dani Valverde wrote: Hello, I have carried out an lda analysis using the lda function of MASS package. I have plotted the LD1xLD2 to represent the data. Now I would like to get the centroids for each group of data and plot it on the LD1xLD2 graph. How can I get the centroi

[R] Help on Calculating day differences

2008-06-02 Thread Thorsten Muehge
Hello R Freaks, I calculate the difference in days between two events with the following litte R expresseion: T1a <- strptime(T1,"%m/%d/%y %H:%M:%S"); T2a <- strptime(T2,"%m/%d/%y %H:%M:%S"); T1b <- as.Date(T1a); T2b <- as.Date(T2a); days <- T2b-T1b; time <- T2a - T1a; In the project I would lik

Re: [R] = or <-

2008-06-02 Thread Erik Iverson
Sébastien wrote: Thanks Erik and Gabor for this precision, I guess that my misunderstanding of these concepts came from some bad habits I took during my self-learning experience of R (especially, copy/paste of old codes where <- was used for function arguments and did not produce error mess

Re: [R] How can I solve this function in R?

2008-06-02 Thread Dieter Menne
François Aucoin gmail.com> writes: > > I would like to solve the following function in R: > > G <- function(k) (2*(1 - k)*(1 + 2*k)^.5)/(1+3*k) > G <- function(k) (2*(1 - k)*(1 + 2*k)^.5)/(1+3*k) GZero <-function(k,G0) G(k)-G0 plot(1:100,G(1:100)) uniroot(GZero,c(0,100),G=-5) Dieter ___

[R] Regression Model with Memory

2008-06-02 Thread Stefan Koenig
Dear all: I am searching for a regression model (e.g. y=Xb+e) in which dummy-coded events (to time point t) on different regressors in X exhibit an effect on subsequent responses in the vector y (to time-points t+1, t+2,… t+n). My aim is to estimate how long the memory effect is and how strong

Re: [R] How can I solve this function in R?

2008-06-02 Thread Paul Smith
On Mon, Jun 2, 2008 at 4:31 PM, François Aucoin <[EMAIL PROTECTED]> wrote: > I would like to solve the following function in R: > > G <- function(k) (2*(1 - k)*(1 + 2*k)^.5)/(1+3*k) > > I want to be able to find "k" for a given "G" Consider G(k)-g. With plot look for intervals where the roots lie

[R] R function for Woody Average (Average with alignment)?

2008-06-02 Thread U. Hasson
Dear R users, I'm looking for a function to align multiple waveforms that contain random phase shifts. The "Woody Average" is one such method -- is there any comparable function already coded for R? Matlab code for this type of average exists [http://www.mathworks.com/matlabcentral/fileexchange/lo

[R] Fwd: Problemas usando jri0.4-1 y R 2.7.0

2008-06-02 Thread Borja Soto Varela
Hello, this is the first time I send a mail to r-help mailing list. Mi problema es el siguiente: I'm developing a program in java with calls in R and I can`t use jri 0.4-1 with R 2.7 or 2.6 .but it runs with 2.4. The problem that I get when using the latest version of R is as follows: Cannot fin

Re: [R] = or <-

2008-06-02 Thread Sébastien
Thanks Erik and Gabor for this precision, I guess that my misunderstanding of these concepts came from some bad habits I took during my self-learning experience of R (especially, copy/paste of old codes where <- was used for function arguments and did not produce error messages). Sebastien

Re: [R] Is variable in one vector part of variable in another

2008-06-02 Thread Bert Gunter
... Indeed, but note that both %in% and intersect() are essentially wrappers for match() . Cheers, Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philipp Pagel Sent: Saturday, May 31, 2008 2:27 PM To: r-help@r-project.org Subject: Re: [R] I

[R] gsub and multiple replacements

2008-06-02 Thread Ng Stanley
Hi, I would like to replace "A B" by "A-B" and "AA(DD)" by "AA" using a single gsub. Is that possible besides using two gsub ? Thanks Stanley [[alternative HTML version deleted]] __ R-help@r-project.org mailing list htt

[R] Plotting horizontal dendrograms

2008-06-02 Thread Charles K. Minns
I am using hclust and plot to produce dendrograms. Using my input data I am able to complete an analysis and obtain a vertical plot. I want to be able to plot the dendrogram horizontally.I am using version 2.6 of R and have updated my packages recently. Using the sample script for dendrograms I c

[R] LDA and centroids

2008-06-02 Thread Dani Valverde
Hello, I have carried out an lda analysis using the lda function of MASS package. I have plotted the LD1xLD2 to represent the data. Now I would like to get the centroids for each group of data and plot it on the LD1xLD2 graph. How can I get the centroid value from the lda object? Best, Dani

[R] How can I solve this function in R?

2008-06-02 Thread François Aucoin
I would like to solve the following function in R: G <- function(k) (2*(1 - k)*(1 + 2*k)^.5)/(1+3*k) I want to be able to find "k" for a given "G" Thanks! Francois Aucoin [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Ancova: formula with a common intercept

2008-06-02 Thread Daniel Brewer
I have some data with two categorises plus/minus (p53) and a particular time (Time) and the outcome is a continuous vairable (Result). I set up a maximum model. ancova <- lm(Result~Time*p53) > summary(ancova) .. Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.05919

Re: [R] Odp: Aggregation and the meaning of class

2008-06-02 Thread Karl Ove Hufthammer
Chip Barnaby: > My question is: How does one learn the specifics?  For the case at > hand, what are the specialized methods associated with class "by"? The methods for the (S3) generic function 'by': $ methods(by) [1] by.data.frame by.default Functions for objects of class 'by': $ methods(clas

[R] help with RPART

2008-06-02 Thread Terry Therneau
When using anova method, all of the printed results are scaled by the RSS for the top node. Therefore the relative error measures for the trees already are 1-R^2. tfit <- rpart(time ~ ., lung) summary(tfit) CP nsplit rel error xerror xstd 1 0.03665178 0 1.000

Re: [R] = or <-

2008-06-02 Thread Gabor Grothendieck
No function accepts <- in place of =. In the first of the 4 examples below we are simply setting variable b to 10 and then passing it to f as its first argument. f(b = 10) would be different since that specifies that we want argument b to take on the value of 10. f <- function(a=1, b=2) a-b # th

[R] non-parametric regression with a convexity constraint

2008-06-02 Thread thierrydb
I would like to know if there's a package in R that enables to get a non-parametric regression (OLS, not quantile) that would have a positive (or negative) convexity constraint, as well as monotonicity. Right now, I have only found two packages (fdrtool and cir) that enable to impose only monoto

Re: [R] Odp: Aggregation and the meaning of class

2008-06-02 Thread Gabor Grothendieck
To discover the available methods use the methods function, e.g. example(by) # script creates a variable tmp of class by class(tmp) # "by" methods(class = "by") # describe.by print.by Also try this: > by # by is S3 generic since it uses UseMethod function (data, INDICES, FUN, ...) UseMethod("by"

Re: [R] = or <-

2008-06-02 Thread Erik Iverson
Sébastien wrote: Dear R-users, I have written a short VB application to clean and format my R code. Everything works fine except one small issue that I did not expected; it is related the automatic replacement of assignment signs from "=" to "<-". Most functions or arguments seem to accept

Re: [R] Odp: Aggregation and the meaning of class

2008-06-02 Thread Chip Barnaby
Hi Petr, Thanks for your reply. See below. At 05:58 AM 6/2/2008, Petr PIKAL wrote: Hi I did not see any response yet so I try a kick. Each object in R has some attributes which can be revealed by attributes(object) Some of them are useful for methods and tell R how to handle particular objec

[R] = or <-

2008-06-02 Thread Sébastien
Dear R-users, I have written a short VB application to clean and format my R code. Everything works fine except one small issue that I did not expected; it is related the automatic replacement of assignment signs from "=" to "<-". Most functions or arguments seem to accept either = or <-, but

[R] Problemas usando jri0.4-1 y R 2.7.0

2008-06-02 Thread Borja Soto Varela
Hola, es la primera vez que mando un correo a cualquiera de las listas de correo de R y no se si esta consulta se ajusta al próposito de la r-help list o debería haberlo mandado a otra de las listas que hay. Mi problema es el siguiente: Estoy desarrollando un programa en java con llamadas a R y no

Re: [R] Need advise in grab the line number of sorted list in R

2008-06-02 Thread Marc Schwartz
on 06/02/2008 08:45 AM Jason Lee wrote: Hi, I have a data frame which format is like below:- X Y Z 131 22.2 3.4 4.4 150 20.0 12.2 4.5 etc... And I have sorted the data frame. However, I would like to grab one of these elements in the data frame. Also, i would like to number

Re: [R] Need advise in grab the line number of sorted list in R

2008-06-02 Thread Karl Ove Hufthammer
Jason Lee: > I have a data frame which format is like below:- > > X     Y     Z > 131 22.2 3.4   4.4 > 150  20.0 12.2 4.5 > > etc... > > And I have sorted the data frame. However, I would like to grab one of > these elements in the data frame. Also, i would like to number these rows > so that w

Re: [R] robust mlm in R?

2008-06-02 Thread Michael Friendly
I had no on-list replies, so I cobbled up a function for the simplest method I could think of -- iterative multivariate trimming, following Gnanadesikan, Kettering & Wilks, assigning 0 weights to observations based on the Mahalanobis D^2 of residuals. But I'm getting an error I don't understand,

[R] Need advise in grab the line number of sorted list in R

2008-06-02 Thread Jason Lee
Hi, I have a data frame which format is like below:- X Y Z 131 22.2 3.4 4.4 150 20.0 12.2 4.5 etc... And I have sorted the data frame. However, I would like to grab one of these elements in the data frame. Also, i would like to number these rows so that when i grab a particul

Re: [R] R and Openmpi

2008-06-02 Thread Dirk Eddelbuettel
On Mon, Jun 02, 2008 at 12:29:06PM +0200, Marce wrote: > Hi Dirk, now I'm using R and OpenMPI in a cluster. Could you link me > some pages of information about this? I'm interesting about the > installation, all the pages i've seen it's with LAM.. > Really i've just installed R and Rmpi, but I have

Re: [R] exit function in R?

2008-06-02 Thread Hans-Joerg Bibiko
On 2 Jun 2008, at 15:18, Federico Abascal wrote: Hi, This is likely an stupid question, but I cannot find the solution. I am searching for an "exit" function, to end the execution of an R script if some condition is not filled. Any clue? f <- function() { ... if (1 == 1) return(WHATEVER)

Re: [R] exit function in R?

2008-06-02 Thread Markus Schmidberger
try this: stop("Message") warning("Message") Best Markus Federico Abascal schrieb: Hi, This is likely an stupid question, but I cannot find the solution. I am searching for an "exit" function, to end the execution of an R script if some condition is not filled. Any clue? Thank you in advance!

Re: [R] exit function in R?

2008-06-02 Thread Marc Schwartz
on 06/02/2008 08:18 AM Federico Abascal wrote: Hi, This is likely an stupid question, but I cannot find the solution. I am searching for an "exit" function, to end the execution of an R script if some condition is not filled. Any clue? Thank you in advance! Federico See ?stop and ?stopifnot H

Re: [R] subject: horizontal text in barplot

2008-06-02 Thread Marc Schwartz
on 06/02/2008 08:00 AM dat wrote: I have a problem with the ylabs in barplot. When I draw the bars horizontal the text for the y axis is not drawn horizontal too. The text remains vertical. How can I change that. Thank's for your advice. There is an example below. ##Example plot.new() jib <-

[R] exit function in R?

2008-06-02 Thread Federico Abascal
Hi, This is likely an stupid question, but I cannot find the solution. I am searching for an "exit" function, to end the execution of an R script if some condition is not filled. Any clue? Thank you in advance! Federico __ R-help@r-project.org mailing l

[R] Optimization problem with constraints

2008-06-02 Thread Matthias Graser
I'm trying to da an optimization for the followig function Zwischenwert <- function (x) { lambda<-x[1]; mu<-x[2]; gammal<-x[3]; mud<-x[4]; gammad<-x[5]; Mittelwert <-0; for(t in 0:(T-1)) { for(i in 0:(n-1))

Re: [R] subject: horizontal text in barplot

2008-06-02 Thread Jorge Ivan Velez
Dear dat, Try this: barplot(jib, horiz=TRUE,las=1) HTH, Jorge On Mon, Jun 2, 2008 at 9:00 AM, dat <[EMAIL PROTECTED]> wrote: > > I have a problem with the ylabs in barplot. When I draw the bars horizontal > the text for the y axis is not drawn horizontal too. > The text remains vertical. Ho

Re: [R] subject: horizontal text in barplot

2008-06-02 Thread Henrique Dallazuanna
Try this: bp <- barplot(jib, horiz=TRUE, yaxt = 'n') axis(2, at = bp, labels = colnames(jib), tick = FALSE, las = 2) On Mon, Jun 2, 2008 at 10:00 AM, dat <[EMAIL PROTECTED]> wrote: > > I have a problem with the ylabs in barplot. When I draw the bars horizontal > the text for the y axis is not d

[R] subject: horizontal text in barplot

2008-06-02 Thread dat
I have a problem with the ylabs in barplot. When I draw the bars horizontal the text for the y axis is not drawn horizontal too. The text remains vertical. How can I change that. Thank's for your advice. There is an example below. ##Example plot.new() jib <- data.frame(c(1:15),c(11:25),c(15:1

Re: [R] Swap variables in data.frame

2008-06-02 Thread Birgitle
That works perfect. Thanks a lot Paul! Greets Birgit Paul Smith wrote: > > On Mon, Jun 2, 2008 at 1:04 PM, Birgitle <[EMAIL PROTECTED]> > wrote: >> >> Thanks Paul. >> >> I am not sure if I understood well, but when I do it then I have only two >> columns left: >> >>> L3 <- LETTERS[1:3] >>> (

Re: [R] optim error - repost

2008-06-02 Thread Dieter Menne
gmail.com> writes: > > Here is a clean version. I did this with nls and it works (see below), but > I need to do it with optim. Keun-Hyung Great that you got it to work! Just curious if there is any reason why one should use optim when nls works fine? If this should be on a reviewer's reques

Re: [R] Help : R-packages : Problems loading package fSeries

2008-06-02 Thread Yohan Chalabi
"CLG" == Celine LE-GOAZIGO <[EMAIL PROTECTED]> on Mon, 2 Jun 2008 13:19:35 +0200 CLG> Hi. CLG> CLG> I am trying to load the package fSeries, in order to load CLG> the package CLG> fGarch after. CLG> However, it says the following message. Dear Celine, Please make su

  1   2   >