Re: [R] ask for help about lme function

2021-07-20 Thread Bert Gunter
The mixed models list is r-sig-mixed-models . nlme:lme is not really designed for crossed random effects. IIRC, it's possible, but not easy. As Kevin said, lme4:lmer is really what you should use. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking thi

Re: [R] ask for help about lme function

2021-07-20 Thread Kevin Thorpe
You might get better answers on the r-sig-ME list. The lmer() function from lme4 handles crossed and non-nested random effects quite seamlessly. I cannot comment on whether or not lme() can as well. -- Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Kno

[R] ask for help about lme function

2021-07-20 Thread Juan Liu
Dear R project, I am a doctoral student in Zhejiang university in China, I am using lme function in nlme package and learning the function by Package 'nlme' document. I am writing this email for some help to build a lme model. My goal was to include two non-nested random effects in the lme mode

Re: [R] Ask for help on the preprocessing of GEO microarray data with Oligo

2019-11-14 Thread Bert Gunter
My recommendation is: Post on the BioConductor site, not here. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Nov 14, 2019 at 9:22 AM chziy429 wrote: >

[R] Ask for help on the preprocessing of GEO microarray data with Oligo

2019-11-14 Thread chziy429
Dear Sir I have downloaded the raw CEL data included in "GSE41418" from GEO and tried to process the raw microarray data according to the following Rscripts affydata <- ReadAffy(cdfname = "mouse4302mmentrezgcdf") eset <- oligo::rma(affydata) The raw data can be read by ReadAffy but fai

Re: [R] ask for help

2014-08-07 Thread William Dunlap
I prefer the idiom c(TRUE, a[-1] != a[-length(x)]) because it works for character and other data types as well. I also find that thinking in terms of runs instead of subscripting tricks is easier. __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] ask for help

2014-08-07 Thread Bart Kastermans
Better: b <- c(a[1]-1,a[-length(a)]) On 07 Aug 2014, at 17:28, Bart Kastermans wrote: > For readability I like: > >> b <- c(0,a[-length(a)]) >> which(a != b & a == 0) > [1] 4 12 18 >> which(a != b & a == 1) > [1] 1 6 16 23 > > > On 07 Aug 2014, at 17:23, William Dunlap wrote: > >> My sol

Re: [R] ask for help

