Re: [R] question about glm vs. loglin()

2011-09-15 Thread David Winsemius
On Sep 15, 2011, at 4:33 PM, Yana Kane-Esrig wrote: Dear R gurus, I am looking for a way to fit a predictive model for a contingency table which has counts. I found that glm( family=poisson) is very good for figuring out which of several alternative models I should select. But once I sel

[R] merging nexus sequence files

2011-09-15 Thread nikki22
Hi, newbie here, I was wondering if anyone can out, I have checked through the help archives but cannot find my answer. I have three nexus files mostly with the same taxa but some are different. I want to concatenate the DNA sequences from these three files into one large nexus file but I cannot

[R] cumVar and cumSkew

2011-09-15 Thread D_Tomas
Hi there, I need to do the same thing as cumsum but with the variance and skewness. I have tried to do a loop for like this: var.value <- vector(mode = "numeric", length = length(daily)) for (i in (1:length(daily))) { var.value[i] <- var(daily[1:i]) } But beca

Re: [R] Questions on 'lme' function, urgent!

2011-09-15 Thread Bert Gunter
You should post this to the r-sig-mixed-models list, not here. -- Bert On Thu, Sep 15, 2011 at 1:42 PM, karena wrote: > Hi Dear all, > > I have some gene expression data samples from different tissue types > --- > - 120 samples from blood (B) > - 20

Re: [R] merging nexus sequence files

2011-09-15 Thread David Winsemius
On Sep 15, 2011, at 6:00 PM, nikki22 wrote: Hi, newbie here, I was wondering if anyone can out, I have checked through the help archives but cannot find my answer. I have three nexus files mostly with the same taxa but some are different. I want to concatenate the DNA sequences from thes

Re: [R] cumVar and cumSkew

2011-09-15 Thread Albyn Jones
Wow, this takes me back a ways :-) As I recall, BMDP used updating algorithms to compute sample means, variances, and covariances in one pass through the dataset. You need the updating algorithm for means: \bar{X}_{n} = \frac{n-1}{n}\bar{X}_{n-1}+\frac{X_n}{n} You can work out the algorithm

Re: [R] cumVar and cumSkew

