[R] Sampling rows from a list

2003-09-19 Thread Erin Hodgess
Dear R People: Here is a function that someone asked for today. This is getting the sample from different rows from a list. Hope this helps! Sincerely, Erin oe1 function(n) { a1 - n%%3 n1 - seq(from=2,to=(n-1+a1),by=3) n2 - c(1:n)[-n1] if(a1 == 1)n2 -

[R] Extracting objects from a list of matrix

2003-09-19 Thread ZABALZA-MEZGHANI Isabelle
Hello, I would like to have an advise about how to extract objects from a list of matrixs I have fitted models (stored in an object called model) using a matrix response and the same formula and data. I get back, from summary.lm, as many sumarries as I have responses. Thus I have extract the

RE: [R] 3D plotting in R

2003-09-19 Thread Simon Blomberg
I can reccommend ggobi. http://www.ggobi.org/ Install the binary standalone, and the Rggobi package for R (both are from the above site). Works fine for me on Windows 2000, R 1.7.1. Cheers, Simon. Simon Blomberg, PhD Depression Anxiety Consumer Research Unit Centre for Mental Health

Re: [R] Extracting objects from a list of matrix

2003-09-19 Thread Uwe Ligges
ZABALZA-MEZGHANI Isabelle wrote: Hello, I would like to have an advise about how to extract objects from a list of matrixs I have fitted models (stored in an object called model) using a matrix response and the same formula and data. I get back, from summary.lm, as many sumarries as I have

Re: [R] Save object R with tkgetSaveFile

2003-09-19 Thread Peter Wolf
[EMAIL PROTECTED] wrote: HI, my question is about the function tkgetSavefile not save any file, for example the next script run OK but not save the file who i like to save, how i cant to save and object R with tkgetSaveFile, how i use the function save(objet, file=foo.R) with tkgetSaveFile

[R] what is mechanism of help(foo)?

2003-09-19 Thread Yiming Zhou
I wrote a R package, and installed it. But I don't understand how R can find right help content for object foo when calling help(foo). Who can give me underlying details or any reference regarding help(foo)? In fact, after installing my package pkg_foo and calling library(pkg_foo), I can

[R] About PLS analysis

2003-09-19 Thread Sokratis Alikhanidi
Dear colleagues, May you point me out to the PLS module in R system? I could not find it at all using PLS or partial as the search keywords. Thank you. Sokratis. -- Sokratis ALIKHANIDI, Ph.D. Department of Knowledge-based Information Engineering Toyohashi

R: [R] extracting columns with NA's

2003-09-19 Thread Vito Muggeo
If I have understood what you mean, you can use the (surely non-optimal) code: #build a matrix A-matrix(1:20,nrow=5) A[2,4]-NA A[,3]-rep(NA,nrow(A)) #count the missing value in each column fi-apply(A,2,function(x)sum(is.na(x))) #exclude column(s) having a number of NA equal to nrow(A). Of

Re: [R] extracting columns with NA's

2003-09-19 Thread Peter Wolf
antonio rodriguez wrote: Hi All, How do I can delete from a matrix (or array) only those columns which have all their values set to NA? Cheers Antonio Rodriguez --- __ [EMAIL PROTECTED] mailing list

Re: [R] Installing from RPM on Red Hat 9

2003-09-19 Thread James Wettenhall
Ted, If you are missing a shared library (libtk8.3.so) then you could just find the appropriate rpm on the RedHat9 CDs, perhaps tk-8.3.5-88.i386.rpm in /RedHat/RPMS on the second CD, and install it with sudo rpm -i. BUT, there are some known bugs in the Tcl/Tk that comes with Redhat 9 (which

Re: [R] extracting the levels of a subset of data

2003-09-19 Thread Philipp Pagel
Hi! tmpdata-subset(myd, TYPE==A) levels(tmpdata$TYPE) [1] A B C I'd like to get only A as output... rebuild the factor after subsetting: tmpdata$TYPE - factor(tmp$TYPE) If you want the levels of all factors in your data frame to be adjusted you could also use: tmpdata -

Re: [R] extracting columns with NA's

2003-09-19 Thread Barry Rowlingson
antonio rodriguez wrote: Hi All, How do I can delete from a matrix (or array) only those columns which have all their values set to NA? use 'apply' to sweep through columns using a little function that sees if all values in a column are NA: eg: x: x [,1] [,2] [,3] [,4]

Re: [R] what is mechanism of help(foo)?

2003-09-19 Thread Uwe Ligges
Yiming Zhou wrote: I wrote a R package, and installed it. But I don't understand how R can find right help content for object foo when calling help(foo). Who can give me underlying details or any reference regarding help(foo)? In fact, after installing my package pkg_foo and calling

RE: [R] extracting the levels of a subset of data

2003-09-19 Thread Jesus Frias
Hiya I'd like to get only A as output... two solutions: 1.-use unique() unique(tempdata$TYPE) to get your answer 2.-or call factor again to reduce the levels: tmpd - subset(myd,clas==A) levels(tmpd$clas) [1] A B C tmpd$clas - factor(tmpd$clas) levels(tmpd$clas) [1] A regards,

[R] solved: extracting columns with NA's

2003-09-19 Thread antonio rodriguez
Many, many thanks to everybody. It helped a lot Cheers Antonio --- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] what is mechanism of help(foo)?

2003-09-19 Thread Uwe Ligges
Uwe Ligges wrote: Yiming Zhou wrote: I wrote a R package, and installed it. But I don't understand how R can find right help content for object foo when calling help(foo). Who can give me underlying details or any reference regarding help(foo)? In fact, after installing my package pkg_foo

[R] predict for mlm does not work properly

2003-09-19 Thread ZABALZA-MEZGHANI Isabelle
Hello, I've just fitted a model with multi-responses, and I get an object of class lm mlm. My problem is that as soon as I invoke the predict method for a dataframe newdata, the methods runs and give me back prediction at the fitting points but not for newdata. Does someone has an explanation

RE: [R] predict for mlm does not work properly

2003-09-19 Thread Liaw, Andy
From: ZABALZA-MEZGHANI Isabelle Hello, I've just fitted a model with multi-responses, and I get an object of class lm mlm. My problem is that as soon as I invoke the predict method for a dataframe newdata, the methods runs and give me back prediction at the fitting points but not

[R] Evaluating outer observations in an lme object.

2003-09-19 Thread CG Pettersson
Hello everybody! I´m working with a dataset from twelve fertilizer trials, where the technical fertilizer product and application method, but not the intensity of fertilization, is varied. (I´m using R1.7.1 and W2000.) The call: ejna1t4b.lme - lme( Yield ~ TrCode, data = ejna1t4, +

Re: [R] 3D plotting in R

2003-09-19 Thread ucgamdo
For plotting 3D points, you might want to check the function 'cloud' in the 'lattice' package (some good examples in the help file), you can feed the 3 most important factors to the function and see a 3d rep of your data. A perhaps, a better 3D representation comes from the function 'sm.density'

[R] newby problem - concatenate lists

2003-09-19 Thread Axel Benz
Hi, a very basic question: What ist the easiest way in R to concatenate two lists of vectors? E.g, I have x-list(c(1,2)) y-list(c(3,4)) and I want to receive list(c(1,2),c(3,4)) thank you! Axel Fraunhofer Institut fuer Arbeitswirtschaft und Organisation

RE: [R] newby problem - concatenate lists

2003-09-19 Thread Wiener, Matthew
c(x,y) will do it. Hope this helps -Matt -Original Message- From: Axel Benz [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 8:57 AM To: [EMAIL PROTECTED] Subject: [R] newby problem - concatenate lists Hi, a very basic question: What ist the easiest way in R to concatenate

Re: [R] Weird problem with my code....

2003-09-19 Thread Guy Nason
Hi, Thanks to Barry Rawlinson and Sundar Dorai-Raj the problem was solved. The problem was that I was doing integer division when I should have been doing float division followed by ceil or floor. Sorry about that and many thanks to those who took the time to look at this. Best, Guy

RE: [R] newby problem - concatenate lists

2003-09-19 Thread Liaw, Andy
Lists are just like vectors: x-list(c(1,2)) y-list(c(3,4)) c(x,y) [[1]] [1] 1 2 [[2]] [1] 3 4 HTH, Andy -Original Message- From: Axel Benz [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 8:57 AM To: [EMAIL PROTECTED] Subject: [R] newby problem - concatenate lists

Re: [R] newby problem - concatenate lists

2003-09-19 Thread Uwe Ligges
Axel Benz wrote: Hi, a very basic question: What ist the easiest way in R to concatenate two lists of vectors? E.g, I have x-list(c(1,2)) y-list(c(3,4)) and I want to receive list(c(1,2),c(3,4)) What about c(x, y) ??? Uwe Ligges thank you! Axel

Re: [R] list subsets passing parameters question.

2003-09-19 Thread Thomas W Blackwell
Eryk - Question 1: Square brackets work, just the same as for vectors, and return a (smaller or larger) list object. The new thing with lists, not available (or needed) with vectors, is double square brackets, which return one list element as itself, not enclosed in a list. See

[R] Hall-Wellner-Bands

2003-09-19 Thread Ralf Strobl
Hi, does there exists a R-function computing Hall-Wellner-Confidence-Bands? Thanks, Ralf Strobl __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] About PLS analysis

2003-09-19 Thread Spencer Graves
Where did you search? From www.r-project.org - search - R site search, I just got 84 matches for pls and 63 for partial least squares. A generalization of PLS is structural equations, for which I got 53 matches. The third match for pls mentioned package pls.pcr, which presumably is still

Re: [R] 3D plotting in R

2003-09-19 Thread Thomas Lumley
On Fri, 19 Sep 2003, Richard A. O'Keefe wrote: I know about persp(), and a bunch of other things in R that give me a 3d view of a 2d field (plots of a function of 2 arguments, in other words). But I want to plot a bunch of 3D points and label them. I would try {g,x}gobi. -thomas

Re: [R] newby problem - concatenate lists

2003-09-19 Thread Thomas Lumley
On Fri, 19 Sep 2003, Axel Benz wrote: Hi, a very basic question: What ist the easiest way in R to concatenate two lists of vectors? E.g, I have x-list(c(1,2)) y-list(c(3,4)) and I want to receive list(c(1,2),c(3,4)) c(x,y) -thomas __

Re: [R] list subsets passing parameters question.

2003-09-19 Thread Thomas Lumley
On Fri, 19 Sep 2003, Wolski wrote: The second problem i have are that i want to store parmeters to the plot.default function in a list. eg.: pars-list(xlim=c(0,100),xlab=irrelevant , ylab=incredible important). and call the plot.default function with this list as parameters. I know that

RE: [R] Very long console input lines

2003-09-19 Thread alessandro . valli
Thank you Spencer, but it seems not to work with strings : myquery - c(select . very long string = gives syntax error myquery - {c(select . very long string= gives syntax error It seems that the closing is required in any case. Thank you in any case, Alessandro

[R] Saving with tkgetSaveFile

2003-09-19 Thread solares
HI, i'm trying to save a data frame with the next script: x-c(1,2,3)#suposse here the data frame a-tkgetSaveFile() a-tkgetSaveFile() save(x,file=as.character(a)) but i obtain the next warning message: Warning messages: 1: the condition has length 1 and only the first element will be used in:

Re: [R] Saving with tkgetSaveFile

2003-09-19 Thread Thomas W Blackwell
Ruben - Why not simply save(x, file=new.file.name) ? See help(save), help(files). The file name must be quoted, and it must be passed as a named argument to save(). - tom blackwell - u michigan medical school - ann arbor - On Fri, 19 Sep 2003 [EMAIL PROTECTED] wrote: HI, i'm

[R] Job Announcement

2003-09-19 Thread Dirk Enzmann
The Criminological Research Institute of Lower Saxony (KFN) in Germany (Hannover) seeks a quantitative methodologist (Psychologist/Sociologist) to work in a research project on the developmental consequences of incarceration of juvenile delinquents. For more detailed information see:

RE: [R] Very long console input lines

2003-09-19 Thread Thomas Lumley
On Fri, 19 Sep 2003 [EMAIL PROTECTED] wrote: Thank you Spencer, but it seems not to work with strings : myquery - c(select . very long string = gives syntax error myquery - {c(select . very long string = gives syntax error I think you will have to rewrite this

Re: [R] Installing from RPM on Red Hat 9

2003-09-19 Thread Ted Harding
On 19-Sep-03 James Wettenhall wrote: BUT, there are some known bugs in the Tcl/Tk that comes with Redhat 9 (which don't exist in previous Redhat distributions) : https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=89098 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=101678

Re: [R] Updating R

2003-09-19 Thread Uwe Ligges
Jason Skelton wrote: Could anyone advise me on the easist way of upgrading R from 1.6.2 to 1.7.1 ? is there a script like the bioconductor update.packages ? or do I have to download the tar file and build it again ? apologies for the trivial questions from a biologist The latter. Uwe Ligges

[R] angle and distance between sets of vectors

2003-09-19 Thread Petr Pikal
Dear all I want to find a distance between two points in three dimensional space and an angle between two vectors from [0,0,0] to specified points. I searched archives and found some solution using dist but I am not sure how to use it if I have several sets of such points. Here is some

RE: [R] using matrix data for function

2003-09-19 Thread Brian . J . GREGOR
It seems to me that the simplest approach is as follows. Say you have a function as follows: dosomething - function(x,y) 0.523*x^2 + 0.34*y Then you just use apply as follows to get your result (assuming that the first column of matrix m contains the x values and the second column contains the y

[R] survreg distributions

2003-09-19 Thread Olivia Lau
Hi, I need to find out if the exponential, weibull, and log-normal distributions in the survreg package use the same parameterizations as in the functions rexp, rweibull, and rlnorm. I have looked at the R-help and Venables Ripley (2002), and they have different functional forms for the

Re: [R] Evaluating outer observations in an lme object.

2003-09-19 Thread CG Pettersson
Oh, the question might have been more precisely formulated I guess... update surely helps a lot in the practical work at the computer. But that is not my problem. The problem is where and how to introduce the variables in the command. I´ve tried things like: random = ~ P.AL | Trial/Block as

[R] What is wrong with m?

2003-09-19 Thread Anna Pryor
I've been programming in one directory and recently switched to another directory. It appears that in doing so I've uncovered a problem. My environment was saving something so that my code would work and now I don't know how to fix it. I have the following bit of code: for(i in 1:index){

[R] Locate first index

2003-09-19 Thread Cezar Augusto de Freitas Anselmo
Hi, all. I'd like to know if exists a manner to get the first index where a condition is attained in a vector. For example, There is a better solution than first.index - table(subject[corretor==27])[1] (give me the subject for the first time that corretor is 27)? Thanks,

Re: [R] Locate first index

2003-09-19 Thread Spencer Graves
Have you considered which, as in the following: a - rep(1:2, 2) a [1] 1 2 1 2 which(a==1) [1] 1 3 which(a==1)[1] [1] 1 hope this helps. spencer graves Cezar Augusto de Freitas Anselmo wrote: Hi, all. I'd like to know if exists a manner to get the first index where a condition is attained

Re: [R] What is wrong with m?

2003-09-19 Thread Douglas Bates
Spencer Graves [EMAIL PROTECTED] writes: For m[1] - ... to work, m must already be defined. To fix this, execute m - rep(NA, index) before your second for loop, and it should work. hope this helps. spencer graves If saveList is actually a list, it would be more effective to use m =

Re: [R] Locate first index

2003-09-19 Thread Marc Schwartz
On Fri, 2003-09-19 at 13:15, Cezar Augusto de Freitas Anselmo wrote: Hi, all. I'd like to know if exists a manner to get the first index where a condition is attained in a vector. For example, There is a better solution than first.index - table(subject[corretor==27])[1] (give me the

Re: [R] Locate first index

2003-09-19 Thread Douglas Bates
It may be easier to use the match function which is defined to return the index of the first match. corretor - c(15, 23, 27, 34, 25, 27, 26) match(27, corretor) [1] 3 Marc Schwartz [EMAIL PROTECTED] writes: On Fri, 2003-09-19 at 13:15, Cezar Augusto de Freitas Anselmo wrote: Hi, all. I'd

Re: [R] Locate first index

2003-09-19 Thread Marc Schwartz
On Fri, 2003-09-19 at 15:57, Douglas Bates wrote: It may be easier to use the match function which is defined to return the index of the first match. corretor - c(15, 23, 27, 34, 25, 27, 26) match(27, corretor) [1] 3 True and presumably much faster as the size of the search vector and

[R] Saludos desde Madrid

2003-09-19 Thread Veronica
Hola amig@: Me llamo Verónica. Te escribo desde Madrid, España y formo parte de un equipo del Movimiento Humanista. Hoy son ya millones de personas las que experimentan cómo la sociedad en que vivimos se deshumaniza día a día. El ser humano ha perdido todo valor, el mundo se mueve en torno al

[R] using aggregate with survey-design and survey functions

2003-09-19 Thread TyagiAnupam
Hi R users, I am trying to use the aggregate function with a survey design object and survey functions, but get the following error. I think I am incorrectly using the syntax somehow, and it may not be possible to access variables directly by name in a survey-design object. Am I right? How do

[R] modelling open source software

2003-09-19 Thread TyagiAnupam
The following paper may be of interest to some. The author is generous about sharing a recently revised version. A HREF=http://papers.ssrn.com/sol3/papers.cfm?abstract_id=259648;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=259648/A [[alternative HTML version deleted]]

Re: [R] using aggregate with survey-design and survey functions

2003-09-19 Thread Spencer Graves
What do you get from the following: is.element(income, objects()) spencer graves [EMAIL PROTECTED] wrote: Hi R users, I am trying to use the aggregate function with a survey design object and survey functions, but get the following error. I think I am incorrectly using the syntax

Re: [R] using aggregate with survey-design and survey functions

2003-09-19 Thread TyagiAnupam
In a message dated 9/19/03 7:46:07 PM Pacific Daylight Time, [EMAIL PROTECTED] writes: What do you get from the following: is.element(income, objects()) spencer graves is.element(income, objects()) [1] FALSE The following may give further info about why I am getting this. Design