[R] Populate matrix from data.frame

2007-06-28 Thread Andrej Kastrin
Dear all, I have a data frame a - data.frame(cbind(x=c('a','a','a','b','c'), y=c('a','b','c','d','e'),z=c(1,2,3,4,5))) a x y z 1 a a 1 2 a b 2 3 a c 3 4 b d 4 5 c e 5 and a matrix mm - matrix(0,5,5) colnames(mm) - c('a','b','c','d','e') rownames(mm) - c('a','b','c','d','e') mm a b c d e

Re: [R] no applicable method

2007-06-28 Thread Prof Brian Ripley
On Wed, 27 Jun 2007, Kyle Ellrott wrote: I'm getting started in R, and I'm trying to use one of the gradient boosting packages, mboost. I'm already installed the package with install.packages(mboost) and loaded it with library(mboost). My problem is that when I attempt to call glmboost, I

Re: [R] Populate matrix from data.frame

2007-06-28 Thread Prof Brian Ripley
On Thu, 28 Jun 2007, Andrej Kastrin wrote: Dear all, I have a data frame a - data.frame(cbind(x=c('a','a','a','b','c'), y=c('a','b','c','d','e'),z=c(1,2,3,4,5))) a x y z 1 a a 1 2 a b 2 3 a c 3 4 b d 4 5 c e 5 and a matrix mm - matrix(0,5,5) colnames(mm) - c('a','b','c','d','e')

[R] : regular expressions: escaping a dot

2007-06-28 Thread Wolfram Fischer
What's really the problem with: regexpr( '\.odt$', Yodt, perl=TRUE ) Warning: '\.' is an unrecognized escape in a character string Warning: unrecognized escape removed from \.odt$ [1] 5 attr(,match.length) [1] 4 I know that I could use: regexpr(

Re: [R] : regular expressions: escaping a dot

2007-06-28 Thread Tobias Verbeke
Wolfram Fischer wrote: What's really the problem with: regexpr( '\.odt$', Yodt, perl=TRUE ) Warning: '\.' is an unrecognized escape in a character string Warning: unrecognized escape removed from \.odt$ [1] 5 attr(,match.length) [1] 4 I know that I

[R] Re : restructuring matrix

2007-06-28 Thread justin bem
se reshape package Justin BEM Elève Ingénieur Statisticien Economiste BP 294 Yaoundé. Tél (00237)9597295. - Message d'origine De : yoo [EMAIL PROTECTED] À : r-help@stat.math.ethz.ch Envoyé le : Jeudi, 28 Juin 2007, 2h15mn 52s Objet : Re: [R] restructuring matrix Yea... let's say

[R] Meta-Analysis of proportions

2007-06-28 Thread Monica Malta
Dear colleagues, I'm conducting a meta-analysis of studies evaluating adherence of HIV-positive drug users into AIDS treatment, therefore I'm looking for some advice and syntax suggestion for running the meta-regression using proportions, not the usual OR/RR frequently used on RCT studies.

Re: [R] : regular expressions: escaping a dot

2007-06-28 Thread Prof Brian Ripley
On Thu, 28 Jun 2007, Wolfram Fischer wrote: What's really the problem with: regexpr( '\.odt$', Yodt, perl=TRUE ) Warning: '\.' is an unrecognized escape in a character string Warning: unrecognized escape removed from \.odt$ [1] 5 attr(,match.length) [1] 4

Re: [R] Meta-Analysis of proportions

2007-06-28 Thread Chung-hong Chan
OpenBUGS should be something related to Bayesian statistics. You may refer to Chapter 12 of Handbook http://cran.r-project.org/doc/vignettes/HSAUR/Ch_meta_analysis.pdf It talks about meta-regression. On 6/28/07, Monica Malta [EMAIL PROTECTED] wrote: Dear colleagues, I'm conducting a

Re: [R] Populate matrix from data.frame

2007-06-28 Thread Patrick Burns
You need some caution with Brian's solution as it depends on the matrix being in the same order as the factors in the data frame. a - data.frame(cbind(x=c('a','a','a','b','c'), y=c('a','b','c','d','e'),z=c(1,2,3,4,5))) mm - matrix(0,5,5) colnames(mm) - c('a','b','c','d','e') rownames(mm) -

[R] maximum difference between two ECDF's

2007-06-28 Thread Bart Vandewoestyne
Hello, I have a vector of samples x of length N. Associated with each sample x_i is a certain weight w_i. All the weights are in another vector w of the same length N. I have another vector of samples y of length n (small n). All these samples have equal weights 1/n. The ECDF of these

