Re: [R] Basic question about three factor Anova

2011-05-30 Thread Bogdan Lataianu
I understand now On May 30, 4:04 pm, Bogdan Lataianu wrote: >  Read the data using scan(): > # > #          a1               a2               a3               a4 > #     -    -    -    - > #     b1   b2   b3     b1   b2   b3     b1   b2   b3     b1

Re: [R] DateTime Math in R - POSIXct

2011-05-30 Thread Jeff Newmiller
MDT is not a valid timezone specification... it is falling back on your default timezone in your "working" case. a) learn what valid timezone specifications are on your operating system. I suspect you are using Windows (hint: we should not have to guess), so look for the timezone directory in y

Re: [R] Value of 'pi'

2011-05-30 Thread Simon Blomberg
Indeed! > pt(pi, df=6) [1] 0.9899863 Simon. On 31/05/11 14:38, MacQueen, Don wrote: > I once knew someone who thought that a 1-sided upper 99% confidence limit > for the mean with n=7 was calculated by multiplying the standard error of > the mean by pi. > > -Don > > On 5/30/11 6:00 PM, "Bentle

Re: [R] Value of 'pi'

2011-05-30 Thread MacQueen, Don
I once knew someone who thought that a 1-sided upper 99% confidence limit for the mean with n=7 was calculated by multiplying the standard error of the mean by pi. -Don On 5/30/11 6:00 PM, "Bentley Coffey" wrote: >Pi is an irRATIOnal number, meaning that it is not equal to the ratio of >any >in

[R] rtmvt

