Re: [R] list.files recursively to find files in a specific way...

2011-07-20 Thread Prof Brian Ripley
But using the approproate tool, Sys.glob, whould be much simpler. Note that 'pattern' in list.files is - a regexp, and '.' is a special character in a regexp: Phil's solution also needs to escape it or use fixed = TRUE - it is documented to match file *names*, not file paths. One of the

Re: [R] Problem with RODBC

2011-07-20 Thread Dieter Menne
David Scott-6 wrote: I have been trying to read some data from an Excel workbook without success. ... faults - sqlFetch(channel, sqtable = 'Data', +colnames = FALSE, as.is = TRUE) faults [1] HY001 -1040 [Microsoft][ODBC Excel Driver] Too many fields defined. [2]

Re: [R] grouping data

2011-07-20 Thread Dieter Menne
adolfpf wrote: How do I group my data in dolf the same way the data Orthodont are grouped. show(dolf) distance age Subjectt Sex 16.83679 22.01 F1 F 26.63245 23.04 F1 F 3 11.58730 39.26 M2 M I know that many sample in that excellent book use

[R] Setting packet order and display order in lattice barchat

2011-07-20 Thread Nathan (Nat) Goodman
Greetings In a lattice barchart (lattice_0.19-26, R 2.12.1), I am trying to control the order in which packets are displayed (in other words, which packet goes in which panel), and the order in which bars are displayed in each panel. I tried the simple idea of changing the levels of the

[R] bar chart issue

2011-07-20 Thread Stratford, Jeffrey
Hi everyone, I determined the presence of three types parasites in a passerine bird over two years. I would like to create a bar chart that shows the proportion infected on the y and year/parasite on the x such that each type of parasite is grouped together (single label) and a bar for each

Re: [R] Hardy Weinberg Case Control Test in gap R package