2011-09-15 Thread David Winsemius
On Sep 15, 2011, at 5:57 PM, D_Tomas wrote: Hi there, I need to do the same thing as cumsum but with the variance and skewness. I have tried to do a loop for like this: var.value <- vector(mode = "numeric", length = length(daily)) for (i in (1:length(daily))) { var.va

Re: [R] R functions

2011-09-15 Thread B77S
If your data is named 'test_file' then use dput(test_file) You can copy and paste the results here so people can more easily try and help you. see ?dput sujitha wrote: > > Hi group, > I am trying to right a code to do the following > This is how the test file looks like: > Chr start end sa

[R] plot(m, which = 1), where m is a lm linear model. What is 'which' doing?

2011-09-15 Thread Idris Raja
Sample code from *R CookBook* (awesome book btw) *11.12: Finding the Best Power Transformation (Box-Cox) Procedure* require(MASS) x <- 10:100 eps <- rnorm(length(x), sd = 5) y <- (x + eps)^(-1 / 1.5) m <- lm(y ~ x) # * What does the *which* in this line do???

Re: [R] plot(m, which = 1), where m is a lm linear model. What is 'which' doing?

2011-09-15 Thread Weidong Gu
Remember R is object-oriented. Your m is lm object, so check ?plot.lm Weidong Gu On Thu, Sep 15, 2011 at 8:14 PM, Idris Raja wrote: > Sample code from *R CookBook* (awesome book btw) *11.12: Finding the Best > Power Transformation (Box-Cox) Procedure* > > require(MASS) > x <- 10:100 > eps <- rn

Re: [R] Returning the name of an object passed directly or from a list by lapply

2011-09-15 Thread andrewH
Thanks Bill! You are correct. I did not understand what was inmy list. I posted a simplified example in the hope of focusing on the essentials, but I see I have edited out the motivation. When my programs go awry, and sometimes when they don't, I find I need to understand what is in some variabl

[R] Referring to an object by a variable containing its name: 6 failures

2011-09-15 Thread andrewH
Dear Folks-- I'm trying to make a function that takes the columns I select from a data frame and then uses a for loop to print some information about each one, starting with the column name. I succeed in returning the column name, but nothing else I have tried using the variable colName, containin

Re: [R] Returning the name of an object passed directly or from a list by lapply

2011-09-15 Thread William Dunlap
Is th following the sort of thing you are looking for? f <- function (...) { unevaluatedArgs <- substitute(...()) evaluatedArgs <- list(...) stopifnot(length(unevaluatedArgs) == length(evaluatedArgs)) tags <- vapply(unevaluatedArgs, FUN=function(x) deparse(x)[1], FUN.VALUE=

Re: [R] Referring to an object by a variable containing its name: 6 failures

2011-09-15 Thread rmailbox
What am I missing about your inquiry: It seems like x[ , colName ] should work: testDFcols <- function(x = data.df, select=c(1:ncol(x)), bar=TRUE) { if(bar) cat("##\n"); for (column in select) { colName <-names(x)[column] cat("Column Name(", c

[R] demo creating

2011-09-15 Thread John Clark
R experts: I want to prepare a demo (that will play sequentially in clicks) for a presentation tutorial...Can somebody help me how can I write a demo, suppose the following are steps in the demo.. #start set.seed(1345) x1 <- sample(letters[1:10], 5) x1 sort(x1) x <- sample(1:10, 5) y <- sample(c

[R] xyplot remove ticks from top and right

2011-09-15 Thread Alex Olssen
Dear R-help, I am drawing a graph using xyplot. The axis labels only appear on the left and bottom axes - I used the option xyplot(scale = list(alternating = 1)) However while the labels no longer appear on the top and right border of the graph the ticks do! Any help would be greatly appreciate

Re: [R] xyplot remove ticks from top and right

2011-09-15 Thread David Winsemius
On Sep 15, 2011, at 10:44 PM, Alex Olssen wrote: Dear R-help, I am drawing a graph using xyplot. The axis labels only appear on the left and bottom axes - I used the option xyplot(scale = list(alternating = 1)) Just read the help page: ?xyplot There is a tck argument to scales that you

Re: [R] problem with predict.gam in package gam

2011-09-15 Thread Drew Tyre
Thank you! It also works on a second computer here with the details below, so something must be messed up on the other machine. > sessionInfo() R version 2.13.1 (2011-07-08) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.

Re: [R] In optim() function, second parameter in par() missing

2011-09-15 Thread colstat
Hi, David I happened to see this http://www.unc.edu/~monogan/computing/r/MLE_in_R.pdf And they wrote optim(c(0,1),normal.lik1,y=y,method="BFGS") But it doesn't actually work, like you mentioned, it only takes 2 parameters, is that the reason why. R gives this error > optim(par=parameters, normal.

Re: [R] Questions on 'lme' function, urgent!

2011-09-15 Thread karena
Ok. Thank you. karena On Thu, Sep 15, 2011 at 5:33 PM, Bert Gunter [via R] < ml-node+s789695n3816961...@n4.nabble.com> wrote: > You should post this to the r-sig-mixed-models list, not here. > > -- Bert > > On Thu, Sep 15, 2011 at 1:42 PM, karena <[hidden > email]

[R] Extracting BLUPs!

2011-09-15 Thread Kishor K. Bhattarai
Dear R experts, Suppose I have an data frame likes this: SampleID grain huskfill 1 KB001 0.076350637 0.28662970 1.45790428 2 KB001 0.118940999 0.22795690 2.94869785 3 KB001 0.150254385 0.56241033 1.09677303 4 KB002 0.188315675 0.21455241 0.96

Re: [R] Colour code y-axis labels on a dot plot

2011-09-15 Thread markm0705
Dear Carlos Attached is attempt at getting your scales suggestion to work (which at the moment does not) - I'm hoping you have the time to assist again (data file correctly attached this time). Thanks in advance Mark M On Thu, Sep 15, 2011 at 11:30 PM, Carlos Ortega [via R] < ml-node+s78

Re: [R] R functions

2011-09-15 Thread B77S
Suji, # Here is your data ("test"). test <- structure(list(Chr = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "chr2", class = "factor"), start = c(9896633L, 9896639L, 14314039L, 14404467L, 14421718L, 16031710L, 16036178L, 16048665L, 37491676L, 37702947L), end = c(9896683L, 989

<    1   2