[R] lsmeans in R

2009-03-10 Thread suman Duvvuru
I need help with calculating lsmeans (adjusted means) of different terms in a linear model including the main effect and the interaction effect terms. I use lm to run the linear models...I previously noted from literature that that "effects" package can be used to generate lsmeans. But I tried to u

Re: [R] Converting a dataframe to a matrix

2009-03-10 Thread markleeds
Hi: Below works but it's extremely ugly and overly complicated. i'm sure someone else will send you something better and I'll be waiting also. Also, the way I named the rows and columns works for below but it won't hold in the general case if you don't have nice ordered names like you do below.

Re: [R] Converting a dataframe to a matrix

2009-03-10 Thread Simon Blomberg
xtabs is your friend: xtabs(likes ~ color + name, data=dat) color nameblue green red jake 1 1 0 sally1 1 0 tom 0 0 1 See ?xtabs for more info. Note that I changed the "likes?" column to just "likes". It is a bad idea to have question marks in varia

[R] prediction error for test set-cross validation

2009-03-10 Thread Mehmet U Ayvaci
Hi, I have a database of 2211 rows with 31 entries each and I manually split my data into 10 folds for cross validation. I build logistic regression model as: >model <- glm(qual ~ AgGr + FaHx + PrHx + PrSr + PaLp + SvD + IndExam + Rad +BrDn + BRDS + PrinFin+ SkRtr + NpRtr +

Re: [R] North Arrow (.png file) on a Map

2009-03-10 Thread Yihui Xie
Is this "arrow" satisfactory for you? north.arrow = function(x, y, h) { polygon(c(x, x, x + h/2), c(y - h, y, y - (1 + sqrt(3)/2) * h), col = "black", border = NA) polygon(c(x, x + h/2, x, x - h/2), c(y - h, y - (1 + sqrt(3)/2) * h, y, y - (1 + sqrt(3)/2) * h)) text(x, y, "N", adj = c(

[R] Converting a dataframe to a matrix

2009-03-10 Thread Jennifer Brea
If I have a dataframe which is organized like this: name color likes? 1 sally red0 2 sally blue1 3 sally green1 4 jake red0 5 jake blue1 6 jake green1 7 tom red1 8 tom blue0 9 tom green0 And I want to create a matrix in the form: red

[R] Creating a directory for my data

2009-03-10 Thread miya
Hi everyone, I am currently working with a very large data set. It is data collected a few times a day, so there are repeated titles in the data set. I want to assign an id number to each different title and enter this information in a directory that I can access whenever I am working with the dat

Re: [R] Cholesky Decomposition in R

2009-03-10 Thread megh
A=matrix(c(1,1,1,1,5,5,1,5,14),nrow=3) t(eigen(A)$vector) %*% A %*% eigen(A)$vector mat1 = t(eigen(A)$vector) mat2 = diag(eigen(A)$values)# this is your diagonal matrix Manli Yan wrote: > > Hi everyone: > I try to use r to do the Cholesky Decomposition,which is A=LDL',so far I > only f

Re: [R] Using napredict in prcomp

2009-03-10 Thread Prof Brian Ripley
On Tue, 10 Mar 2009, Alain Paquette wrote: Hello all, I wish to compute site scores using PCA (prcomp) on a matrix with missing values, for example: DrainSlopeOrgL a41NA b2.5396 c6845 d3912 e3164 ... Where a,b... are site

[R] read.exp?

2009-03-10 Thread Adam D. I. Kramer
Dear Colleagues, The foreign library, ever-exceptionally useful, does not seem able to deal with this ancient SPSS ascii portable file I have with extension '.exp'. If anybody has familiarity with this filetype and could point me towards an R function that would allow me to get t

Re: [R] Question about datatypes/plotting issue

2009-03-10 Thread David Winsemius
You need to convert W$Date into a real date variable. At the moment it is just a character variable. > str(W) 'data.frame': 265 obs. of 23 variables: $ Date: Factor w/ 265 levels " ","April 1987",..: 1 90 68 156 2 178 134 ... $ AZ.Phoenix : Factor w/ 236 levels "","100.0

Re: [R] Nesting order for mixed models

2009-03-10 Thread Douglas Bates
On Tue, Mar 10, 2009 at 2:47 PM, Jon Zadra wrote: > Hello, > I am confused about the order of nesting in mixed models using functions > like aov(), lme(), lmer(). > I have the following data: > n subjects in either condition A or B > each subject tested at each of 3 numerical values ("distance"

Re: [R] mean +/- SEM

2009-03-10 Thread David Winsemius
?mean ?sd ?plot The request to plot mean has no context yet. What sort of problem are you working with? You will get better answers if you first read the Posting Guide and then provide example data. -- David Winsemius On Mar 10, 2009, at 6:39 PM, Stefo Ratino wrote: Hi all, I am looking

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread jimdare
Excellent, thank you very much :) Sundar Dorai-Raj-2 wrote: > > I don't believe Elena's suggestion will work. However, the following will: > > xyplot(..., scales = list(y = list(at = seq(5, 25, 5 > > though you may need to extend the limits a little as well: > > xyplot(..., ylim = latt

[R] mean +/- SEM

2009-03-10 Thread Stefo Ratino
Hi all, I am looking for a R function which unables me to plot mean +/- SEM. Is there such a function in R? Many thanks, Stefo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

[R] tcltk - insert scrollbar to window

2009-03-10 Thread thoeb
Hello, I hava a problem with inserting a scrollbar into a tcltk toplevel. The comand is as follows: require(tcltk) tt<-tktoplevel() tkgrid(tklabel(tt,text="Choose path to the meteorology file used for CDM")) OnOK2 <- function(){ wind.file<<-read.csv2(file.choose(),header=T,sep=";",dec=".")

Re: [R] extracting dispersion parameter from quasipoisson lmer model

2009-03-10 Thread liujb
Hello, I have the exact same question: how to extract dispersion parameter from lmer() quasipoisson model? I did a search here and saw this post. However, I do not see answer. Could somebody please help? Thank you very much, Julia wayne hallstrom wrote: > > Hi, > I would like to obtain the

[R] 2 dimension convolve

2009-03-10 Thread GreenBrower
Anybody know how to do a fast 2 dimension convolve in R? I used a traditional method, but it's very slow, even can not stand it! -- View this message in context: http://www.nabble.com/2-dimension-convolve-tp22440837p22440837.html Sent from the R help mailing list archive at Nabble.com.

[R] removing daylight savings in R

2009-03-10 Thread Rhiannon Marchant
Hello, Thanks the Prof. Brian Ripley for his earlier response, however I still have a few issues with the times in R. I'd like to somehow set up R so it automatically has the timezone set to Western Australian standard time when I open up a workspace instead of Western Australian

Re: [R] test two correlation coefficients against each other

2009-03-10 Thread William Revelle
Martin, See r.test in the psych package. This will probably do what you want to do. Bill At 1:29 AM +0100 3/11/09, Martin Batholdy wrote: hi, is there a function in R that calculates the probability that two correlation coefficients are from the same population? thanks! ___

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread Sundar Dorai-Raj
I don't believe Elena's suggestion will work. However, the following will: xyplot(..., scales = list(y = list(at = seq(5, 25, 5 though you may need to extend the limits a little as well: xyplot(..., ylim = lattice:::extend.limits(c(0, 30))) and add the scales argument from the first example

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread jimdare
Yes, I have tried this. Unfortunately it doesn't seem to work i.e. it still shows 5,10,15,20,25. Elena Wilson-2 wrote: > > Have you tried specifying the levels of y's you want to display, e.g. > ylim=c(0,5,10,15,20,30)? > > -Original Message- > From: r-help-boun...@r-project

Re: [R] Cholesky Decomposition in R

2009-03-10 Thread Douglas Bates
On Tue, Mar 10, 2009 at 4:33 PM, Manli Yan wrote: >  Hi everyone: >  I try to use r to do the Cholesky Decomposition,which is A=LDL',so far I > only found how to decomposite A in to  LL' by using chol(A),the function > Cholesky(A) doesnt work,any one know other command to decomposte A in to > LDL'

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread Elena Wilson
Have you tried specifying the levels of y's you want to display, e.g. ylim=c(0,5,10,15,20,30)? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jimdare Sent: Wednesday, 11 March 2009 12:50 PM To: r-help@r-project.org Subje

Re: [R] Question about datatypes/plotting issue

2009-03-10 Thread Gabor Grothendieck
There are two header lines which is confusing it. Use pattern= to start at the second one. See the three vignettes in zoo for info on the rest. library(gdata) W <- read.xls("http://www2.standardandpoors.com/spf/pdf/index/CSHomePrice_History_022445.xls";, pattern = "LXXR") library(zoo) w <- zoor

Re: [R] Matrices in R - Simple question?

2009-03-10 Thread David Winsemius
I suspect you probably need to provide an example that illustrates why this seems difficult: > x <- 1:10 > f1 <- function(x) exp(x) > g1 <- function (x) log(x) > h1 <- function (x) x^(1/2) # any of these functions would return a 10 element vector if given x as an argument > f1(x)*g1(x)*h1(x

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread jimdare
Thanks very much.One other thing... see how the Y axis begins before 0. At first glance it appears that the 0's are actually worth something. When I use ylim=c(0,30) I get the graph I want, but the tick marks show only 5,10,15,20,25. I want them to show 0,5,10,15,20,30. Does anyone know ho

[R] anyone can help me with Cholesky Decomposition

2009-03-10 Thread Manli Yan
Hi: what I want to do is decompose the a symmetric matrix A into this form A=LDL' hence TAT'=D,T is inverse of (L)and T is a lower trangular matrix,and D is dignoal matrix for one case A=1 1 1 1 5 5 1 5 14 T=inverse(L)= 1 0 0 -1 1 0 0 -1 1 D=(1,

[R] test two correlation coefficients against each other

2009-03-10 Thread Martin Batholdy
hi, is there a function in R that calculates the probability that two correlation coefficients are from the same population? thanks! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] Pseudo-random numbers between two numbers

2009-03-10 Thread Ted Harding
I have modified my example to make it more convincing! See at end. On 10-Mar-09 23:39:17, Ted Harding wrote: > On 10-Mar-09 23:01:45, g...@ucalgary.ca wrote: >> Please forget the last email I sent with the same subject. >> = >> I would like to generate pseudo-random numbers between

[R] Centering multi-line strip text in lattice

2009-03-10 Thread Mike Lawrence
I'm having trouble centering multi-line strip text in lattice. As the code below demonstrates bounding box of the text is centered within the strip, but the first line isn't centered in relation to the longer second line. The "adj" argument to par.strip.text doesn't seem to do much. Suggestions? a

[R] Matrices in R - Simple question?

2009-03-10 Thread Lars Bishop
Hi, I'm a new R user and would appreciate your help regarding the following: Can I create a matrix whose elements are n functions of a vector x? In my problem I have 3 vectors (a,b,c) with elements a=[f1(x) f2(x)fn(x)]; b=[g1(x) g2(x)gn(x)]; c=[h1(x) h2(x)hn(x)]. I need to create a fin

Re: [R] Pseudo-random numbers between two numbers

2009-03-10 Thread Ted Harding
On 10-Mar-09 23:01:45, g...@ucalgary.ca wrote: > Please forget the last email I sent with the same subject. > = > I would like to generate pseudo-random numbers between two numbers > using R, up to a given distribution, for instance, norm. That is > something like > rnorm(HowMany,Mi

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread Bert Gunter
... but in general ?strip.default will explain these matters. In particular, note the style argument. Cheers, Bert Gunter Genentech Nonclinical Biostatistics 650-467-7374 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Elena W

[R] Pseudo-random numbers between two numbers

2009-03-10 Thread guox
Please forget the last email I sent with the same subject. = I would like to generate pseudo-random numbers between two numbers using R, up to a given distribution, for instance, norm. That is something like rnorm(HowMany,Min,Max,mean,sd) over rnorm(HowMany,mean,sd). I am wondering

Re: [R] help structuring mixed model using lmer()

2009-03-10 Thread Ben Bolker
Mark Difford yahoo.co.uk> writes: > Briefly, y ~ x1 * x2 expands to y ~ x1 + x2 + x1:x2, where the last term > (interaction term) amounts to a test of slope. Normally you would read its > significance from F/chisq/p-value. Many practitioners consider the L.Ratio > test to be a better option. For

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread Elena Wilson
With you first question, I had a similar problem when the year (in my case it was sample size) variable was numeric. Add as.factor in front of it and it should show you the actual levels... -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] O

Re: [R] 2 Simple Lattice Plot Questions

2009-03-10 Thread Sundar Dorai-Raj
Convert Year to a factor and both problems will be solved. --sundar On Tue, Mar 10, 2009 at 3:48 PM, jimdare wrote: > > Hi, > > I have created the plot below and have a few questions about changes. > > 1) How do I change the "Year" title of each plot so it reads from the top > "2006","2007","200

[R] 2 Simple Lattice Plot Questions

2009-03-10 Thread jimdare
Hi, I have created the plot below and have a few questions about changes. 1) How do I change the "Year" title of each plot so it reads from the top "2006","2007","2008","2009". 2) How do I get rid of those vertical grey bars in the title bar of each plot? I apologise for my ignorance... one o

[R] Pseudo-random numbers between two numbers

2009-03-10 Thread guox
I would like to generate pseudo-random numbers between two numbers using R, up to a given distribution, for instance, rnorm. That is something like rnorm(HowMany,Min,Max,mean,sd) over rnorm(HowMany,mean,sd). I am wondering if dnorm(runif(HowMany, Min, Max), mean, sd) is good. Any idea? Thanks. -

Re: [R] puzzled by math on date-time objects

2009-03-10 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > I have documented some of these issues in my email "Semantics of > sequences in R" (22/02/2009 3:42 PM) and other emails, and I have > proposed to write code to resolve them, but have not received a warm > reception. > you said 'it *is* a mess', didn't you? warm re

Re: [R] puzzled by math on date-time objects

2009-03-10 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > It does seem sensible that median and quantile would work for the > POSIXct, Date, and other classes for which they are logically > well-defined, but strangely enough, they do not (except for odd-length > input). The summary function has a special case (summary.POSIXct) >

Re: [R] Cholesky Decomposition in R

2009-03-10 Thread Albyn Jones
try Cholesky() in package Matrix. albyn On Tue, Mar 10, 2009 at 02:33:01PM -0700, Manli Yan wrote: > Hi everyone: > I try to use r to do the Cholesky Decomposition,which is A=LDL',so far I > only found how to decomposite A in to LL' by using chol(A),the function > Cholesky(A) doesnt work,any

Re: [R] R equivalent to MATLAB's "whos" Command?

2009-03-10 Thread Scillieri, John
Something similar in case anyone is interested, my own 'lls' command: # This function performs a similar operation to the Unix command 'ls -l' # It works like ls() in R except that it will also display object class,

Re: [R] R equivalent to MATLAB's "whos" Command?

2009-03-10 Thread David Winsemius
Learn to use R-search. http://search.r-project.org/nmz.html The obvious search strategy, ls size, seemed effective. -- On Mar 10, 2009, at 5:29 PM, Jason Rupert wrote: Wow. Thank you for your quick response. However, I'm looking for an R command that lists what is currently in the R

Re: [R] puzzled by math on date-time objects

2009-03-10 Thread Stavros Macrakis
It does seem sensible that median and quantile would work for the POSIXct, Date, and other classes for which they are logically well-defined, but strangely enough, they do not (except for odd-length input). The summary function has a special case (summary.POSIXct) which does the straightforward, o

[R] max-nsize, cons : what do they all mean?

2009-03-10 Thread Saptarshi Guha
Hello R users, I had recently run an R session where a particular function ran several thousand times, i think into the hundreds of thousands. I got this error related to cons cells, which I fixed by starting (actually Rserve) with the --max-nsize=1G option. I read the help page, but didn't quite

Re: [R] R equivalent to MATLAB's "whos" Command?

2009-03-10 Thread andrew
I saw this in http://groups.google.com.au/group/r-help-archive/browse_thread/thread/7dca300a7fde5286/718dc5f1405618c9?lnk=gst&q=sort(+sapply(ls()%2Cfunction(x){object.size(get(x))}))#718dc5f1405618c9 The command is something like sort( sapply(ls(),function(x){object.size(get(x))})) very useful,

Re: [R] Cholesky Decomposition in R

2009-03-10 Thread Ravi Varadhan
You can use singular value decomposition: ?svd > svd(A) $d [1] 16.3405917 2.8996176 0.7597907 # This is your diagonal matrix "D" $u [,1] [,2][,3] [1,] 0.08585595 -0.2420411 0.96645997 [2,] 0.40826313 -0.8763116 -0.25573252 [3,] 0.90881790 0.4165261 0.02357989 $v

[R] Cholesky Decomposition in R

2009-03-10 Thread Manli Yan
Hi everyone: I try to use r to do the Cholesky Decomposition,which is A=LDL',so far I only found how to decomposite A in to LL' by using chol(A),the function Cholesky(A) doesnt work,any one know other command to decomposte A in to LDL' My r code is: library(Matrix) A=matrix(c(1,1,1,1,5,5,1,

Re: [R] R equivalent to MATLAB's "whos" Command?

2009-03-10 Thread Wacek Kusnierczyk
Jason Rupert wrote: > Â > By any chance is there an R equivalent to MATLAB's "whos" command? > whos = function(envir=parent.frame()) print(sapply(ls(envir=envir), USE.NAMES=TRUE, get, envir=envir)) or simply whos = ls.str and x = 1 y = 2 whos() vQ _

Re: [R] R equivalent to MATLAB's "whos" Command?

2009-03-10 Thread Jason Rupert
Wow. Thank you for your quick response. However, I'm looking for an R command that lists what is currently in the R workspace. Here is a link to a description of the MATLAB "whos" command: http://www.math.carleton.ca/old/help/matlab/MathWorks_R13Doc/techdoc/ref/who.html Essentially, it does t

[R] Using napredict in prcomp

2009-03-10 Thread Alain Paquette
Hello all, I wish to compute site scores using PCA (prcomp) on a matrix with missing values, for example: DrainSlopeOrgL a41NA b2.5396 c6845 d3912 e3164 ... Where a,b... are sites. The command > pca<-prcomp(~ Drain + Slope

Re: [R] R equivalent to MATLAB's "whos" Command?

2009-03-10 Thread Jorge Ivan Velez
Dear Jason, How about this? ?ls() ls() HTH, Jorge On Tue, Mar 10, 2009 at 5:05 PM, Jason Rupert wrote: >  > By any chance is there an R equivalent to MATLAB's "whos" command? >  > I tried searching R and R-seek, but didn't really come up with anything. >  > There are several items I would

Re: [R] popular R packages

2009-03-10 Thread Tom Backer Johnsen
s...@xlsolutions-corp.com wrote: Hi Spencer, XLSolutions is currently analyzing r-help archived questions to rank packages for the upcoming R-PLUS 3.3 Professional version and we will be happy to share the outcome with interested parties. Please email d...@xlsolutions-corp.com I would expect

[R] R equivalent to MATLAB's "whos" Command?

2009-03-10 Thread Jason Rupert
  By any chance is there an R equivalent to MATLAB's "whos" command?   I tried searching R and R-seek, but didn't really come up with anything.    There are several items I would like to make sure are stored in the workspace and check their values.   Thank you again for your help and any fe

Re: [R] require() is not giving TRUE / FALSE statements ?

2009-03-10 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 10/03/2009 4:40 PM, Wacek Kusnierczyk wrote: >> Duncan Murdoch wrote: >>> On 10/03/2009 4:15 PM, Wolfgang Raffelsberger wrote: Dear list, ?require says : "... |require| is designed for use inside other functions; it returns |FALSE| and gives a war

Re: [R] require() is not giving TRUE / FALSE statements ?

2009-03-10 Thread Duncan Murdoch
On 10/03/2009 4:40 PM, Wacek Kusnierczyk wrote: Duncan Murdoch wrote: On 10/03/2009 4:15 PM, Wolfgang Raffelsberger wrote: Dear list, ?require says : "... |require| is designed for use inside other functions; it returns |FALSE| and gives a warning (rather than an error as |library()| does by d

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread Rolf Turner
On 11/03/2009, at 9:34 AM, culpritNr1 wrote: I meant charm, not sharm! (how embarrasing...) If you're embarrassed by ***that*** you need to watch more Monty Python! :-) cheers, Rolf Turner ## A

Re: [R] require() is not giving TRUE / FALSE statements ?

2009-03-10 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: > On 10/03/2009 4:15 PM, Wolfgang Raffelsberger wrote: >> Dear list, >> >> ?require says : >> "... |require| is designed for use inside other functions; it returns >> |FALSE| and gives a warning (rather than an error as |library()| does >> by default) if the package does not e

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread culpritNr1
embarrasSing, not embarrasing. You see how I became culpritNr1? culpritNr1 wrote: > > I meant charm, not sharm! > > (how embarrasing...) > > > > > culpritNr1 wrote: >> >> OH! The joy! >> >> It worked like a sharm. >> >> Thank you. >> >> culpritNr1 >> >> >> >> >> >> baptiste au

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread culpritNr1
I meant charm, not sharm! (how embarrasing...) culpritNr1 wrote: > > OH! The joy! > > It worked like a sharm. > > Thank you. > > culpritNr1 > > > > > > baptiste auguie-2 wrote: >> >> >> try >> ?paste >> >> >> baptiste >> >> On 10 Mar 2009, at 20:01, ig2ar-s...@yahoo.co.uk wrote:

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread culpritNr1
OH! The joy! It worked like a sharm. Thank you. culpritNr1 baptiste auguie-2 wrote: > > > try > ?paste > > > baptiste > > On 10 Mar 2009, at 20:01, ig2ar-s...@yahoo.co.uk wrote: > >> >> Hi again R-ists, >> >> How do you construct a string that you can pass to system()? >> >> For inst

Re: [R] require() is not giving TRUE / FALSE statements ?

2009-03-10 Thread Duncan Murdoch
On 10/03/2009 4:15 PM, Wolfgang Raffelsberger wrote: Dear list, ?require says : "... |require| is designed for use inside other functions; it returns |FALSE| and gives a warning (rather than an error as |library()| does by default) if the package does not exist ..." However when I run the fo

Re: [R] popular R packages

2009-03-10 Thread Christos Hatzis
Bioconductor already provides download stats for all packages... http://bioconductor.org/packages/stats/bioc/affy.html -Christos > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Max Kuhn > Sent: Tuesday, March 10, 2009 12:25

[R] require() is not giving TRUE / FALSE statements ?

2009-03-10 Thread Wolfgang Raffelsberger
Dear list, ?require says : "... |require| is designed for use inside other functions; it returns |FALSE| and gives a warning (rather than an error as |library()| does by default) if the package does not exist ..." However when I run the following code I don't get any TRUE / FALSE statements

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread baptiste auguie
try ?paste baptiste On 10 Mar 2009, at 20:01, ig2ar-s...@yahoo.co.uk wrote: Hi again R-ists, How do you construct a string that you can pass to system()? For instance. Say I do system("echo Hello!") Hello! That works. Now the alternative: I need to construct the string like this

Re: [R] help structuring mixed model using lmer()

2009-03-10 Thread Mark Difford
Hi Simon, Have a look at Chap. 11 of "An Introduction to R" (one of R's manuals), which explains the different ways of specifying models using formulae. Briefly, y ~ x1 * x2 expands to y ~ x1 + x2 + x1:x2, where the last term (interaction term) amounts to a test of slope. Normally you would read

Re: [R] help structuring mixed model using lmer()

2009-03-10 Thread Mark Difford
Hi Simon, Have a look at Chap. 11 of "An Introduction to R" (one of R's manuals), which explains the different ways of specifying models using formulae. Briefly, y ~ x1 * x2 expands to y ~ x1 + x2 + x1:x2, where the last term (interaction term) amounts to a test of slope. Normally you would read

[R] system() not accepting strings from cat()

2009-03-10 Thread ig2ar-saf1
Hi again R-ists, How do you construct a string that you can pass to system()? For instance. Say I do > system("echo Hello!") Hello! That works. Now the alternative: I need to construct the string like this > a <- "echo" > b <- "Hello!" > c <- "\n" > cat(a, b, c) echo Hello! Looks nice... but

Re: [R] Sparse PCA in R

2009-03-10 Thread Christos Hatzis
Take a look at the elasticnet package. -Christos > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of joris meys > Sent: Tuesday, March 10, 2009 3:43 PM > To: R-help Mailing List > Subject: [R] Sparse PCA in R > > Dear all, > >

Re: [R] How to color certain area under curve

2009-03-10 Thread Matthieu Dubois
Just a small typo. I forgot a ) in the polygon function. The code must be: polygon(x = c(qrv[1], drv$x[select], qrv[2]), y = c(0, drv$y[select], 0), col='blue') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] Nesting order for mixed models

2009-03-10 Thread Jon Zadra
Hello, I am confused about the order of nesting in mixed models using functions like aov(), lme(), lmer(). I have the following data: n subjects in either condition A or B each subject tested at each of 3 numerical values ("distance" = 40,50,60), repeated 4 times for each of the 3 numerical v

Re: [R] ordering

2009-03-10 Thread aaron wells
Thanks Peter, that did the trick. I'll modify my function so that the numeric conversion is done automatically thus saving me the extra step of converting later on. Aaron Wells > Subject: RE: [R] ordering > Date: Wed, 11 Mar 2009 08:41:50 +1300 > From: palsp...@hortresea

Re: [R] ordering

2009-03-10 Thread David Winsemius
A) I predict that if you apply the str function to the second test that you will find that "con" is not numeric but rather of class character or factor. And the second test is probably not a matrix but rather a dataframe. Matrices in R need to have all their elements of the same class. B)

Re: [R] How to color certain area under curve

2009-03-10 Thread Matthieu Dubois
ucalgary.ca> writes: > > For a given random variable rv, for instance, rv = rnorm(1000), > I plot its density curve and calculate some quantiles: > plot(density(rv)) > P10P50P90 = = quantile(rv,probs = c(10,50,90)/100) > I would like to color the area between P10 and P90 and under the curve > a

[R] Sparse PCA in R

2009-03-10 Thread joris meys
Dear all, I would like to perform a sparse PCA, but I didn't find any library offering me this in R. Is there one available, or do I have to write the functions myself? Kind regards Joris Meys [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] ordering

2009-03-10 Thread Peter Alspach
Kia ora Aaron As you have identified, test[,2] is not numeric - it is probably factor. Your function must have made the conversion, so you may want to modify that. Alternative, try: test[order(as.numeric(as.character(test[,2]))),] BTW, str(test) is a good way to find out more about the structu

[R] ordering

2009-03-10 Thread aaron wells
Hello, I would like to order a matrix by a specific column. For instance: > test [,1] [,2] [,3] [1,]1 100 21 [2,]23 22 [3,]3 100 23 [4,]4 60 24 [5,]5 55 25 [6,]6 45 26 [7,]7 75 27 [8,]8 12 28 [9,]9 10 29 [10

Re: [R] help structuring mixed model using lmer()

2009-03-10 Thread Simon Pickett
Cheers, Actually I was using quasipoisson for my models, but for the puposes of my example, it doesnt really matter. I am trying to work out a way of quantifying whether the slopes (for years) are covary with habitat scores. The more I think about it, the more I am convinced that it isnt po

Re: [R] puzzled by math on date-time objects

2009-03-10 Thread William Dunlap
median.default was changed between 2.7.1 and 2.8.1 to call sum(...)/2 instead of mean(...) and that causes the problem for POSIXct objects (sum fails but mean works for them). Bill Dunlap TIBCO Software Inc - Spotfire Division wdunlap tibco.com > -Original Message- > From: William Dunla

Re: [R] puzzled by math on date-time objects

2009-03-10 Thread William Dunlap
Your problem arises in R 2.8.1 (and 2.9.0-devel, but not 2.7.0) when length(POSIXct object) is even, because median(POSIXct object) passes a POSIXct object to median.default, which calls sum() in the even length case. > median( as.POSIXct(Sys.time())) [1] "2009-03-10 10:28:46 PDT" > median( as.P

Re: [R] a general question

2009-03-10 Thread culpritNr1
Hello Bogdan, Put in those terms, option b looks more defensible. It sounds like a test of two proportions, sometimes called z-test. The problem is that, for that test to be used, you must be sampling from large population. You know that under regular ChIP-seq sequencing we are lucky if we get 1

Re: [R] Changing factor to numeric

2009-03-10 Thread Tal Galili
By the way, it could be that one of your numbers has "space" in them. in which case, R tends to turn the entire vector into a factor. try opening the file in a spreadsheet like excel, and do "search replace" on " " with "". and see how many it catches. Tal On Tue, Mar 10, 2009 at 7:25 AM, oj

[R] Alternative to interp.surface() offered

2009-03-10 Thread Waichler, Scott R
I wanted a simple function for bilinear interpolation on a 2-D grid, and interp.surface() in the fields package didn't quite suit my needs. In particular, it requires uniform spacing between grid points. It also didn't have the "visual" reference frame I was looking for. Here is an alternative f

[R] (no subject)

2009-03-10 Thread Shuying Yang
Dear Members, I have a question about using R2WinBUGS to obtain the WinBUGS results. By default, when R2WinBUGS returns summary stats, I got mean, sd, 2.5%, 25%, median, 75% and 97.5%. Could anyone tell me how to modify the code to obtain 5% and 95% summary results? Many thanks

Re: [R] help structuring mixed model using lmer()

2009-03-10 Thread Douglas Bates
On Tue, Mar 10, 2009 at 10:15 AM, Simon Pickett wrote: > This is partly a statistical question as well as a question about R, but I am > stumped! > I have count data from various sites across years. (Not all of the sites in > the study appear in all years). Each site has its own habitat score

[R] How to color certain area under curve

2009-03-10 Thread guox
For a given random variable rv, for instance, rv = rnorm(1000), I plot its density curve and calculate some quantiles: plot(density(rv)) P10P50P90 = = quantile(rv,probs = c(10,50,90)/100) I would like to color the area between P10 and P90 and under the curve and mark the P50 on the curve. > rv = r

Re: [R] popular R packages

2009-03-10 Thread Ajay ohri
Pricing each download at 99 cents ( the same as a song from I Tunes) can measure users more accurately. Thats my 2 cents anyways. On Tue, Mar 10, 2009 at 9:54 PM, Max Kuhn wrote: > If is easy to get the download numbers, we should do it and deal with > the interpretation issues. I'd like to know

Re: [R] popular R packages

2009-03-10 Thread Dylan Beaudette
On Tuesday 10 March 2009, Frank E Harrell Jr wrote: > Gabor Grothendieck wrote: > > On Tue, Mar 10, 2009 at 6:14 AM, Jim Lemon wrote: > >> Gabor Grothendieck wrote: > >>> R-Forge already has this but I don't think its used much. R-Forge > >>> does allow authors to opt out which seems sensible les

[R] Plots of different aspect ratios on one page, base aligned(trellis.print)

2009-03-10 Thread Saptarshi Guha
Hello, I have an example of a 2 paneled plot, with two different aspect ratios displayed on one page. An example would help n=20 x1 <- cumsum(runif(n)) x2 <- cumsum(runif(n)) d <- data.frame(val=c(x1,x2),id=c(1:n,1:n), nt=c(rep("A",n),rep("B",n))) u1 <- xyplot(val~id | nt, data=d,aspect=1,layout=c

Re: [R] File permissions

2009-03-10 Thread culpritNr1
Great. I tried chmod (which does not exist) but I didn't know that there was sys.chmod. Thank you. Prof Brian Ripley wrote: > > On Tue, 10 Mar 2009, ig2ar-s...@yahoo.co.uk wrote: > >> >> Hello fellow R-ists, >> >> How do I change file permissions? >> >> I know that file.access can display pe

[R] How to stop loop inside status ? ( haplo.stats package )

2009-03-10 Thread Nash
How to stop loop inside status ? require(haplo.stats) ## normal status y=rep(c(0,1),each=50) geno=as.data.frame(matrix(sample(c("A","G","T","C"),600,replace=T),100,6)) hs<- haplo.score(y, geno, trait.type="binomial", offset = NA, x.adj = NA, min.count=5, locus.label=NA,

Re: [R] Lattice: Customizing point-sizes with groups

2009-03-10 Thread Paul C. Boutros
Yup, that would be my work-around. I was hoping for a cleaner way of doing this, though, because I am calculating cex based on other properties of the data-points, so that it becomes a continuous variable. -Original Message- From: Sundar Dorai-Raj [mailto:sdorai...@gmail.com] Sent: Tuesd

Re: [R] reliability, scale scores in the psych package

2009-03-10 Thread William Revelle
Ista, As you figured out, psych reverses items by subtracting from the maximimum + minimum possible for each item. (i.e., for items going from 1 to 4, it reverses items by subtracting from 5). If all of the items have the same potential range then you can just let it figure out the range

[R] Help installing Kernlab: cannot find -lgfortran

2009-03-10 Thread azege
I am trying to install a package kernlab on Linux machine. After downloading and unpacking, installation goes through a number of C code compiles which ends with code linking, where error is generated as follows: g++ -shared -Bdirect,--hash-stype=both,-Wl,-O1 -o kernlab.so brweight.o cta

[R] nonmetric clustering

2009-03-10 Thread Roberta Carabalona
Hi all, does anybody know where it is possible to find the "Riffle" package? Thank you R [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting g

Re: [R] Lattice: Customizing point-sizes with groups

2009-03-10 Thread Paul C. Boutros
Hi Sundar, Thanks for your help! Unfortunately your code seems to give the same result. Compare this: temp <- data.frame( x = 1:10, y = 1:10, cex = rep( c(1,3), 5), col = c( rep("blue", 5), rep("red", 5) ), groups = c( rep("A", 5), rep("B", 5) ) ); xyp

[R] Re : (no subject)

2009-03-10 Thread justin bem
see ?unique Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 De : "arnaud_mosn...@uqar.qc.ca" À : r-help@r-project.org Envoyé le : Mardi, 10 Mars 2009, 17h15mn 57s Objet : [R] (no subject) Dear R users, I have a table with the following form S

Re: [R] (no subject)

2009-03-10 Thread Usuario R
Hi Arnaud, is very simple: > unique( datos) Regards 2009/3/10 > > Dear R users, > > I have a table with the following form > > STATION X Y > 1-7030 > 1-7030 > 1-7030 > 2-7229 > 2-7229 > 2-7229 > 2-722

  1   2   >