2014-08-07 Thread Bart Kastermans
For readability I like: > b <- c(0,a[-length(a)]) > which(a != b & a == 0) [1] 4 12 18 > which(a != b & a == 1) [1] 1 6 16 23 On 07 Aug 2014, at 17:23, William Dunlap wrote: > My solution may be a bit clearer if you define the function isFirstInRun > isFirstInRun <- function(x) { > if (le

Re: [R] ask for help

2014-08-07 Thread William Dunlap
My solution may be a bit clearer if you define the function isFirstInRun isFirstInRun <- function(x) { if (length(x) == 0) { logical(0) } else { c(TRUE, x[-1] != x[-length(x)]) } } Then that solution is equivalent to which(isFirstInRun(a) & a==1) If 'a' contains NA's then

Re: [R] ask for help

2014-08-07 Thread peter dalgaard
On 07 Aug 2014, at 11:16 , jim holtman wrote: > rle ...with a little tinkering, like > m <- c(1,cumsum(rle(a)$lengths)+1) > m [1] 1 4 6 12 16 18 23 34 then look at every 2nd element, discarding the last. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solb

Re: [R] ask for help

2014-08-07 Thread William Dunlap
> a<-c(1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1) > which( a==1 & c(TRUE, a[-length(a)]!=1) ) [1] 1 6 16 23 > which( a==0 & c(TRUE, a[-length(a)]!=0) ) [1] 4 12 18 Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Aug 6, 2014 at 7:12 PM, Johnnycz wrote: > Hello,eve

Re: [R] ask for help

2014-08-07 Thread jim holtman
rle Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Aug 6, 2014 at 10:12 PM, Johnnycz wrote: > Hello,everybody, > I have a sequence,like > a<-c(1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,0,1

[R] ask for help

2014-08-06 Thread Johnnycz
Hello,everybody, I have a sequence,like a<-c(1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1),how to get the position of each first 1 and 0, that's to say, how to get b<-c(1,6,16,23) for first 1 and d<-c(4,12,18) for first 0. Many thanks! Johnny [[alter

Re: [R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread Berend Hasselman
On 21-02-2013, at 15:39, JiangZhengyu wrote: > Dear R experts, > > I have two matrix (seq & mat) & I want to retrieve in a new matrix all the > numbers from mat that =1 (corresponding to the same row/ column position) in > seq, or all the numbers in mat that =-1 in seq. - Replace all the numb

Re: [R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread Jose Iparraguirre
hengyu Sent: 21 February 2013 14:39 To: r-help@r-project.org Subject: [R] Ask for help: find corresponding elements between matrix Dear R experts, I have two matrix (seq & mat) & I want to retrieve in a new matrix all the numbers from mat that =1 (corresponding to the same row/

Re: [R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread arun
[,4] #[1,] 0.2588229  0.8971982 NA -1.0750013 #[2,] 1.8311207  0.4880163 NA  0.8550108 #[3,]    NA -1.2553858 -0.1321224 NA A.K. - Original Message - From: JiangZhengyu To: r-help@r-project.org Cc: Sent: Thursday, February 21, 2013 9:39 AM Subject: [R] Ask for h

[R] Ask for help: find corresponding elements between matrix

2013-02-21 Thread JiangZhengyu
Dear R experts, I have two matrix (seq & mat) & I want to retrieve in a new matrix all the numbers from mat that =1 (corresponding to the same row/ column position) in seq, or all the numbers in mat that =-1 in seq. - Replace all the numbers with NA if it's not 1/-1 in seq. There ar

Re: [R] Ask for help - how to change WHIRR.117.csv to WHIRR_117.csv

2012-09-26 Thread Rui Barradas
Hello, Maybe the code below answers to both your questions (Q1 and Q2) cnames <- colnames(dat) cnames <- sub("WHIRR\\.", "WHIRR_", cnames) for(which_col in seq_len(ncol(dat))) { subset_data <- dat[which_col:ncol(dat)] # change 1, Q2 file_name <- sprintf('%s.csv', cnames[which_col]

[R] Ask for help - how to change WHIRR.117.csv to WHIRR_117.csv

2012-09-25 Thread s.s.m. fauzi
Hi, I have a script below. dat <- read.table(file="pt.csv", header=T, sep=",", row.names=1, col.names=1) dat for(which_col in seq_len(ncol(dat))) { subset_data <- dat[,which_col:ncol(dat)] file_name <- sprintf('%s.csv', colnames(dat)[which_col]) write.csv(subset_data, file_name)

[R] Ask for help on Error() model

2011-11-19 Thread Jinsong Zhao
Hi there, I have a experimental design as following: P A B Y 1 1 1 1 -0.18524045 2 1 1 2 -1.64226232 3 2 2 1 -0.51342697 4 2 2 2 -0.29684874 5 3 3 1 0.71566733 6 3 3 2 -1.06097480 7 4 4 1 0.05772670 8 4 4 2 0.99316677 9 5 1 1 -0.61860414 10 5 1 2 0.50257548 1

Re: [R] Ask for help with Error: Object not found

2010-09-20 Thread Duncan Murdoch
On 20/09/2010 3:07 PM, Tianchan Niu wrote: Dear All, I am trying to use ode solver "rk4" to solve an ODE system, however, it keeps saying: Error in eval(expr, envir, enclos) : object "dIN" not found. The sample codes are enclosed as follows, please help me. Thank you very much! rm(list=ls(

[R] Ask for help with Error: Object not found

2010-09-20 Thread Tianchan Niu
Dear All, I am trying to use ode solver "rk4" to solve an ODE system, however, it keeps saying: Error in eval(expr, envir, enclos) : object "dIN" not found. The sample codes are enclosed as follows, please help me. Thank you very much! rm(list=ls()) library(odesolve) # The ODE syste

Re: [R] ask for help about netcdf

2010-08-17 Thread Prof Brian Ripley
Please learn that capitalization is important both in R (sic) and in effective communication. There are CRAN packages RNetCDF, ncdf and ncdf4 on CRAN to read/write NetCDF (sic) format files from R. On Wed, 18 Aug 2010, mat chueng wrote: hi,r project I am a new user who has some questions ab

[R] ask for help about netcdf

2010-08-17 Thread mat chueng
hi,r project I am a new user who has some questions about r tool,I have some original data file in netcdf format which is a famous geometry data file format, The file contains very large weather information from every zone of the world,I want to extract only a part of them to calcuate, like the

Re: [R] ask for help with this R quesiton

2010-01-27 Thread song song
> > question like this: > > I have data tag and phi, when tag are the same, then phi are the same. like > below, tag have value 1 2 3 4 and phi have value .9 .3 1 0. > > my question is, how can I get the result like > tag=c(1,2,3,4) and corresponding phi=c(.9,.3,1,0) > > tag phi > 2.3 > 1

[R] ask for help with this R quesiton

2010-01-27 Thread song song
question like this: I have data tag and phi, when tag are the same, then phi are the same. like below, tag have value 1 2 3 4 and phi have value .9 .3 1 0. my question is, how can I get the result like tag=c(1,2,3,4) and corresponding phi=c(.9,.3,1,0) tag phi 2.3 1.9 2.3 31 2

Re: [R] ask for help with this R quesiton

2010-01-27 Thread Henrique Dallazuanna
Try this: unique(cbind(tag, phi))[order(unique(tag)),] On Wed, Jan 27, 2010 at 4:13 PM, song song wrote: >> question like this: >> >> I have data tag and phi, when tag are the same, then phi are the same. like >> below, tag have value 1 2 3 4 and phi have value .9 .3 1 0. >> >> my question is, h

[R] ask for help with this R quesiton

2010-01-27 Thread song song
> question like this: > > I have data tag and phi, when tag are the same, then phi are the same. like > below, tag have value 1 2 3 4 and phi have value .9 .3 1 0. > > my question is, how can I get the result like > tag=c(1,2,3,4) and corresponding phi=c(.9,.3,1,0) > > tag phi > 2.3 > 1.9

Re: [R] ask for help xyplot

2009-06-23 Thread Daniel Malter
che Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von jlfmssm Gesendet: Tuesday, June 23, 2009 6:07 PM An: r-help@r-project.org Betreff: [R] ask for help xyplot I want to make such plot using the following data set plot Mean with Sd(+/-) by

[R] ask for help xyplot

2009-06-23 Thread jlfmssm
I want to make such plot using the following data set plot Mean with Sd(+/-) by Dim group by Lac here is data Does anyone know how to plot using xyploy Thanks, Aimin Mean Sd Var Min Max Dim Lac 704 44.0 NA NA 44.0 44.0 -30 3 703 45.9200

Re: [R] ask for help how to get accumulate contingency table?

2008-03-19 Thread alex chin
ject: RE: [R] ask for help how to get accumulate contingency table?> To: [EMAIL PROTECTED]> > I'm not at work so I'm not sure it will work but you can try below.> > I am assuming the result of table(data1) is a list so> > tablelist<-table(data1)> > cum

[R] ask for help how to get accumulate contingency table?

2008-03-18 Thread alex chin
Hi, I post the question again. x<-rep(c(2,3,4),20) y<-sample(rep(c(0,1),30)) tr<-rep(c(1:5),6) data1<-data.frame(x,y,tr) data1<-data1[order(data1$tr),] > data1 x y tr 2 1 1 4 0 1 3 1 1 2 1 1 4 1 1 3 1 1 2 0 1 4 0 1 3 0 1 2 0 1 4 0 1 3 1 1 3 0 2 2 0 2 >table(data1) tr = 1 y x

Re: [R] ask for help on nonlinear fitting

2008-03-08 Thread Dieter Menne
Ruqiang Liang gmail.com> writes: > > I have a table like the following. I want to fit Cm to Vm like this: > Cm ~Cl+Q1*b1*38.67*exp(-b1*(Vm-Vp1)*0.03867)/(1+exp(-b1*(Vm-Vp1)*0.03867))^2+ Q2*b2*38.67*exp(-b2*(Vm-Vp2)*0.03867)/(1+exp(-b2*(Vm-Vp2)*0.03867))^2 > > I use nls, with start=list(Q1=2e-3,

[R] ask for help on nonlinear fitting

2008-03-07 Thread Ruqiang Liang
I have a table like the following. I want to fit Cm to Vm like this: Cm ~ Cl+Q1*b1*38.67*exp(-b1*(Vm-Vp1)*0.03867)/(1+exp(-b1*(Vm-Vp1)*0.03867))^2+Q2*b2*38.67*exp(-b2*(Vm-Vp2)*0.03867)/(1+exp(-b2*(Vm-Vp2)*0.03867))^2 I use nls, with start=list(Q1=2e-3, b1=1, Vp1=-25, Q2=3e-3, b2=1, Vp2=200). But