[R] Repeat if

2007-06-28 Thread Birgit Lemcke
Hello, (Power Book G4, Mac OS X, R 2.5.0) I would like to repeat the function range for 85 Vectors (V1-V85). I tried with this code: i-0 repeat { + i-i+1 + if (i85) next + range (Vi, na.rm = TRUE) + if (i==85) break + } I presume that the Vi is wrong, because in this syntax i is not known

[R] compare 2 vectors

2007-06-28 Thread João Fadista
Dear all, I would like to take out the values from one vector that are equal to the values in another vector. Example: a - c(1,2,3,4,5,6,7,8,9) b - c(3,10,20,5,6) b_noRepeats = c(10,20) So I would like to have the vector b without the same values as vector a. Kind regards, João Fadista

Re: [R] Repeat if

2007-06-28 Thread Jacques VESLOT
sapply(1:85, function(i) eval(parse(text=paste(range(V, i, , na.rm=T), sep= Jacques VESLOT INRA - Biostatistique Processus Spatiaux Site Agroparc 84914 Avignon Cedex 9, France Tel: +33 (0) 4 32 72 21 58 Fax: +33 (0) 4 32 72 21 84 Birgit Lemcke a écrit : Hello, (Power Book G4, Mac OS

Re: [R] compare 2 vectors

2007-06-28 Thread Christophe Pallier
On 6/28/07, João Fadista [EMAIL PROTECTED] wrote: I would like to take out the values from one vector that are equal to the values in another vector. Example: a - c(1,2,3,4,5,6,7,8,9) b - c(3,10,20,5,6) b_noRepeats = c(10,20) b[!(b %in% intersect(a,b))] See ?intersect -- Christophe

Re: [R] compare 2 vectors

2007-06-28 Thread Antonio, Fabio Di Narzo
setdiff(b, a) 2007/6/28, João Fadista [EMAIL PROTECTED]: Dear all, I would like to take out the values from one vector that are equal to the values in another vector. Example: a - c(1,2,3,4,5,6,7,8,9) b - c(3,10,20,5,6) b_noRepeats = c(10,20) So I would like to have the vector b

Re: [R] Repeat if

2007-06-28 Thread Birgit Lemcke
Thanks that was really a quick answer. It works but I get this warning message anyway: 1: kein nicht-fehlendes Argument für min; gebe Inf zurück (None not- lacking argument for min; give Inf back) 2: kein nicht-fehlendes Argument für max; gebe -Inf zurück what does this mean? Greeting and

Re: [R] compare 2 vectors

2007-06-28 Thread Christophe Pallier
setdiff(b,a) is even simpler. On 6/28/07, Christophe Pallier [EMAIL PROTECTED] wrote: On 6/28/07, João Fadista [EMAIL PROTECTED] wrote: I would like to take out the values from one vector that are equal to the values in another vector. Example: a - c(1,2,3,4,5,6,7,8,9) b -

Re: [R] Repeat if

2007-06-28 Thread john seers \(IFR\)
Hi I think a for loop would be more what you want. Something along the lines of: V-list(a=c(1,2,3), b=c(2,3,4)) # list of 2 vectors for ( i in 1:2 ) { # 2 vectors (replace with 85 ...) print(range (V[i], na.rm = TRUE)) } Regards JS --- -Original Message- From:

[R] using self-written functions

2007-06-28 Thread R. Leenders
Hi, I am pretty new to R, so I apologize for the obvious question. I have worked with R for a few months now and in the process have written several functions that I frequently use in various data analysis projects. I tend to give each project a directory of its own and set the working directory

Re: [R] Repeat if

2007-06-28 Thread Christophe Pallier
Your V1 to V85 are probably coming from a data.frame, aren't they? If yes, and if this data.frame is named 'a', you can use 'sapply(a,range)' Otherwise, see ?get (get(paste(V,1,sep=)) returns V1) Christophe On 6/28/07, Birgit Lemcke [EMAIL PROTECTED] wrote: Hello, (Power Book G4, Mac OS X,

Re: [R] compare 2 vectors

2007-06-28 Thread Dimitris Rizopoulos
look at setdiff(), e.g., setdiff(b, a) 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/(0)16/336899 Fax: +32/(0)16/337015 Web:

[R] prior covariance in Mclust

2007-06-28 Thread Dieter Vanderelst
Hello, I'm trying to use Mclust to fit a Gaussian Mixture Model to a mulitdimensional data set. Because of the specific source of my data, I know that all components have the same variance and that the covariance between dimensions is zero (modelname=VII). Furthermore, I have a reliable

Re: [R] compare 2 vectors

2007-06-28 Thread Romain Francois
Christophe Pallier wrote: On 6/28/07, João Fadista [EMAIL PROTECTED] wrote: I would like to take out the values from one vector that are equal to the values in another vector. Example: a - c(1,2,3,4,5,6,7,8,9) b - c(3,10,20,5,6) b_noRepeats = c(10,20) b[!(b %in%

[R] aov and lme differ with interaction in oats example of MASS?

2007-06-28 Thread Karl Knoblick
Dear R-Community! The example oats in MASS (2nd edition, 10.3, p.309) is calculated for aov and lme without interaction term and the results are the same. But I have problems to reproduce the example aov with interaction in MASS (10.2, p.301) with lme. Here the script: library(MASS)

Re: [R] using self-written functions

2007-06-28 Thread Christophe Pallier
One quick and dirty way is to put all your functions inside a file, say /home/me/R/myfuncs.R, and add the following line at the beginning of your scripts: source('/home/me/R/myfuncs.R') This is dirty because if you need to change the location of this file, your scripts will cease to work.

[R] Writing - specyfic format

2007-06-28 Thread jastar
Hi all, I have a trouble - I need to write file in a very specyfic format. I have two vectors which different lengths and one data.frame (or matrix). I want to write it to *.txt file in following way: 1st row of file is my 1st vector (separate by spacebar) 2nd row of file is 2nd vector (also

Re: [R] using self-written functions

2007-06-28 Thread Gavin Simpson
On Thu, 2007-06-28 at 17:29 +0800, R. Leenders wrote: Hi, I am pretty new to R, so I apologize for the obvious question. I have worked with R for a few months now and in the process have written several functions that I frequently use in various data analysis projects. I tend to give each

Re: [R] compare 2 vectors

2007-06-28 Thread Alberto Monteiro
Romain Francois wrote: There is also a pretty useful operator %w/o% in the help page of %in%. see : ?`%in%` a - c(1,2,3,4,5,6,7,8,9) b - c(3,10,20,5,6) b %w/o% a [1] 10 20 I don't like the example. It's not obvious, in the expression... x[!x %in% y] ... that this is the

Re: [R] lme correlation structures

2007-06-28 Thread Gareth Hughes
Thanks for your help. I can weight the variances in the 2 groups using weights, as in lme(Y~1+time+sex+age, random=~1|indv, correlation=corAR1(form=~time|indv), weights=varIdent(form=~1|sex),method=ML) but what I would like is to have a different phi estimate for each gender, not just different

Re: [R] Meta-Analysis of proportions

2007-06-28 Thread Chuck Cleland
Monica Malta wrote: Dear colleagues, I'm conducting a meta-analysis of studies evaluating adherence of HIV-positive drug users into AIDS treatment, therefore I'm looking for some advice and syntax suggestion for running the meta-regression using proportions, not the usual OR/RR

[R] R 2.5.1 is released

2007-06-28 Thread Peter Dalgaard
I've rolled up R-2.5.1.tar.gz a short while ago. This is a maintenance release and fixes a number of mostly minor bugs and platform issues. See the full list of changes below. You can get it (in a short while) from http://cran.r-project.org/src/base/R-2/R-2.5.1.tar.gz or wait for it to be

Re: [R] : regular expressions: escaping a dot

2007-06-28 Thread Peter Dalgaard
Prof Brian Ripley wrote: This is explained in ?regexp (in the See Also of ?regexpr): Patterns are described here as they would be printed by 'cat': _do remember that backslashes need to be doubled when entering R character strings from the keyboard_. and in the R FAQ and

Re: [R] Repeat if

2007-06-28 Thread Jacques VESLOT
you may have a vector with only NA values in it... max(c(NA,NA), na.rm=T) [1] -Inf Warning message: aucun argument pour max ; -Inf est renvoyé Jacques VESLOT INRA - Biostatistique Processus Spatiaux Site Agroparc 84914 Avignon Cedex 9, France Tel: +33 (0) 4 32 72 21 58 Fax: +33 (0) 4 32 72 21

Re: [R] aov and lme differ with interaction in oats example of MASS?

2007-06-28 Thread Peter Dalgaard
Karl Knoblick wrote: Dear R-Community! The example oats in MASS (2nd edition, 10.3, p.309) is calculated for aov and lme without interaction term and the results are the same. But I have problems to reproduce the example aov with interaction in MASS (10.2, p.301) with lme. Here the

[R] Help in Bootstrapping

2007-06-28 Thread Regina Verghis
I have a time series (count) data.. Can you tell me the command for the parametric bootstrapping. My parameters are var to mean ratio and mean run length... -- [EMAIL PROTECTED] Regina M.Verghis, [[alternative HTML version deleted]] __

Re: [R] aov and lme differ with interaction in oats example of MASS?

2007-06-28 Thread Prof Brian Ripley
On Thu, 28 Jun 2007, Karl Knoblick wrote: Dear R-Community! The example oats in MASS (2nd edition, 10.3, p.309) is calculated for aov and lme without interaction term and the results are the same. But I have problems to reproduce the example aov with interaction in MASS (10.2, p.301) with

[R] Installing an old package in R-2.4.1

2007-06-28 Thread vladimir
I am new to R. We have a binary package that was not maintained for about a year, and the original maintainer is not around anymore. The package used to work in R-1.5.1. I used the following steps to install this package in R-2.4 on WinXP: Started the GUI Went into the menu Packages and

Re: [R] Repeat if

2007-06-28 Thread Peter Dalgaard
Birgit Lemcke wrote: Thanks that was really a quick answer. It works but I get this warning message anyway: 1: kein nicht-fehlendes Argument f�r min; gebe Inf zur�ck (None not- lacking argument for min; give Inf back) 2: kein nicht-fehlendes Argument f�r max; gebe -Inf zur�ck what does

Re: [R] Repeat if

2007-06-28 Thread Birgit Lemcke
Thats not the case. I have two vectosr with a lot of NAs, but not only NAs. But nevertheless as i saw the results are accurate. Birgit Am 28.06.2007 um 15:17 schrieb Jacques VESLOT: you may have a vector with only NA values in it... max(c(NA,NA), na.rm=T) [1] -Inf Warning message:

Re: [R] Repeat if

2007-06-28 Thread Birgit Lemcke
Hello John, I tried this code. But I got only the ranges of V1 and V2 what is easily understandable. Do I have to write in all 85 vectors in the first line? V-list(a=c(V1), b=c(V2)) for ( i in 1:85 ) { # 2 vectors (replace with 85 ...) + print(range (V[i], na.rm = TRUE)) + }

Re: [R] Repeat if

2007-06-28 Thread Birgit Lemcke
Thanks Christophe, I received already an answer with a similar suggestion. But thanks for your answer. Birgit Am 28.06.2007 um 12:34 schrieb Christophe Pallier: Your V1 to V85 are probably coming from a data.frame, aren't they? If yes, and if this data.frame is named 'a', you can use

Re: [R] Repeat if

2007-06-28 Thread Birgit Lemcke
Hello Patrick, this does not work and gives following warning message: for(i in 1:85) range(get(paste(V, i, sep=)), na.rm=TRUE) Warning messages: 1: kein nicht-fehlendes Argument für min; gebe Inf zurück 2: kein nicht-fehlendes Argument für max; gebe -Inf zurück This works but also with the

Re: [R] : regular expressions: escaping a dot

2007-06-28 Thread Prof Brian Ripley
On Thu, 28 Jun 2007, Peter Dalgaard wrote: Prof Brian Ripley wrote: This is explained in ?regexp (in the See Also of ?regexpr): Patterns are described here as they would be printed by 'cat': _do remember that backslashes need to be doubled when entering R character

[R] Adding different output to different lattice panels

2007-06-28 Thread alxsal
I would like to add a reference line to lattice graphs, with the reference line being different according to the factor level. Example : Draw 3 dotplots for a,b and c factors, and then add an horizontal line at y=10 for panel a, y=8 for panel b and y=6 for panel 4 I tried the code below, but

Re: [R] Repeat if

2007-06-28 Thread john seers \(IFR\)
Hi Birgit No, you do not have to write all 85 vectors in the first line. I just did not fully appreciate what you were trying to do. You could use the get option as was suggested somewhere else. So, if your vectors are V1 to V2 (i.e. 85) say, something like: V1-c(1,2,3) V2-c(5,2,7) ...

[R] align() function missing in R ?

2007-06-28 Thread Markus Loecher
Dear list members, I switched from Splus to R a few years ago and so far found no functionality missing. However, I am struggling to find the equivalent align() function for time series. I did find some reduced functionality such as alignDailySeries in package:fCalendar but the full capability

[R] embedFonts() and bounding box

2007-06-28 Thread Christoph Buser
Dear R gurus I have a question regarding the function embedFonts(). I assume the in that function which calls gs, the bounding box of the eps file is changed. Is that by intention? Do I have call explicitly some gs-options to avoid it and if yes, how? Thank you very much for your help. Best

Re: [R] Adding different output to different lattice panels

2007-06-28 Thread hadley wickham
On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to add a reference line to lattice graphs, with the reference line being different according to the factor level. Example : Draw 3 dotplots for a,b and c factors, and then add an horizontal line at y=10 for panel a, y=8 for

Re: [R] TukeyHSD

2007-06-28 Thread Christophe Pallier
Are you sure that Tukey's HSD (or any other usual multiple comparison procedure) applies to within-subject factors? I do not have my stats books (e.g. Winer or Kirk) to check. You can get some output with: TukeyHSD(aov(hand:gaze+subject)) (assuming you ant to compare the cells defined by

Re: [R] Repeat if

2007-06-28 Thread Birgit Lemcke
Sorry Jacques and all the other helpful people! I made a mistake because I didn´t realize that I have a vector only containing NAs. That happened during standardization and i didn´t check this. I apologize for that. Greetings Birgit Am 28.06.2007 um 15:17 schrieb Jacques VESLOT: you may

Re: [R] TukeyHSD

2007-06-28 Thread Richard M. Heiberger
TukeyHSD takes an aov object, not an aovlist object. The result of aov() with an Error() term is an aovlist object. In the HH package, see ?MMC for an example of how to work around this limitation. See the maiz example. Rich __

[R] R.matlab questions

2007-06-28 Thread Spencer Graves
Hello: Two questions about R.matlab: 1. How to break a hung R-Matlab connection? 2. How to execute R.matlab commands from within a function? BREAKING AN R-Matlab CONNECTION Sometimes an attempted R.matlab command locks up my computer. The

Re: [R] Adding different output to different lattice panels

2007-06-28 Thread deepayan . sarkar
On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to add a reference line to lattice graphs, with the reference line being different according to the factor level. Example : Draw 3 dotplots for a,b and c factors, and then add an horizontal line at y=10 for panel a, y=8 for

Re: [R] Writing - specyfic format

2007-06-28 Thread Earl F. Glynn
jastar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I have a trouble - I need to write file in a very specyfic format. I have two vectors which different lengths and one data.frame (or matrix). I want to write it to *.txt file in following way: 1st row of file is my 1st

[R] Method dispatch in functions?

2007-06-28 Thread John McHenry
Hi, Could someone point me in the right direction for documentation on the following question? Let's say I have two objects a and b of classes A and B, respectively. Now let's say I write a function foo that does something similar to objects of type A and B. Basically I want to overload the

[R] Error en assign(mname, def, where)

2007-06-28 Thread Martín Gastón
Hi R users, I am working with the fda package but when I call the function pca.fd I obtain a message error, which I cann't identify. The error say That : error in assihn(mname,def,where), is not possible to add links to a blockade enviroment. The orther that I'm writting is: cp1 -

Re: [R] Meta-Analysis of proportions

2007-06-28 Thread Michael Dewey
At 09:58 28/06/2007, Chung-hong Chan wrote: OpenBUGS should be something related to Bayesian statistics. You may refer to Chapter 12 of Handbook http://cran.r-project.org/doc/vignettes/HSAUR/Ch_meta_analysis.pdf It talks about meta-regression. On 6/28/07, Monica Malta [EMAIL PROTECTED] wrote:

[R] R function command on a list

2007-06-28 Thread G E
Hello R: I am working with a self-defined function and I wish to subject a list (t) to this function. My list is a list of tables: $rs7609589 2/2 2/4 4/4 2/2 2/4 4/4 89 188 87 89 188 87 $rs3909907 1/1 1/4 4/4 94 178 92 $rs12748004 0/0 1/3 3/3 37 150 177 $rs6695928 2/2 2/4 4/4 35

[R] TukeyHSD

2007-06-28 Thread Patrick Bedard
Hello everyone, So I ran an anova with aov and then I want to run post-hoc comparisons but keep receiving this message : no applicable method for TukeyHSD Here is my code: d-read.table(d.txt) d Obs subj Hand GazeRT 11 s111 401.4 22 s211 363.3..

Re: [R] R function command on a list

2007-06-28 Thread Henrique Dallazuanna
Try whit rownames. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 28/06/07, G E [EMAIL PROTECTED] wrote: Hello R: I am working with a self-defined function and I wish to subject a list (t) to this function. My list is a list of tables: $rs7609589 2/2 2/4

[R] stack multiple plots on one page

2007-06-28 Thread Jiong Zhang, PhD
Hi All, I typed pairs to see its code but did not get what I want. How do I see its code? What I am trying to do, is to stack about 10 scatter plots on one page as the way pairs does. I have about 150 variables in my table. Instead of plotting 150X150 pairs using pairs, I only need to plot 10

Re: [R] stack multiple plots on one page

2007-06-28 Thread Henrique Dallazuanna
https://svn.r-project.org/R/branches/R-2-5-branch/src/library/graphics/R/pairs.R -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 28/06/07, Jiong Zhang, PhD [EMAIL PROTECTED] wrote: Hi All, I typed pairs to see its code but did not get what I want. How do I see

[R] Evaluating predictive power with no intercept-statistics question - not R question

2007-06-28 Thread Leeds, Mark \(IED\)
I realize that the following has been talked about on this list many times before in some related way but I am going to ask for help anyway because I still don't know what to do. Suppose I have no intercept models such as the following : Y = B*X_1 + error Y = B*X_2 + error Y = B*X_3 + error Y =

[R] Course in Boston** R/Splus Fundamentals and Programming Techniques

2007-06-28 Thread elvis
XLSolutions Corporation (www.xlsolutions-corp.com) is making a last call for our July 2007 R/S-plus Fundamentals and Programming Techniques : www.xlsolutions-corp.com/Rfund.htm In Boston *** July 16 - 17, 2007 Reserve your seat now at the early bird rates! Payment due AFTER the class Course

Re: [R] stack multiple plots on one page

2007-06-28 Thread Benilton Carvalho
or just type: pairs.default b On Jun 28, 2007, at 2:36 PM, Henrique Dallazuanna wrote: https://svn.r-project.org/R/branches/R-2-5-branch/src/library/ graphics/R/pairs.R -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 28/06/07, Jiong Zhang, PhD [EMAIL

Re: [R] no applicable method

2007-06-28 Thread Kyle Ellrott
You actually got it right. I didn't realize there was a difference between a data frame and matrix. What is the difference any way? Seems like all two dimensional arrays should be equivalent. Kyle On Wed, 27 Jun 2007, Kyle Ellrott wrote: I'm getting started in R, and I'm trying to use

Re: [R] R function command on a list

2007-06-28 Thread Georg Ehret
Thank you Henrique, rownames also gives me the header of the table, but not the name of the list-element... Any other idea? Wishing you a good day, Georg. ** Georg Ehret Johns Hopkins University Baltimore On 6/28/07, Henrique Dallazuanna [EMAIL PROTECTED] wrote: Try whit rownames.

Re: [R] Loading problem with XML_1.9

2007-06-28 Thread Martin Morgan
Weijun -- If memory is a problem, you might try using the 'handler' argument of xmlTreeParse. This provides access to each node as it is processed, so that you can, for instance, choose to ignore nodes, or save only numeric values, or ... I'm not sure whether the entire document is read into a C

[R] Function call within a function.

2007-06-28 Thread John Kane
I am trying to call a funtion within another function and I clearly am misunderstanding what I should do. Below is a simple example. I know lstfun works on its own but I cannot seem to figure out how to get it to work within ukn. Basically I need to create the variable nts. I have probably missed

Re: [R] Error en assign(mname, def, where)

2007-06-28 Thread hadley wickham
Hi Martin, Could you please provide a minimal replicable example so that we can investigate further. Thanks, Hadley On 6/28/07, Martín Gastón [EMAIL PROTECTED] wrote: Hi R users, I am working with the fda package but when I call the function pca.fd I obtain a message error, which I cann't

Re: [R] R function command on a list

2007-06-28 Thread Henrique Dallazuanna
Perhaps, you can get the name of list element whit: unlist(lapply(list_name, rownames)) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 28/06/07, Georg Ehret [EMAIL PROTECTED] wrote: Thank you Henrique, rownames also gives me the header of the table, but not

[R] mixed-effects model using lmer

2007-06-28 Thread hlynch
Hello R-users, I have been trying to fit what I think is a simple mixed-effects model using lmer (from lme4), but I've run into some difficulty that I have not been able to resolve using the existing archives or Pinheiro and Bates (2000). I am measuring populations (of birds) which change with

[R] sampling question

2007-06-28 Thread Kirsten Beyer
I am interested in locating a script to implement a sampling scheme that would basically make it more likely that a particular observation is chosen based on a weight associated with the observation. I am trying to select a sample of ~30 census blocks from each ZIP code area based on the

[R] applying max elementwise to two vectors

2007-06-28 Thread Afshartous, David
All, Is there one liner way to obtain the max per observation for two vectors? I looked at apply and lapply but it seems that groundwork would have to be done before applying either of those. The code below does it but seems like overkill. Thanks! Dave x = rnorm(10) y = rnorm(10) ind =

[R] Wilcoxon Rank Sum Test.

2007-06-28 Thread Marcus Vinicius
Dear, I'm using R software to evaluate Wilcoxon Rank Sum Test and I' getting one Warning message as this: C1dea_com [1] 1.000 0.345 0.200 0.208 0.508 0.480 0.545 0.563 0.451 0.683 0.380 0.913 1.000 0.506 C1dea_sem [1] 1.000 0.665 0.284 0.394 0.509 0.721 0.545 0.898 0.744 0.683 0.382 0.913

Re: [R] Sweave bug? when writing figures / deleting variable in chunk

2007-06-28 Thread D G Rossiter
Thanks to the four distinguished R'ers who answered. I have used Sweave intensively for over a year, and have poured through all the doc. as well as the help archives, and could find nothing on this. It is now well known to me! since it bit me, but it did cost me a day of head-scratching

Re: [R] Sweave bug? when writing figures / deleting variable in chunk

2007-06-28 Thread Friedrich Leisch
On Thu, 28 Jun 2007 08:14:44 -0400, D G Rossiter (DGR) wrote: Thanks to the four distinguished R'ers who answered. I have used Sweave intensively for over a year, and have poured through all the doc. as well as the help archives, and could find nothing on this. It is now well

[R] Changing graphics height when using grid and lattice

2007-06-28 Thread Jim Price
Hi, I have recently been playing with the grid package in an attempt to create some pages containing multiple lattice plots on the same page. However, when I specify a grid layout with different widths, such as: pushViewport(viewport(layout = grid.layout(1, 2, unit(c(2, 1), null the

Re: [R] Wilcoxon Rank Sum Test.

2007-06-28 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marcus Vinicius Sent: Thursday, June 28, 2007 1:32 PM To: r-help@stat.math.ethz.ch Subject: [R] Wilcoxon Rank Sum Test. Dear, I'm using R software to evaluate Wilcoxon Rank Sum Test and I'

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Sebastian P. Luque
On Thu, 28 Jun 2007 16:19:39 -0400, Afshartous, David [EMAIL PROTECTED] wrote: All, Is there one liner way to obtain the max per observation for two vectors? I looked at apply and lapply but it seems that groundwork would have to be done before applying either of those. The code below

Re: [R] sampling question

2007-06-28 Thread Greg Snow
The sample function has a prob argument that determines the probabilities of each element being sampled, put your proportion of women in there and see if that works for you. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111

Re: [R] Function call within a function.

2007-06-28 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Kane Sent: Thursday, June 28, 2007 12:04 PM To: R R-help Subject: [R] Function call within a function. I am trying to call a funtion within another function and I clearly am misunderstanding

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Afshartous, David
thanks all. yes, pmax(x,y) gets it straight away. sorry for missing this when I checked the docs. -Original Message- From: Greg Snow [mailto:[EMAIL PROTECTED] Sent: Thursday, June 28, 2007 5:26 PM To: Afshartous, David; r-help@stat.math.ethz.ch Subject: RE: [R] applying max

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Bert Gunter
Please... use and **read** the docs: ?max --- pmax Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Afshartous, David Sent: Thursday, June 28, 2007 1:20 PM To: r-help@stat.math.ethz.ch Subject: [R] applying max elementwise to two vectors

Re: [R] Wilcoxon Rank Sum Test.

2007-06-28 Thread Achim Zeileis
On Thu, 28 Jun 2007 14:18:52 -0700 Nordlund, Dan (DSHS/RDA) wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marcus Vinicius Sent: Thursday, June 28, 2007 1:32 PM To: r-help@stat.math.ethz.ch Subject: [R] Wilcoxon Rank Sum Test.

Re: [R] Adding different output to different lattice panels

2007-06-28 Thread Alexandre Salvador
Selon [EMAIL PROTECTED]: On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to add a reference line to lattice graphs, with the reference line being different according to the factor level. Example : Draw 3 dotplots for a,b and c factors, and then add an horizontal

Re: [R] Adding different output to different lattice panels

2007-06-28 Thread Alexandre Salvador
Selon Deepayan Sarkar [EMAIL PROTECTED]: On 6/28/07, Alexandre Salvador [EMAIL PROTECTED] wrote: Selon [EMAIL PROTECTED]: On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to add a reference line to lattice graphs, with the reference line being different

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Greg Snow
Are you looking for pmax? (look at the help ?pmax and the examples and see if that does what you want). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] Writing - specyfic format

2007-06-28 Thread jastar
That's exactly what I need. Thank's a lot!! Earl F. Glynn wrote: jastar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I have a trouble - I need to write file in a very specyfic format. I have two vectors which different lengths and one data.frame (or matrix). I

Re: [R] Function call within a function.

2007-06-28 Thread Stephen Tucker
Dear John, Perhaps I am mistaken in what you are trying to accomplish but it seems like what is required is that you call lstfun() outside of ukn(). [and remove the call to lstfun() in ukn()]. nts - lstfun(myfile, aa, bb) results - ukn(dd1, a, b, nts$cda) Alternatively, you can eliminate the

Re: [R] Function call within a function.

2007-06-28 Thread Jason Barnhart
The problem isn't the function call. First, list1 returned by lstfun does not name its elements so nts$cda won't work. See code change in lstfun. Second, specifying nts$cda as the nam1 argument tells R to look for the nts object in the environment in which ukn is called. However, the nts

Re: [R] Adding different output to different lattice panels

2007-06-28 Thread Deepayan Sarkar
On 6/28/07, Alexandre Salvador [EMAIL PROTECTED] wrote: Selon [EMAIL PROTECTED]: On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I would like to add a reference line to lattice graphs, with the reference line being different according to the factor level. Example : Draw 3

Re: [R] sampling question

2007-06-28 Thread Adaikalavan Ramasamy
Lets assume your zcta data looks like this set.seed(12345) ## temporary for reproducibility zcta - data.frame( zipcode=LETTERS[1:5], prop=runif(5) ) zcta zipcode prop 1 A 0.7209039 2 B 0.8757732 3 C 0.7609823 4 D 0.8861246 5 E 0.4564810 This

[R] exaustive subgrouping or combination

2007-06-28 Thread David Duffy
Waverley [EMAIL PROTECTED] asked: Dear Colleagues, I am looking for a package or previous implemented R to subgroup and exaustively divide a vector of squence into 2 groups. -- Waverley @ Palo Alto Google [R] Generating all possible partitions and you will find some R code from 2002

Re: [R] Changing graphics height when using grid and lattice

2007-06-28 Thread Deepayan Sarkar
On 6/28/07, Jim Price [EMAIL PROTECTED] wrote: Hi, I have recently been playing with the grid package in an attempt to create some pages containing multiple lattice plots on the same page. However, when I specify a grid layout with different widths, such as: pushViewport(viewport(layout =

[R] logistic regression and dummy variable coding

2007-06-28 Thread Bingshan Li
Hello everyone, I have a variable with several categories and I want to convert this into dummy variables and do logistic regression on it. I used model.matrix to create dummy variables but it always picked the smallest one as the reference. For example,

Re: [R] logistic regression and dummy variable coding

2007-06-28 Thread Marc Schwartz
On Thu, 2007-06-28 at 18:16 -0500, Bingshan Li wrote: Hello everyone, I have a variable with several categories and I want to convert this into dummy variables and do logistic regression on it. I used model.matrix to create dummy variables but it always picked the smallest one as the

Re: [R] logistic regression and dummy variable coding

2007-06-28 Thread Seyed Reza Jafarzadeh
NewVar - relevel( factor(OldVar), ref = b) should create a dummy variable, and change the reference category for the model. Reza On 6/28/07, Bingshan Li [EMAIL PROTECTED] wrote: Hello everyone, I have a variable with several categories and I want to convert this into dummy variables and do

Re: [R] logistic regression and dummy variable coding

2007-06-28 Thread Bingshan Li
Hi All, Now it works. Thanks for all your answers and the explanations are very clear. Bingshan On Jun 28, 2007, at 7:44 PM, Seyed Reza Jafarzadeh wrote: NewVar - relevel( factor(OldVar), ref = b) should create a dummy variable, and change the reference category for the model. Reza

  1   2   >