2011-05-30 Thread statfan
I want to use the rtmvt from the {tmvtnorm} package using the "gibbs" algorithm but how to i specify the nested function rtmvnorm to use gibbs as well? Right now I am using the code: for (i in 1:g){ for (j in 1:n){ sgamma[,,i,j] = rtmvt(n=50, mean=

Re: [R] DateTime Math in R - POSIXct

2011-05-30 Thread Galen Moore
Thank you, David. I am not subtracting the seconds to convert POSIXct's GMT to MDT, and don't understand why I should need to. Any hints, however, as to why dateP <- as.POSIXct(tstamp, origin="1970-01-01", tzone="MDT") returns a date in the correct tz in my first instance below, yet dateP2

Re: [R] DateTime Math in R - POSIXct

2011-05-30 Thread Galen Moore
I think that has something to do with it. I'll keep chewing on things and see what I can make work. I've reached a point where I get the right answer for the wrong reasons ;-) Many thanks, Galen -Original Message- From: bill.venab...@csiro.au [mailto:bill.venab...@csiro.au] Sent:

Re: [R] DateTime Math in R - POSIXct

2011-05-30 Thread Bill.Venables
Perhaps because the timezone is specified as a character string and not a date-time object complete with timezone. >From the help filr for as.POSIXct.numeric: "origin:a date-time object, or something which can be coerced by as.POSIXct(tz="GMT") to such an object." Note the coercion.

Re: [R] DateTime Math in R - POSIXct

2011-05-30 Thread David Winsemius
On May 30, 2011, at 10:20 PM, Galen Moore wrote: Greetings - I'm battling POSIXct, as per the code below. My input is actually an XL file, but the weird results below correctly model what I am seeing in my program. Before I punt and use lubridate or timeDate, could anyone please h

[R] DateTime Math in R - POSIXct

2011-05-30 Thread Galen Moore
Greetings - I'm battling POSIXct, as per the code below. My input is actually an XL file, but the weird results below correctly model what I am seeing in my program. Before I punt and use lubridate or timeDate, could anyone please help me understand why POSIXct forces my variable back to

Re: [R] Normality test

2011-05-30 Thread Greg Snow
I was referring to the height of the pdf. The 1st distribution is the simple uniform between 0 and 1, the second is also uniform, but on a discontinuous region. The first will generate numbers between 0 and 1 with equal probability, the second will be similar but only up to 0.99 with the very

Re: [R] Value of 'pi'

2011-05-30 Thread Bentley Coffey
Pi is an irRATIOnal number, meaning that it is not equal to the ratio of any integers ("whole numbers"). Hence, 22/7 is ONLY an approximation. The built-in value for pi in R is also just an approximation (pi has no terminal digit on the right of the decimal point so any finite number of digits will

Re: [R] Basic question about three factor Anova

2011-05-30 Thread Bill.Venables
This is really a question about the help file for gl. The arguments are gl(n, k, length = n*k, labels = 1:n, ordered = FALSE) 'n' is the number of factor levels. That seems to be easy enough 'k' is called the "number of replications". This is perhaps not the best way to express what it is.

Re: [R] Value of 'pi'

2011-05-30 Thread Joshua Wiley
Hmm, I think the difference would be much less dramatic. The rest of the world would just have to update its Midwest/Indiana list to: Weird Things about Indiana: 1) "Daylight Savings Time" (to save candles?) 2) Still has horses, carts, and buggies 3) Does not believe in math (really just an exte

[R] Basic question about three factor Anova

2011-05-30 Thread Bogdan Lataianu
Read the data using scan(): # # a1 a2 a3 a4 # ---- # b1 b2 b3 b1 b2 b3 b1 b2 b3 b1 b2 b3 # --- --- ------ --- ------ --- ------

Re: [R] Value of 'pi'

2011-05-30 Thread Oliver Bandel
Hello, interesting would be to estimate what would have happened, if the law would have been installed. What consequences would that have caused? Could it make the earth flat again? And which shape would the earth have, if pi = 3? And how would a football-ball look like? (Like american football

Re: [R] Transforming a data matrix into a vector

2011-05-30 Thread Charles Ellis
Brilliant! Works like a charm. Thanks both. Cheers, Charles From: Richard M. Heiberger [mailto:r...@temple.edu] Sent: Monday, May 30, 2011 4:36 PM To: Charles Ellis Cc: r-help@R-project.org Subject: Re: [R] Transforming a data matrix into a vector > tmp <- matrix(c(5,3,1, 1,3,2, 1,2,4), 3, 3)

Re: [R] Group by multiple variables

2011-05-30 Thread Sebastian P. Luque
On Mon, 30 May 2011 16:47:45 -0500, "Mendolia, Franco" wrote: > Hello, I would like to create a group variable that is based on the > values of three variables: > For example, >> dat <- data.frame(A=c(1,1,1,1,1,2,2,2,2,2), > B=c(1,1,1,5,5,5,9,9,9,9), > C=c(1,1,1,1,1,2,2,7,7,

Re: [R] Group by multiple variables

2011-05-30 Thread baptiste auguie
Hi, There are probably much better ways, but try this transform(dat, group = as.numeric(factor(paste(A,B,C, sep="" HTH, baptiste On 31 May 2011 09:47, Mendolia, Franco wrote: > Hello, > > I would like to create a group variable that is based on the values of three > variables: > > For ex

[R] Group by multiple variables

2011-05-30 Thread Mendolia, Franco
Hello, I would like to create a group variable that is based on the values of three variables: For example, > dat <- data.frame(A=c(1,1,1,1,1,2,2,2,2,2), B=c(1,1,1,5,5,5,9,9,9,9), C=c(1,1,1,1,1,2,2,7,7,7)) > dat A B C 1 1 1 1 2 1 1 1 3 1 1 1 4

[R] 2D random walk with traps convert C++ code to R code

2011-05-30 Thread Amanda Zeqiri
Hello, I have a C++ code for 2D random walks with traps and I want to convert it in a R code with its syntaxs, can anyone help??? It's easy for me to adapt the body but I want help with the beginig (variable declaration) and th end exporting the output to a file ( like write.table() or sin

Re: [R] Transforming a data matrix into a vector

2011-05-30 Thread Jorge Ivan Velez
Hi Charles, Try rep(c(tmp), each = 3) HTH, Jorge On Mon, May 30, 2011 at 4:22 PM, Charles Ellis <> wrote: > Hi, > > I am trying to transform a data matrix into a vector and have not be able > to accomplish want I am looking for. The setup is as follows. I start with > a 3 x 3 matrix: > > 5 1

[R] Problem with GAM

2011-05-30 Thread Komine
Hi, I used GAM function with this code: library(mgcv) modgam=gam(Z~X+Y,data=table) pred=predict(modgam,type="response") vis.gam(modgam,view=c("X","Y"),plot.type="contour",zlim=c(1,16)) My problem is on my figure, the predicted values begin by 0 to 16 with an interval equal 2: 1- I want that the

Re: [R] Transforming a data matrix into a vector

2011-05-30 Thread Richard M. Heiberger
> tmp <- matrix(c(5,3,1, 1,3,2, 1,2,4), 3, 3) > tmp [,1] [,2] [,3] [1,]511 [2,]332 [3,]124 > rep(t(tmp), each=3) [1] 5 5 5 1 1 1 1 1 1 3 3 3 3 3 3 2 2 2 1 1 1 2 2 2 4 4 4 > On Mon, May 30, 2011 at 4:22 PM, Charles Ellis wrote: > Hi, > > I am trying to tra

[R] Transforming a data matrix into a vector

2011-05-30 Thread Charles Ellis
Hi, I am trying to transform a data matrix into a vector and have not be able to accomplish want I am looking for. The setup is as follows. I start with a 3 x 3 matrix: 5 1 3 3 3 2 1 2 4 I would like to transorm it into a 27 x 1 vector of the follwing form 5 5 5 1 1 1 3 3 3 . . . 1 1 1 2 2 2

Re: [R] Error in minimizing an integrand using optim

2011-05-30 Thread William Dunlap
You can put print statements into your integrand to see what is happening: > integrand<-function(x){ + on.exit(print(cbind(x, fx))) ; + fx <- (e*pnorm((qnorm(p)+sqrt(R)*x)/sqrt(1-R))*dnorm(x))^2/dnorm(x+mu) + fx + } > mu<-c(-1) > output<-optim(par=mu, fx2, method="BFGS")

Re: [R] Test for list membership

2011-05-30 Thread Marcin Włodarczak
On 05/30/2011 04:14 PM, Uwe Ligges wrote: On 30.05.2011 15:36, Marcin Wlodarczak wrote: Hi, I need some help with this one: how do I check whether a vector is already present in a list of vectors. I have seen %in% recommended in a similar case but that obviously does not work here. c(1,2,3)

[R] Error in minimizing an integrand using optim

2011-05-30 Thread ch_dinesh
Hi, Am not sure if my code itself is correct. Here's what am trying to do: Minimize integration of a function of gaussian distributed variable 'x' over the interval qnorm(0.999) to Inf by changing value of parameter 'mu'. mu is the shift in mean of 'x'. Code: # x follows gaussian distribution # f

[R] [lattice] group by two factors

2011-05-30 Thread tpoisot
Hi all, I'm working on a dataframe (webs) with two variables ($size, $vspe), and two grouping factors ($type, $mutu). I would like to do a lattice plot wherein the levels of $mutu would be different shapes, and the levels of $type different colors. Additionally, I'd like to add a regression line f

Re: [R] ideas about how to reduce RAM & improve speed in trying to use lapply(strsplit())

2011-05-30 Thread Peter Ehlers
On 2011-05-29 23:08, Matthew Keller wrote: God this listserve is awesome. Thanks to everyone for their ideas. I'll speed& memory test tomorrow and change the code. Thanks again! Since you're dealing with a vector of ~ 1e8 elements, you might find that (at a probably small cost of time) you can

[R] Need help reading website info with XML package and XPath

2011-05-30 Thread eric
Hi, I'm looking for help extracting some information of the zillow website. I'd like to do this for the general case where I manually change the address by modifying the url (see code below). With the url containing the address, I'd like to be able to extract the same information each time. The spe

Re: [R] matching by gender and age

2011-05-30 Thread David Winsemius
On May 30, 2011, at 11:30 AM, 1Rnwb wrote: I hope this modified example will work set.seed(100) disease<-paste(rep(c('y','n'),50)) gender<-c(paste(rep(c('m','f'),25)), paste(rep(c('f','m'),25))) mcp<-rnorm(100, mean=1000,sd=600) age<-rnorm(100,mean=32,sd=20) dat<-data.frame(disease

Re: [R] Syntax for lattice scales argument with |a*b

2011-05-30 Thread Frank Harrell
Thanks very much David and Bert. That did it. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Syntax-for-lattice-scales-argument-with-a-b-tp3560973p3561131.html Sent from the R help mailing list archive a

Re: [R] Syntax for lattice scales argument with |a*b

2011-05-30 Thread David Winsemius
On May 30, 2011, at 11:18 AM, Frank Harrell wrote: I have not been able to figure out the format for specifying limits, at, labels in scales <- list(relation='free', limits=..., at=..., labels=...) when there is more than one paneling variable, e.g., xyplot(y ~ x | a*b). Thanks for any gu

Re: [R] Syntax for lattice scales argument with |a*b

2011-05-30 Thread Bert Gunter
Frank: 1. Note that x and y scales can be specified separately by scales = list(x = list(...), y = list(...)) 2. For at, labels, etc. ?xyplot says: "The location of tick marks along the axis (in native coordinates), ** or a list as long as the number of panels describing tick locations for ea

[R] Problems with lme4 and cholmod_start

2011-05-30 Thread Lorena Pont-Lezica
Hello, I just installed Rv2.13,lme4 v0.999375-40, and matrix 0.999375-50. When I try to launch lme4 I get the following error message: > library(lme4) Error in inDL(x, as.logical(local), as.logical(now), ...) : function 'cholmod_start' not provided by package 'Matrix' Error: package/namespace lo

Re: [R] matching by gender and age

2011-05-30 Thread 1Rnwb
I hope this modified example will work set.seed(100) disease<-paste(rep(c('y','n'),50)) gender<-c(paste(rep(c('m','f'),25)), paste(rep(c('f','m'),25))) mcp<-rnorm(100, mean=1000,sd=600) age<-rnorm(100,mean=32,sd=20) dat<-data.frame(disease=disease,sex=gender,Dr_age=age,MCP=mcp

[R] Question of the XLConnect package

2011-05-30 Thread christiaan pauw
Hi Everybody I have started to learn how to use the XLConnect package and I think it is going to be very helpful to help me to operate between Excel users. Is there a function that can export a dataframe to a Excel sheet and automatically create a named region for every column (excluding the colu

[R] Syntax for lattice scales argument with |a*b

2011-05-30 Thread Frank Harrell
I have not been able to figure out the format for specifying limits, at, labels in scales <- list(relation='free', limits=..., at=..., labels=...) when there is more than one paneling variable, e.g., xyplot(y ~ x | a*b). Thanks for any guidance. Frank - Frank Harrell Department of Biostatis

Re: [R] Value of 'pi'

2011-05-30 Thread Ravi Varadhan
Here is the wiki entry on the "Indiana Pi Bill" http://en.wikipedia.org/wiki/Indiana_Pi_Bill Ravi. From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of bill.venab...@csiro.au [bill.venab...@csiro.au] Sent: Monday, May 30, 2011 2:

Re: [R] constructing nxn matrices involving calculations& conditions based on other tables

2011-05-30 Thread Jabba
Hi Luisa, it was really difficult to manage to understand what you need. Assuming that i've done it correctly this should be similar to what you want: A.matrix <- matrix(rpois(n=28,lambda=2),nrow=7) M.matrix <- matrix(0,nrow=dim(A.matrix)[2],ncol=dim(A.matrix)[2]) for(i in 1:dim(df)[2]) for(j

Re: [R] Test for list membership

2011-05-30 Thread Sarah Goslee
You almost solved your own problem with that last statement. Instead of comparing apples and oranges, you need to compare oranges and oranges: > list(c(1,2,3)) %in% list(c(1,2,3), c(4,5,6)) [1] TRUE > list(c(1,2,3)) %in% list(c(1,2,9), c(4,5,6)) [1] FALSE Sarah On Mon, May 30, 2011 at 9:36 AM,

Re: [R] Test for list membership

2011-05-30 Thread Uwe Ligges
On 30.05.2011 15:36, Marcin Wlodarczak wrote: Hi, I need some help with this one: how do I check whether a vector is already present in a list of vectors. I have seen %in% recommended in a similar case but that obviously does not work here. c(1,2,3) %in% list(c(1,2,3), c(4,5,6)) You said

Re: [R] Test for list membership

2011-05-30 Thread Henrique Dallazuanna
Try this: list(c(1,2,3), c(4,5,6)) %in% list(c(1,2,3)) On Mon, May 30, 2011 at 10:36 AM, Marcin Wlodarczak wrote: > > Hi, > > I need some help with this one: how do I check whether a vector is > already present in a list of vectors. > > I have seen %in% recommended in a similar case but that obv

Re: [R] R package for reading / writing 3D file (. PLY)

2011-05-30 Thread Tawanda Tarakini
Hi, I am trying to install the package for DECORANA onto R, I have tried the CCA and it does not seem to work. Does anyone know? Tawanda On Fri, Nov 13, 2009 at 9:53 AM, kvarpun wrote: > > > Duncan Murdoch-2 wrote: > > > > On 11/12/2009 11:37 AM, kvarpun wrote: > >> > >> Duncan Murdoch-2 wrote:

Re: [R] Plot rows of CSV

2011-05-30 Thread rmje
Hi, this works: apply(mtcars[c("Mazda RX4", "Merc 450SLC", "Maserati Bora"), ], 1, plot) How do you add labels and additional edit in such a plot? For instance I want mpg cyl disp hp dratwt qsec vs am gear carb to be plottet below the X-axis -- View this message in context: http://r.

[R] Analysis of Dispersion

2011-05-30 Thread Joseph Kunkel
Does anyone know of an R implementation of Rao's (1965) described 'Analysis of Dispersion' which is the generalization of the General Linear Model, Y = XB, to multiple Y variables and the further use of the method to 'Test of Additional Information' in one set of Y variables corrected for a seco

[R] Test for list membership

2011-05-30 Thread Marcin Wlodarczak
Hi, I need some help with this one: how do I check whether a vector is already present in a list of vectors. I have seen %in% recommended in a similar case but that obviously does not work here. c(1,2,3) %in% list(c(1,2,3), c(4,5,6)) returns [1] FALSE FALSE FALSE which makes sense since 1, 2

[R] Mean of three inconsistent curves

2011-05-30 Thread Loenn2010
Hello, I have a dataframe with e.g. three different curves (columns), which I want to have averaged. I use the row.Means function, which is working good. However as I have a time series, some parts of the three columns have sometimes NA. I want however that if only one or two columns are available

[R] Exponential smoothing

2011-05-30 Thread Alon & Dina Lever
Hi I wonder if you can help me- im trying to do research in R and i cant find anywhere that explains step by step how to do single, double or triple exponential smoothing on a time series dataset. Any help, links or other would be greatly appreciated. [[alternative HTML version deleted]]

[R] Is there a (virtual) class that all R objects inherit from?

2011-05-30 Thread Janko Thyson
Dear list, I would like to set one specific Reference Class field to be of an arbitrary class. Is there a class that all R objects inherit from? I thought that "ANY" was something like this, but obviously that's not true: > inherits(1:3, "ANY") [1] FALSE Regards, Janko [[alternative

Re: [R] Several Regression by combinations variables

2011-05-30 Thread Bert Gunter
In other words, "Abandon hope, all ye who enter..." -- Bert (Sorry, couldn't resist. Berlioz's "March to the Gallows" from Symphonie Fantastique also played in my head when I read Frank's comment, but I couldn't put that in the email.) On Mon, May 30, 2011 at 5:52 AM, Frank Harrell wrote: >

Re: [R] Several Regression by combinations variables

2011-05-30 Thread Frank Harrell
This is not accepted as good statistical practice, and the resulting inferential quantities will violate all known statistical principles. Frank Mohamed Lajnef wrote: > > Dear All, > I have 11 variables, and i would like generate combinations of those > variables by fours variables i,e 330 po

Re: [R] R-2.10.1 to R-2.13.0

2011-05-30 Thread ogbos okike
Hello Steve, Thanks again for your time. Since this is part of learning for me, I have set up another system for it to avoid getting into much problem with my laptop and hence my work. Whatever I learn in this new system about the installation I can safely apply to my laptop. I have tried to get

Re: [R] text mining

2011-05-30 Thread Duncan Murdoch
On 30/05/2011 6:17 AM, rgui wrote: Hi, I have a problem when indexing the corpus. I used the following syntax: > Setwd ("c :/") > Library (tm) > Txt = Corpus (DirSource ("."); readerControl = list (language = "frensh")) Capitalization is important in R, so when asking a question, please

[R] simulation

2011-05-30 Thread Stat Consult
Dear ALL I want to simulate data from Multivariate normal distribution. GE.N<-mvrnorm(25,mu,S) S <-matrix(rep(0,1),nrow=100) for( i in 1:100){sigma<-runif(100,0.1,10);S [i,i]=sigma[i];mu<-runif(100,0,10)} for (i in 1:20){for (j in 1:20){if (i != j){S [i,j]=0.3*sigma[i]*sigma[j]}}} for (i

Re: [R] Value of 'pi'

2011-05-30 Thread Mike Marchywka
> Date: Sun, 29 May 2011 23:09:47 -0700 > From: jwiley.ps...@gmail.com > To: vincy_p...@yahoo.ca > CC: r-help@r-project.org > Subject: Re: [R] Value of 'pi' > > Dear Vincy, > > I hope that in school you also learned that 22/7 is an approximation.

[R] text mining

2011-05-30 Thread rgui
Hi, I have a problem when indexing the corpus. I used the following syntax: > Setwd ("c :/") > Library (tm) > Txt = Corpus (DirSource ("."); readerControl = list (language = "frensh")) an error message comes: >>> Messages d'avis : 1: In readLines(y, encoding = x$Encoding) : ligne finale i

[R] Row and column normalization

2011-05-30 Thread aparna
Hi I am totally new to R and I would like to know how to perform both row and column normalization (so that both rows and columns sum to zero and have standard deviation of 1) using R on gene expression data. Thanks for the help. -- View this message in context: http://r.789695.n4.nabble.co

Re: [R] partial cumsum

2011-05-30 Thread mayouf.k
thank u very much Wiliam Dunlap, your function is very helpful, i been trying to find the right algo,,,and i saw yours, it works perfectly. i even checked with system.time function, and it's clear the cum.reset is the best. > system.time(ave(J, rev(cumsum(rev(is.na(J, FUN=cumsum)) utilisateur

[R] gls and phi1 >1 (phi larger than one)

2011-05-30 Thread Christian Kamenik
Dear all, I am stuck with a problem that might be trivial for most of you (and therefore is a bit embarrassing for me...): I want to calculate a generalized least squares regression using two time series (Y depending on X) with an autoregressive correlation structure of order two (the data a

Re: [R] Put names in the elements of lapply result

2011-05-30 Thread Kenn Konstabel
On Fri, May 27, 2011 at 6:12 PM, Bert Gunter wrote: > Jonathan et. al: > > Yes, of course, but I'd say Type III error: Right answer to wrong question. > The real question (imho only obviously) is: "What data structure > should be used?" -- and the standard answer for this sort of thing in > R is:

Re: [R] Value of 'pi'

2011-05-30 Thread Barry Rowlingson
>  "For an engineer, assuming that pi = 3.142 will >  probably enable him to build a very satisfactory >  bridge. Assuming that pi = 3.14159265358979323844 >  will give the circumference of the Earth's orbit >  to one millionth of a millimetre. " And just a few more decimal places will get you th

Re: [R] Value of 'pi'

2011-05-30 Thread Vincy Pyne
That's the beauty of this R forum. This forum is full of knowledgeable wizards and replies received along-with the related discussions pertaining to a simple harmless question like this enriches us tremendously. Thanks a lot for all your comments. I am sticking to the value of 'pi' as provided i

[R] definition of meq at spg

2011-05-30 Thread Evgenia
For my problem I have #Constraints b11<-0 b21<-0 b12<-0 b22<-0 n1>=0 n2>=0 n1<=1 n1<=1 n1+n2=1 In order to use spg I set Amat<-matrix(rbind(c(rep(0,10)),c(rep(0,10)),c(rep(0,2),1,rep(0,7)), c(rep(0,3),1,rep(0,6)),c(rep(0,10)),c(rep(0,10)), c(rep(0,6),1,rep(0,3)),c(rep(0,7),1,rep(0,2)), c(rep(0,8)

Re: [R] summing array elements

2011-05-30 Thread marco milella
Thanks a lot for your help marco 2011/5/27 Thomas Lumley > On Fri, May 27, 2011 at 10:06 AM, marco milella wrote: > > Hi to everybody > > I have an array with dimensions 2,4,3,3. > > Wanting to sum the matrices in the first two dimensions, I'm trying to > use > > the "apply" function, but with

Re: [R] summing array elements

2011-05-30 Thread marco milella
Thanks a lot for your hint marco 2011/5/27 Erich Neuwirth > > arr<-1:72 > > dim(arr)<-c(2,4,3,3) > > apply(arr,1:2,sum) > [,1] [,2] [,3] [,4] > [1,] 297 315 333 351 > [2,] 306 324 342 360 > > apply(arr,3:4,sum) > [,1] [,2] [,3] > [1,] 36 228 420 > [2,] 100 292 484 > [3,]

Re: [R] One main caption for an mfrow=c(2,1) plot window

2011-05-30 Thread Alexander Engelhardt
Am 30.05.2011 10:39, schrieb Uwe Ligges: On 29.05.2011 22:52, Alexander Engelhardt wrote: Hello, I'm trying to plot a series of pages in a pdf with one main caption for each page. Each page should then have two plots in one row, preferably with an own caption. I can't plot the main caption in

[R] how to interpret coefficients from multiclass svm using libsvm (for multiclass R-SVM)

2011-05-30 Thread Immanuel B
Hello all, I'm working with the svm (libsvm) implementation from library(e1071). Currently I'm trying to extend recursive feature elimination (R-SMV) to work with multiclass classification. My problem is that if I run svm for a 3 class problem I get a 2-D vector back from model$coefs, can someon

Re: [R] Value of 'pi'

2011-05-30 Thread Ted Harding
On 30-May-11 07:06:57, Peter Langfelder wrote: > On Sun, May 29, 2011 at 11:53 PM, wrote: >> There is an urban legend that says Indiana passed a law implying >> pi = 3. >> >> (Because it says so in the bible...) > > Apparently the Fortran language has a DATA statement just for this > purpose. Th

Re: [R] Hello!

2011-05-30 Thread Dennis Murphy
Hi: Use the PolynomF package. Once you've installed it from CRAN, try the following code: library(PolynomF) example(PolynomF) The example contains a block of code to construct a list of Hermite polynomials which are stored in a list object named H. After you've run the example, try deriv(H) int

Re: [R] how to combine two data frames via factors (or somehow else)

2011-05-30 Thread Philipp Chapkovski
Thank you very much for your help - everybody, and especially Joshua! On Mon, May 30, 2011 at 1:21 AM, Joshua Wiley wrote: > Hi Philipp, > > > ## Read in your data > ## posting the output of dput() would have made our lives easier > d1 <- read.table(textConnection("x y > 1 a X > 2 b X > 3 c X > 4

Re: [R] One main caption for an mfrow=c(2,1) plot window

2011-05-30 Thread Uwe Ligges
On 29.05.2011 22:52, Alexander Engelhardt wrote: Hello, I'm trying to plot a series of pages in a pdf with one main caption for each page. Each page should then have two plots in one row, preferably with an own caption. I can't plot the main caption in a window, and subsequently plot the two gr

Re: [R] Error with BRugs 0.53 and 0.71, on Win7 with R 2.12.2 and 2.13.0 (crashes R GUI)

2011-05-30 Thread Uwe Ligges
On 29.05.2011 23:19, Chris Chapman wrote: Uwe -- thank you. No, this occurs on three different machines: two at work (a Lenovo laptop running Win7-32, plus an HP workstation running Win7-64) ... and I just tried another Compaq desktop machine at home running WinXP-32, with the same result. I a

[R] Several Regression by combinations variables

2011-05-30 Thread Mohamed Lajnef
Dear All, I have 11 variables, and i would like generate combinations of those variables by fours variables i,e 330 possibility (choose(11,4)).? After that, make a regression analysis with this 330 possibility ? is there a program ( or package) to do that ? Any help would be appreciated Rega

Re: [R] reshape with function(x,y)?

2011-05-30 Thread Dennis Murphy
If you want the weighted variance added to the data frame, don't melt the data first. library(Hmisc) dat<-data.frame(ids=c("A","A","A","B","B","B"),rate=c(12,14,17,10,8,5), sample=c(100,80,60,50,40,45)) library(plyr) library(Hmisc) ddply(dat, 'ids', transform, wtdvar = wtd.var(rate

Re: [R] Value of 'pi'

2011-05-30 Thread Peter Langfelder
On Sun, May 29, 2011 at 11:53 PM, wrote: > There is an urban legend that says Indiana passed a law implying pi = 3. > > (Because it says so in the bible...) > Apparently the Fortran language has a DATA statement just for this purpose. This is allegedly a quote from an early Fortran manual: The

Re: [R] prcomp & eigenvectors ... ??

2011-05-30 Thread peter dalgaard
On May 28, 2011, at 20:08 , Natalie Stephenson wrote: > Hi ... > > Please could you help with probably a very simple problem I have. I'm > completely new to R and am trying to follow a tutorial using R for Force > Distribution Analysis that I got from ... > http://projects.eml.org/mbm/websit