2011-07-20 Thread Brad McNeney
As an alternative, you could try the HWExact function in the GWASExactHW package. (Haven't tried it myself though ...). Brad - Original Message - From: Jim Silverton jim.silver...@gmail.com To: r-help@r-project.org Sent: Tuesday, 12 July, 2011 8:33:54 PM Subject: Re: [R] Hardy

[R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread DrCJones
Hi, par(mfrow = c(2,2)) will create a 2x2 window that I can use to plot 4 diferent figures in: [plot1 plot2] [plot3 plot4] But how can do 3 so that the bottom spans the width of the upper two: [plot1 plot1] [p l o t 3] Is this possible in R? -- View this message in context:

Re: [R] Deviance of zeroinfl/hurdle models

2011-07-20 Thread cfarmer
bbolker wrote: What about library(pscl) example(hurdle) -2*logLik(fm_hnb2) ? Should this not be -2*(logLik(M) - logLik(S)) where M is the current model and S is the saturated or full model? In which case, is it safe to assume that L(S) = 0? Or have I got my deviances crossed?

Re: [R] Different result of multiple regression in R and SPSS

2011-07-20 Thread J.
@Dimitri: I tried to enter it as numeric and still got the same outcome. I still wonder if there is any way to get the same result from both programs. @David, Bert: Yes, I found that the gender coefficient is R is exactly twice that of the one from SPSS. Need to study on parametrization. Thanks,

[R] grouping data

2011-07-20 Thread adolfpf
All the examples in 'nlme' are in Grouped Data: distance ~ age | Subject format. How do I group my data in dolf the same way the data Orthodont are grouped. show(dolf) distance age Subjectt Sex 16.83679 22.01 F1 F 26.63245 23.04 F1 F 3 11.58730 39.26 M2 M

Re: [R] Different result of multiple regression in R and SPSS

2011-07-20 Thread J.
I finally got the same result by converting gender variable as numeric, and standardize it. I guess SPSS automatically doing the same thing when doing analysis. But, it still is not clear to me how I can interpret standardized categorical (dummy coded) variable. I'd rather stick to use R. Thanks

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread Joshua Wiley
Hi, Try looking at ?layout. Here is a simple example: layout(matrix(c(1, 2, 3, 3), 2, byrow = TRUE)) plot(1:10); plot(11:20); plot(21:40) Cheers, Josh On Tue, Jul 19, 2011 at 4:07 PM, DrCJones matthias.godd...@gmail.com wrote: Hi, par(mfrow = c(2,2)) will create a 2x2 window that I can

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread Dieter Menne
DrCJones wrote: But how can do 3 so that the bottom spans the width of the upper two: [plot1 plot1] [p l o t 3] ?layout for standard graphics (plot..), but that's what you are referring to. For trellis, you must use other methods. Dieter -- View this message in context:

[R] Is it possible to save raster data as a bitmap?

2011-07-20 Thread Vries, Pepijn de
Hi all, I intend to use R for some image manipulations/analysis. It's relatively straightforward to read and manipulate image files in R, but I also would like to store the resulting image (after manipulation) as a bitmap image with the same resolution as the original image. Here is a

Re: [R] cforest - keep.forest = false option? (fwd)

2011-07-20 Thread Torsten Hothorn
-- Forwarded message -- Date: Mon, 18 Jul 2011 10:17:00 -0700 (PDT) From: KHOFF kuph...@gmail.com To: r-help@r-project.org Subject: [R] cforest - keep.forest = false option? Hi, I'm very new to R. I am most interested in the variable importance measures that result from

Re: [R] Doesnt' winedt 6 version work as Rwinedt?

2011-07-20 Thread Uwe Ligges
You may want to try out the beta (!!!) version of a new RWinEdt available from http://www.statistik.tu-dortmund.de/~ligges/RWinEdt Please use R-2.13.1 or later to try it out (2.13.0 won't work with Windows 7 and RWinEdt). Best, Uwe Ligges On 18.07.2011 23:16, Soyeon Kim wrote: Dear All,

[R] Fwd: Help please

2011-07-20 Thread Simon Knapp
Hi All, This is not really an R question but a statistical one. If someone could either give me the brief explanation or point me to a reference that might help, I'd appreciate it. I want to estimate the mean of a log-normal distribution, given the (log scale normal) parameters mu and sigma

Re: [R] Incorrect degrees of freedom for splines using GAMM4?

2011-07-20 Thread Simon Wood
Melinda, Any chance you could send me the data that goes with this, offline, (if you can, I'll only use the data for investigating this issue, of course)? I can reproduce something going wrong with the edf computation for fixed smooths in gamm4, when there are random effects, but I can't get

[R] Warning in ansari.test

2011-07-20 Thread Oscar Rueda
Dear list, When I try to run the Ansari-Bradley test on two long vectors I obtain a warning and the p-value is NA: set.seed(12) x - rnorm(10) y - rnorm(10) ansari.test(x,y) Ansari-Bradley test data: x and y AB = 5002890779, p-value = NA alternative hypothesis: true ratio

Re: [R] Latex Table for means and standard deviations in brackets

2011-07-20 Thread Jim Silverton
Hello all, I am new to xtable. I have several datasets in the form of matrices. Consider the following two simple datasets which are 2 x 3 matrices. The rows in both matrices have the same meaning. For example the first row of both matrices are variable 1 and the second row of both matrices are

[R] Calculating mean from wit mice (multiple imputation)

2011-07-20 Thread Sarah
Hi all, How can I calculate the mean from several imputed data sets with the package mice? I know you can estimate regression parameters with, for example, lm and subsequently pool those parameters to get a point estimate using functions included in mice. But if I want to calculate the mean value

Re: [R] bar chart issue

2011-07-20 Thread Carlos Ortega
Hi Jeff, One way to graph the differences between the two years for the first set of data is via barchart(), a function equivalent to barplot in the lattice package. Please check if with this portion of code (and with your data) the graph you get is quite self-explanatory.

Re: [R] list.files recursively to find files in a specific way...

2011-07-20 Thread Keith Jewell
I don't think the OP specified an operating system, but... A few weeks ago I had a closely analogous problem, seeking files 'menus.txt' in subdirectories 'etc' but not from other subdirectories; '/etc/menus.txt'. I made this post http://tolstoy.newcastle.edu.au/R/e14/help/11/06/5685.html, but

Re: [R] PCA - princomp can only be used with more units than variables

2011-07-20 Thread Michael Dewey
At 03:56 20/07/2011, Joshua Wiley wrote: On Mon, Jul 18, 2011 at 10:48 AM, a.me...@yahoo.co.uk a.me...@yahoo.co.uk wrote: Ok thank you Josh. Basically I have a matrix A with 7 rows and 18 columns. If i j (where i is the number of rows in your matrix and j is the number of columns), then the

Re: [R] Different result of multiple regression in R and SPSS

2011-07-20 Thread Heinz Tuechler
At 19.07.2011 18:50 -0700, Spencer Graves wrote: On 7/19/2011 4:04 PM, Bert Gunter wrote: On Tue, Jul 19, 2011 at 3:45 PM, David Winsemiusdwinsem...@comcast.net wrote: On Jul 19, 2011, at 6:29 PM, J. wrote: Thanks for the answer. # However, I am still curious about

Re: [R] plotting groups via density and different colors

2011-07-20 Thread Carlos Ortega
Hi, Instead of hist you can use functions histogram() or densityplot() in lattice package: require(lattice) histogram( ~ length | factor(sex), data=dene ) densityplot( ~ length, data=dene, groups=factor(sex), auto.key = list(space =

Re: [R] barplot question

2011-07-20 Thread Jim Lemon
On 07/20/2011 01:24 AM, Sally_roman wrote: In my first post is example data. Hi Sally, I was going to suggest: fish-read.table(fish.dat,header=TRUE) controlfish- rbind(fish$pounds[fish$net==Control fish$type == kept], fish$pounds[fish$net==Control fish$type == discard]) expfish-

Re: [R] Fwd: Help please

2011-07-20 Thread Rolf Turner
On 20/07/11 21:08, Simon Knapp wrote: Hi All, This is not really an R question but a statistical one. If someone could either give me the brief explanation or point me to a reference that might help, I'd appreciate it. I want to estimate the mean of a log-normal distribution, given the (log

Re: [R] bar chart issue

2011-07-20 Thread Jim Lemon
On 07/20/2011 01:56 PM, Stratford, Jeffrey wrote: Hi everyone, I determined the presence of three types parasites in a passerine bird over two years. I would like to create a bar chart that shows the proportion infected on the y and year/parasite on the x such that each type of parasite is

Re: [R] multiple plots in single frame: 2 upper, 1 lower

2011-07-20 Thread Rolf Turner
On 20/07/11 11:07, DrCJones wrote: Hi, par(mfrow = c(2,2)) will create a 2x2 window that I can use to plot 4 diferent figures in: [plot1 plot2] [plot3 plot4] But how can do 3 so that the bottom spans the width of the upper two: [plot1 plot1] [p l o t 3] Is this possible in R? In R

Re: [R] How to convert number (matlab) to date

2011-07-20 Thread Gabor Grothendieck
2011/7/19 Prof Brian Ripley rip...@stats.ox.ac.uk: but even this is dubious, since there is no year 0 AD. In Gregorian and Julian calendars, 1 BC continues directly into 1 AD. True, but these days we are ruled by ISO 8601:2004, which does define a year 0 (the year before 1CE aka 1AD). See

Re: [R] Calculating mean from wit mice (multiple imputation)

2011-07-20 Thread Weidong Gu
Sarah, You can try this mean(sapply(1:n.imp, function(x) complete(imp,x)$y)) Weidong Gu On Wed, Jul 20, 2011 at 6:05 AM, Sarah s1327...@student.rug.nl wrote: Hi all, How can I calculate the mean from several imputed data sets with the package mice? I know you can estimate regression

Re: [R] loops and simulation

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 1:34 AM, Daniel Malter wrote: snipped requests, except that you were referring to SAS and had heard that R does not like loops. (This is factually wrong. But R can be slow looping). Where did you hear this? Can you cites any references? -- David Winsemius, MD West

Re: [R] comparing SAS and R survival analysis with time-dependent covariates

2011-07-20 Thread Terry Therneau
Let me expand a bit on Thomas's answer. Looking more closely at your data set you have the following: death time group 0group 1 1.5 0/413/13 3 0/4 5/5 8 4/4 0 At time 1.5 group 1 had 13 deaths out of

Re: [R] Bruno's Panel LSDVC

2011-07-20 Thread George Matysiak
*Is there an implementation of this in R? Thanks. * [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Coercing Logical array to Numeric array

2011-07-20 Thread Mitra, Sumona
Dear all, Coercing a logical vector to a numeric one is easy. The as.numeric function is used. However what do we use when we have a matrix or an array? Sumona __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] comparing SAS and R survival analysis with time-dependent covariates

2011-07-20 Thread AO_Statistics
Thomas Lumley-2 wrote: [...] The warning and error messages are correct here. Look at the point estimate. It's a log hazard ratio of about 20 in one case and about -20 in the other case. The true partial maximum likelihood estimator is infinite. The estimated standard errors are

[R] Analysis of unbalanced data in nlme or car

2011-07-20 Thread Menelaos Stavrinides
I am analyzing a dataset on the effects of six pesticides on population growth rate of a predatory mite. The response variable is the population growth rate of the mite expressed as ln(Nfinal/Nstarting) of the mite, where N final the population of the mite at the end of the experiment and N

[R] np package, KleinSpady estimator, error when I estimate the bootstrapped standard errors

2011-07-20 Thread Dimitris.Kapetanakis
Dear all, I am using np package in order to estimate a model with Klein and Spady estimator. To estimate the model I use KS - npindexbw (xdat=X, ydat=Y, bandwidth.compute=TRUE, method=kleinspady, optim.maxit=10^3, ckertype=epanechnikov, ckerorder=2) and to estimate beta hats standard errors I

Re: [R] Different result of multiple regression in R and SPSS

2011-07-20 Thread Bert Gunter
On Tue, Jul 19, 2011 at 4:19 PM, J. seoulseoulse...@gmail.com wrote: @Dimitri: I tried to enter it as numeric and still got the same outcome. I still wonder if there is any way to get the same result from both programs. There is. ?C ?contrasts But of course you must do your homework to

Re: [R] Coercing Logical array to Numeric array

2011-07-20 Thread Duncan Murdoch
On 20/07/2011 7:14 AM, Mitra, Sumona wrote: Dear all, Coercing a logical vector to a numeric one is easy. The as.numeric function is used. However what do we use when we have a matrix or an array? Usually you don't need to do anything: if a local is used in arithmetic, the values are

Re: [R] Coercing Logical array to Numeric array

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 7:14 AM, Mitra, Sumona wrote: Dear all, Coercing a logical vector to a numeric one is easy. The as.numeric function is used. However what do we use when we have a matrix or an array? Here's one way: m -matrix(c(1, 2, 3, 4),2) m [,1] [,2] [1,] 1 3 [2,] 2 4

[R] transforming a matrix of logical to 0 and 1 while keeping the dim of matrix

2011-07-20 Thread Julian TszKin Chan
Hi all, Suppose I have a matrix of logical value: x-matrix(c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE),nrow=3) I would like to change the value of FALSE to 0 and TRUE to 1. An obvious way to do it is : y-as.numeric(x) However this method doesn't keep the dim of x. I also need to copy

Re: [R] Writing the output of a regression object to a file

2011-07-20 Thread Hanlie Pretorius
Thanks for the reply. write.table(esvr.pred) worked - I got data out that's been scaled back to its original range of values. 2011/7/19, Bert Gunter gunter.ber...@gene.com: If I understand you correctly, I would like to export the esvr.pred object to a file so that I can draw a graph of it

Re: [R] Grouping columns

2011-07-20 Thread Brad Patrick Schneid
untested because I don't have access to your data, but this should work. b13.NEW - b13[, c(Gesamt, Wasser, Boden, Luft, Abwasser, Gefährliche Abfälle, nicht gefährliche Abfälle)] Geophagus wrote: *Hi @ all, I have a question concerning the possibilty of grouping the columns of a

[R] Grouping columns

2011-07-20 Thread Geophagus
*Hi @ all, I have a question concerning the possibilty of grouping the columns of a matrix. R groups the columns alphabetically. What can I do to group the columns in my specifications? The script is the following:* #R-Skript: Anzahl xyz #Quelldatei einlesen b-read.csv2(Z:/int/xyz.csv,

Re: [R] transforming a matrix of logical to 0 and 1 while keeping the dim of matrix

2011-07-20 Thread Sarah Goslee
How about this: x-matrix(c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE),nrow=3) x [,1] [,2] [,3] [1,] TRUE FALSE TRUE [2,] FALSE TRUE FALSE [3,] TRUE FALSE TRUE ifelse(x, 1, 0) [,1] [,2] [,3] [1,]101 [2,]010 [3,]101 Sarah On Wed, Jul

Re: [R] Grouping columns

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 10:42 AM, Geophagus wrote: *Hi @ all, I have a question concerning the possibilty of grouping the columns of a matrix. R groups the columns alphabetically. What can I do to group the columns in my specifications? Dear Earth Eater; You can create a factor whose levels

Re: [R] transforming a matrix of logical to 0 and 1 while keeping the dim of matrix

2011-07-20 Thread David Winsemius
Two further methods: x+0 [,1] [,2] [,3] [1,]101 [2,]010 [3,]101 mode(x)- numeric; x [,1] [,2] [,3] [1,]101 [2,]010 [3,]101 On Jul 20, 2011, at 11:27 AM, Sarah Goslee wrote: How about this:

Re: [R] Using Mplus via R

2011-07-20 Thread JLucke
Yes. If you want a program that does some of what Mplus does, use the lavaan package or the sem package. Dimitri Liakhovitski dimitri.liakhovit...@gmail.com Sent by: r-help-boun...@r-project.org 07/18/2011 05:36 PM To r-help r-help@r-project.org cc Subject [R] Using Mplus via R

Re: [R] transforming a matrix of logical to 0 and 1 while keeping the dim of matrix

2011-07-20 Thread Joshua Wiley
Hi, I am not sure about correct, but R stores logical values TRUE/FALSE as 1/0 already so simply changing the mode would suffice: mode(x) - numeric alternately x + 0 HTH, Josh On Wed, Jul 20, 2011 at 8:16 AM, Julian TszKin Chan cjul...@bu.edu wrote: Hi all, Suppose I have a matrix of

[R] (no subject)

2011-07-20 Thread Anera Salucci
what is exactly difference between gee, geese, and ordgee [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] [R-pkgs] new versions of packages RWinEdt, signal, tuneR

2011-07-20 Thread Uwe Ligges
A series of package updates is on CRAN (or in the process to get there). Already available from CRAN are: - signal: Since I took over maintainership years ago, I have not invested the required amount of time into this package - until this spring and now the package got a NAMESPACE and dozens

Re: [R] transforming a matrix of logical to 0 and 1 while keepin

2011-07-20 Thread Ted Harding
It is easier and more straightforward than any of the suggestions so far. Simply multiply the matrix by 1, or add 0 to it: x-matrix(c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE),nrow=3) 1*x # [,1] [,2] [,3] # [1,]101 # [2,]010 # [3,]101

Re: [R] Taking all complete diagonals of a matrix

2011-07-20 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: Peter Lomas [mailto:peter.lo...@ucalgary.ca] Sent: Tuesday, July 19, 2011 6:42 PM To: Nordlund, Dan (DSHS/RDA) Cc: r-help@r-project.org Subject: Re: [R] Taking all complete diagonals of a matrix Thanks very much to everyone who replied. Peter got me on my

[R] [R-pkgs] ANNOUNCE -- Rjms package, message publishing using rJava and ActiveMQ

2011-07-20 Thread SMS Chauhan
EIP(Enterprise Integration Patterns), ESB( Enterprise service bus) are commonly used terms utilized with Message oriented middleware. Apache ActiveMQ implements message queues and message topics. The Rjms package brings the capabilities of messaging to R. The description states: This package uses

[R] [R-pkgs] irtoys 0.1.4

2011-07-20 Thread Ivailo Partchev
A new version of irtoys is / will be available on CRAN. Two minor bugs have been fixed. One of these is more interesting: the previous code did not anticipate negative estimates for discriminations. What I did not know is that, unlike ICL or Bilog, ltm does not constrain discriminations to be

Re: [R] Taking all complete diagonals of a matrix

2011-07-20 Thread peter dalgaard
On Jul 20, 2011, at 03:42 , Peter Lomas wrote: Thanks very much to everyone who replied. Peter got me on my way with the use diag() hint, and I came with a less pretty version of Dan's first option almost at the same time as I got that email. Seems I can't avoid one for loop, but one is

[R] Changing a matrix based on eigen value

2011-07-20 Thread B. Jonathan B. Jonathan
Dear all, my question is not directly related to R, however I believe that experts here would not mind anything to have a look on my problem. Please consider a symmetric matrix and it's eigen values: set.seed(1) mat - matrix(rnorm(36), 6) mat - mat %*% t(mat) # symmetric matrix mat

[R] Grofit

2011-07-20 Thread Roland Sookias
Hi Is it possible to use grofit to get the AIC of several (e.g. two) growth models and compare both these and model parameters? All I can get it to do so far is return parameters for a single model. Cheers Roland [[alternative HTML version deleted]]

Re: [R] timeDate with month designated by three letters.

2011-07-20 Thread mdkzone
Thanks for the assistance How does strptime(04-MAY-11 1428,format=%d-%b-%y %H%M) differ from timeDate(04-MAY-11 1428,format=%d-%b-%y %H%M) ? -Original Message- strptime(04-MAY-11 1428,format=%d-%b-%y %H%M) [1] 2011-05-04 14:28:00 -- Clint BowmanINTERNET:

Re: [R] timeDate with month designated by three letters.

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 3:38 PM, mdkz...@aol.com wrote: Thanks for the assistance How does strptime(04-MAY-11 1428,format=%d-%b-%y %H%M) differ from timeDate(04-MAY-11 1428,format=%d-%b-%y %H%M) ? Wouldn't one need to know where you got this non-base function? -- David Winsemius, MD West

[R] Competing risk regression with CRR slow on large datasets?

2011-07-20 Thread Max Gordon
Hi, I posted this question on stats.stackexchange.com 3 days ago but the answer didn't really address my question concerning the speed in competing risk regression. I hope you don't mind me asking it in this forum: I’m doing a registry based study with almost 200 000 observations and I want to

[R] select element from each row of the matrix

2011-07-20 Thread gallon li
I have a 5 column matrix like 12 10 8 6 3 10 9 8 7 5 14 NA 4 NA NA NA 15 NA 10 NA 5 ... I want to select the position of the first entry for each row =5 for example, for the first row, I want to select the last element and return its position as 5; for th e third row, I want to select the third

Re: [R] select element from each row of the matrix

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 4:23 PM, gallon li wrote: I have a 5 column matrix like 12 10 8 6 3 10 9 8 7 5 14 NA 4 NA NA NA 15 NA 10 NA 5 ... Probably something along the lines of aapply(mtx, 1, function(x) { c( x[ which(x = 5)[1] ], # first row are the values

Re: [R] select element from each row of the matrix

2011-07-20 Thread Peter Alspach
Tena koe Assuming your matrix is called yourMatrix, then try apply(yourMatrix, 1, function(x) which(x=5)) HTH ... Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of gallon li Sent: Thursday, 21 July 2011 8:23

[R] Question about converting list items in matrix

2011-07-20 Thread Vickie S
Hi friends, I have got a list where each element might have variable number of members. $`4213` [1] 214077_x_at $`164832` [1] 225996_at 235977_at $`339010` [1] NA $`23410` [1] 221562_s_at 221913_at 49327_at $`285386` [1] 229764_at $`2099` [1] 205225_at 211233_x_at 211234_x_at

Re: [R] Latex Table for means and standard deviations in brackets

2011-07-20 Thread Peter Lomas
Hi Jim, Perhaps somebody else knows a smoother way, but in the past I have just built my table in R as a matrix then used xtable. Here's what I would do with your example: library(xtable) dataset1 = matrix( c(1,2,3,4, 5, 6 ), 2 , 3) dataset2 = matrix( c(4,3,5,10, 1, 0), 2, 3) dataset -

Re: [R] select element from each row of the matrix

2011-07-20 Thread William Dunlap
Looping over the rows, as David did below, is one way. You can also loop over the columns. This can be faster when nrow(matrix)ncol(matrix). E.g., with the following 2 functions f0 - function (x) { apply(x, 1, function(aRow) which(aRow = 5)[1]) } f1 - function (x) { isGood -

Re: [R] Question about converting list items in matrix

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 5:04 PM, Vickie S wrote: Hi friends, I have got a list where each element might have variable number of members. $`4213` [1] 214077_x_at $`164832` [1] 225996_at 235977_at $`339010` [1] NA $`23410` [1] 221562_s_at 221913_at 49327_at $`285386` [1] 229764_at $`2099`

[R] RES: Question about converting list items in matrix

2011-07-20 Thread Filipe Leme Botelho
---BeginMessage--- Vickie, try something like this # Dummy data lst - list(This,c(should, work, just),fine,I,guess...,c(NA,NA)) names(lst) - letters[seq(1,length(lst))] lst # Arranging for (i in 1:length(lst)) { lst[[i]] - as.matrix(lst[[i]]) rownames(lst[[i]]) - rep(names(lst)[i],

Re: [R] comparing SAS and R survival analysis with time-dependent covariates

2011-07-20 Thread Göran Broström
On Wed, Jul 20, 2011 at 12:02 PM, AO_Statistics abouesl...@gmail.com wrote: Thomas Lumley-2 wrote: [...] The warning and error messages are correct here.  Look at the point estimate. It's a log hazard ratio of about 20 in one case and about -20 in the other case.  The true partial maximum

[R] Bootstrap

2011-07-20 Thread Val
Hi all, I am facing difficulty on how to use bootstrap sampling and below is my example of function. Read a data , use some functions and use iteration to find the solution( ie, convergence is reached). I want to use bootstrap approach to do it several times (200 or 300 times) this whole

[R] repeat a sequence - but not for a full number of times

2011-07-20 Thread Dimitri Liakhovitski
Apologies, for a very simple question. I forgot how to do it - although I remember reading about getting a warning in such a situation. I have a data frame. It happens to be 10 rows but it could be 11 or 3 or 13... x-data.frame(a=1:10) I need to add variable b that is a sequence of 1:3 - repeated

Re: [R] repeat a sequence - but not for a full number of times

2011-07-20 Thread Dimitri Liakhovitski
Never mind - found it: x-data.frame(a=1:10) x$b-rep(1:3,nrow(x)%/%3,len=nrow(x)) Dimitri On Wed, Jul 20, 2011 at 6:15 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Apologies, for a very simple question. I forgot how to do it - although I remember reading about getting a

Re: [R] repeat a sequence - but not for a full number of times

2011-07-20 Thread Sarah Goslee
Or you could take advantage of R's automatic recycling: x$b - rep(1:3, length=nrow(x)) x a b 1 1 1 2 2 2 3 3 3 4 4 1 5 5 2 6 6 3 7 7 1 8 8 2 9 9 3 10 10 1 Thanks for providing a simple reproducible example. Sarah On Wed, Jul 20, 2011 at 6:20 PM, Dimitri Liakhovitski

Re: [R] Bootstrap

2011-07-20 Thread Weidong Gu
I didn't see bootstrap steps in your code. One way to modify your codes for (Ncount in 1:100) { b.data-data[sample(1:nrow(data),replace=T),] y -b.data[,1] x -b.data[,2] n - length(x) ... ### make appropriate changes if needed } Weidong Gu On Wed, Jul 20, 2011 at 6:09 PM, Val valkr...@gmail.com

Re: [R] Changing a matrix based on eigen value

2011-07-20 Thread Bert Gunter
A homework problem? -- Bert On Wed, Jul 20, 2011 at 10:06 AM, B. Jonathan B. Jonathan bkheijonat...@gmail.com wrote: Dear all, my question is not directly related to R, however I believe that experts here would not mind anything to have a look on my problem. Please consider a symmetric matrix

Re: [R] PCA - princomp can only be used with more units than variables

2011-07-20 Thread Joshua Wiley
Hi Armin, Please copy the list on your emails. Providing your matrix A (or some other reproducible example) would be useful to anyone who wanted to help you. It is easy to do by copying the output from your console from running: dput(A) This would at least let us try out your code on your

[R] Cleveland Dot plots: tick labels and error bars

2011-07-20 Thread Colin Wahl
Dear list, I've been learning how to make a 2x2 paneled dotplot in lattice without any previous experience using lattice. my code thusfar is: nut-read.table(/Users/colinwahl/Desktop/nutsimp_noerror.csv, T, sep= ,) attach(nut) nut1-data.frame(Nitrate, Total_Nitrogen, Phosphate,

[R] R on Multicore for Linux

2011-07-20 Thread Madana_Babu
Hi all, I have R installed on a box, which is running on a machine with 16 core and Redhat - Linux. I am handling huge (size of dataset will be 5 GB) dataset. Lets assume that my data is in the form of structured (multiple) logs. I access the data by using all.files(). Since by default basic

Re: [R] Problem with RODBC

2011-07-20 Thread David Scott
On 20/07/11 18:56, Dieter Menne wrote: David Scott-6 wrote: I have been trying to read some data from an Excel workbook without success. ... faults- sqlFetch(channel, sqtable = 'Data', +colnames = FALSE, as.is = TRUE) faults [1] HY001 -1040 [Microsoft][ODBC Excel

Re: [R] R on Multicore for Linux

2011-07-20 Thread stephen sefick
Make this reproducible. On Wed, Jul 20, 2011 at 6:44 PM, Madana_Babu madana_b...@infosys.com wrote: Hi all, I have R installed on a box, which is running on a machine with 16 core and Redhat - Linux. I am handling huge (size of dataset will be 5 GB) dataset. Lets assume that my data is in

Re: [R] Changing a matrix based on eigen value

2011-07-20 Thread B. Jonathan B. Jonathan
It is not any homework problem. I just need some pointer. Given that I think I would be able to carry forward. Thanks, On Thu, Jul 21, 2011 at 4:52 AM, Bert Gunter gunter.ber...@gene.com wrote: A homework problem? -- Bert On Wed, Jul 20, 2011 at 10:06 AM, B. Jonathan B. Jonathan

[R] gls yields much smaller std. errors with different base for contrasts

2011-07-20 Thread Matthew Wolak
Dear List, After running a compound symmetric model using gls, I realized that the default contrasts were not the ones that made the most sense given the biological relationships among the factor levels. When I either changed the factor levels to re-arrange the order they occur in the gls model

[R] installing Rgraphviz

2011-07-20 Thread Data Analytics Corp.
Hi, I attempted to install Rgraphviz but ran into a problem. It requires graphviz 2.20.3. I have this and installed it but the Windows 7 system path variable has to be modified to include the path to the graphviz bin file. How do I do this on Windows 7? It's been a long time since I had

Re: [R] installing Rgraphviz

2011-07-20 Thread Jeff Newmiller
This is off-topic, and extremely easy to find an answer to using Google. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research

Re: [R] Changing a matrix based on eigen value

2011-07-20 Thread David Winsemius
On Jul 20, 2011, at 11:17 PM, B. Jonathan B. Jonathan wrote: It is not any homework problem. I just need some pointer. Given that I think I would be able to carry forward. Then what kind of problem _is_ it? You say: nearest matrix ... using what measure for distance or similarity? ...

Re: [R] Changing a matrix based on eigen value

2011-07-20 Thread B. Jonathan B. Jonathan
Thanks David for your pointer. Here my original matrix is VCV matrix which is the utmost important matrix in finance. However in reality what happens is that due to incomplete data. lot of missing values (or some other problems) that matrix may be unstable like min eigen value is negative or very

Re: [R] loops and simulation

2011-07-20 Thread Daniel Malter
http://mlg.eng.cam.ac.uk/dave/rmbenchmark.php I haven't ever tried it myself, but online sources suggest that Matlab possibly gains speed by internally avoiding loops rather than looping faster. What would stand at the end if this were true, however, is improved end user speed. Daniel

Re: [R] loops and simulation

2011-07-20 Thread David Winsemius
On Jul 21, 2011, at 1:04 AM, Daniel Malter wrote: http://mlg.eng.cam.ac.uk/dave/rmbenchmark.php I haven't ever tried it myself, but online sources suggest that Matlab possibly gains speed by internally avoiding loops rather than looping faster. What would stand at the end if this were