Re: [R] 2 x 3 Probability under the null

2011-10-26 Thread Ted Harding
On 27-Oct-11 04:09:46, Jim Silverton wrote: > I have a 2 x 3 matrix called snp and I want to compute the following > probability: > > choose(sum(snp[,1]), snp[1,1]) * choose(sum(snp[,2]), snp[1,2]) * > choose(sum(snp[,3]), snp[1,3])/choose(sum(snp), sum(snp[1,])) > > but I keep getting Infs and N

Re: [R] R v2.13.2 - Cannot find Rcmd on path?

2011-10-26 Thread Prof Brian Ripley
On Wed, 26 Oct 2011, jack306 wrote: I have the same problem. I was not able to find RCMD on path after I updated to R 2.13.2. My computer runs win xp professional. What 'same problem'? (The posting guide asked you to retain suffiicent context.) Installing R does not put Rcmd.exe on the PATH

Re: [R] help with paste

2011-10-26 Thread Joshua Wiley
Hi Sharad, See ?paste, particularly the 'collapse' argument: > mols=c("LEPTIN","SAA","PTH","sEGFR") > paste(mols[1:3], collapse = " + ") [1] "LEPTIN + SAA + PTH" If this is going to ultimately end up in regression (my spidey sense is tingling), the follow up question you will have is something l

Re: [R] Consistant test for NAs in a factor when exclude = NULL?

2011-10-26 Thread Jeff Newmiller
I think you might find, like me, that working with your data in character string form until you get it qc'd will be much easier to analyze. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live

Re: [R] survival: fitting equation to survival curve?

2011-10-26 Thread Joshua Wiley
On Wed, Oct 26, 2011 at 2:37 PM, Lancaster, Robert (Orbitz) wrote: > I was able to resolve my issue.  I assumed my survival rates followed an > exponential, so took the log of them and fit the resulting values to a linear > model. > > Would survreg allow me skip this step?  I'm a newbie to the s

Re: [R] dotPlot with diagonal

2011-10-26 Thread 1Rnwb
is this what you are looking for library(lattice) (Seq <- matrix(c(1, 1, 6, 1, 2, 2, 5, 4, 3, 3, 4, 3, 4, 4, 3, 2, 5, 5, 2, 5, 6, 6, 1, 6), ncol = 6)) plot(Seq[1,], Seq[2,], main = "Sequenz 1 und Sequenz 2", asp = 1) abline(a=0,b=1,col='red',lwd=2) -- View this message in context: http://r.789

Re: [R] R v2.13.2 - Cannot find Rcmd on path?

2011-10-26 Thread jack306
I have the same problem. I was not able to find RCMD on path after I updated to R 2.13.2. My computer runs win xp professional. Jixiang Wu -- View this message in context: http://r.789695.n4.nabble.com/R-v2-13-2-Cannot-find-Rcmd-on-path-tp3927126p3943082.html Sent from the R help mailing list ar

[R] help with paste

2011-10-26 Thread 1Rnwb
Hello gurus, I have some variables, and i am creating combinations for analysis in the end i need these variables to be displayed like "LEPTIN+SAA+PTH". currently i am using loop to perform this. I would appreciate any pointers to do it without the loop. > mols=c("LEPTIN","SAA","PTH","sEGFR") > s

Re: [R] importing large dataset

2011-10-26 Thread ManuelS
Hey The size doesnt matter - so far. What your looking for is /read.csv()/ or /read.csv2()/ A simple exemple would look like this: name <- read.csv2("C:/blablabla.../filename.csv", header=TRUE, sep=";", dec=".", na.strings="NA") header = TRUE leaves a row for columne titles (i suppose ur column

Re: [R] survival: fitting equation to survival curve?

2011-10-26 Thread Lancaster, Robert (Orbitz)
I was able to resolve my issue. I assumed my survival rates followed an exponential, so took the log of them and fit the resulting values to a linear model. Would survreg allow me skip this step? I'm a newbie to the survival package so am not very familiar with its capabilities. -Origina

[R] Using functions written in Fortran in R

2011-10-26 Thread John Sorkin
Windows XP R 2.12 I am trying to understand how I can take a subroutine (i.e. function) I have written in Fortran, and call the function in R. I need to know (1) where I should store the Fortran subroutine (2) how to prepare the function for use in R, and (3) how to load and call the function.

Re: [R] Consistant test for NAs in a factor when exclude = NULL?

2011-10-26 Thread andrewH
Thanks Jeff! I appreciate you sharing your experience. My data set is survey data, 13,209 records over nine years, collected by someone else, converted from SPSS format. It includes missing values, identified however SPSS does so, and translated to NAs by the import process. It also includes value

Re: [R] 2 x 3 Probability under the null

2011-10-26 Thread Jim Silverton
I have a 2 x 3 matrix called snp and I want to compute the following probability: choose(sum(snp[,1]), snp[1,1]) * choose(sum(snp[,2]), snp[1,2]) * choose(sum(snp[,3]), snp[1,3])/choose(sum(snp), sum(snp[1,])) but I keep getting Infs and NaNs. Is there a function that can do this in R? -- Tha

Re: [R] Consistant test for NAs in a factor when exclude = NULL?

2011-10-26 Thread Jeff Newmiller
There is a difference between the levels of a factor and the values in the vector. If you make NA one of the levels then it will use an integer to represent that level in the data just like any other level. At that point it seems to me that you can do meta analysis on the existence of NA in the

Re: [R] Question about .Fortran in glmnet package

2011-10-26 Thread R. Michael Weylandt
It's probably available at CRAN by downloading the package source here: http://cran.r-project.org/web/packages/glmnet/index.html Look in the /src/ directory. Michael On Wed, Oct 26, 2011 at 9:42 PM, Axel Urbiz wrote: > Hi, > > My apologies for asking this question, but could not find the answer

[R] Question about .Fortran in glmnet package

2011-10-26 Thread Axel Urbiz
Hi, My apologies for asking this question, but could not find the answer elsewhere. I understand the glmnet package uses Fortran code. For example, the lognet.R file includes the lines of code shown below. But how can I see the Fortran code that is being referenced in the code below? Is that provi

[R] Consistant test for NAs in a factor when exclude = NULL?

2011-10-26 Thread andrewH
Dear folks? Is there a function to correctly find (and count) the NAs in a factor when exclude=NULL, regardless of whether their origin is in the original data or by subsequent assignment? In example number 1 below, where NAs are assigned by is.na()<-, testing the factor with is.na() finds the co

Re: [R] Webscraping - How to Scrape Out Text Into R As If Copied & Pasted From Webpage?

2011-10-26 Thread Henrique Dallazuanna
Use XPATH query: web.pg <- htmlTreeParse(file=web.pg, ignoreBlanks=TRUE, useInternalNodes = TRUE) # Job title xpathApply(web.pg, "//span[@class='normal']//b", xmlValue) On Wed, Oct 26, 2011 at 9:36 PM, Moser, Gary wrote: > Greetings, > > > > I am trying to get all of the text from a web page as

[R] Webscraping - How to Scrape Out Text Into R As If Copied & Pasted From Webpage?

2011-10-26 Thread Moser, Gary
Greetings, I am trying to get all of the text from a web page as if I "selected all" on the page, pasted into a text file, and then read in the text file with read.csv(). # this is the actual page I'm trying to acquire text from: web.pg <- readLines("http://www.airweb.org/?page=574";)

Re: [R] SpatialLines

2011-10-26 Thread MacQueen, Don
In addition to which, R-sig-geo would be better place to ask. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 10/26/11 10:39 AM, "Duncan Murdoch" wrote: >On 26/10/2011 1:11 PM, Mark Newcomb wrote: >> I'm hoping to use R

Re: [R] Example(chron) doesn't work

2011-10-26 Thread hchui
It works with Rgui vanilla, R version 2.13.1. I'll check it again when I install R version 2.13.2. Many thanks! > "C:\\Program Files\\R\\R-2.13.1\\bin\\x64\\Rgui.exe --vanilla" [1] "C:\\Program Files\\R\\R-2.13.1\\bin\\x64\\Rgui.exe --vanilla" > library(chron) Warning message: package 'chron' wa

Re: [R] FOR loop with statistical analysis for microarray data

2011-10-26 Thread Weidong Gu
If you provide an example data (y1 and y2 in the loop), you might have got specific helps already. A few things in your loop seem suspicious. fc and pv are vectors, and in each loop you redesigned the whole vectors and specific indices twice. That may cause your problems. Weidong Gu On Wed, Oct

Re: [R] Where can I find cmeans {e1071} package?

2011-10-26 Thread Sarah Goslee
On Wed, Oct 26, 2011 at 6:40 PM, Rui Esteves wrote: > Hello, > > I need a Fuzzy C Means algorithm. > I found some documentation about cmeans  {e1071} at > http://rss.acs.unt.edu/Rdoc/library/e1071/html/cmeans.html > Does someone knows where I can find it? e1071 is a package, and you can use inst

[R] Where can I find cmeans {e1071} package?

2011-10-26 Thread Rui Esteves
Hello, I need a Fuzzy C Means algorithm. I found some documentation about cmeans {e1071} at http://rss.acs.unt.edu/Rdoc/library/e1071/html/cmeans.html Does someone knows where I can find it? Thank you Rui [[alternative HTML version deleted]]

Re: [R] Counting the number of marginals

2011-10-26 Thread Jim Silverton
Dear all, I have two matrices lets call them A and B. Each of which is a 100 x 3 matrix. What I do is take the corresponding row from each matrix and form 100 2 x 3 tables. If we call the column sums for each 2 x 3 n1, n2 and n3, I would like to compute the following probability: Basically the nu

Re: [R] FOR loop with statistical analysis for microarray data

2011-10-26 Thread David Winsemius
"affy" is a bioconductor package. You should be asking this question on the bioc mailing list. -- David. On Oct 26, 2011, at 4:56 PM, Seb wrote: hi all i started recently using R and i found myself stuck when i try to analyze microarray data. i use the "affy" package to obtain the intensit

Re: [R] Correlation Matrix in R

2011-10-26 Thread Mark Podolsky
Hi, rcor.test in library(ltm) will provide a correlation matrix with p-values on the bottom-half of the matrix. Mark On 2011-10-26, at 7:03 AM, AlexC wrote: > Thank you for your quick reply and helpful advice. > > Using this argument allows me to do what I needed to do > > Now the only othe

[R] FOR loop with statistical analysis for microarray data

2011-10-26 Thread Seb
hi all i started recently using R and i found myself stuck when i try to analyze microarray data. i use the "affy" package to obtain the intensities of the probes, i have two CTRs and two treated. HG.U133A.Experiment1.CEL HG.U133A.Experiment2.CEL HG.U133A_Control1.CEL HG.U133A_Control2.CEL 100

Re: [R] Extra Sums of Squares from an anova table - why are the values different?

2011-10-26 Thread Stephen Sefick
I was referring to the 3rd decimal place and beyond. Thanks that did the trick. I was trying to compare the two to make sure that I knew how to do it by hand. Thanks for all of your help. Stephen On Wed 26 Oct 2011 02:23:02 PM CDT, Joshua Wiley wrote: Hi Stephen, Thanks for the disclosur

[R] survival: fitting equation to survival curve?

2011-10-26 Thread Lancaster, Robert (Orbitz)
Given a survfit object, is it possible to fit an equation to the resulting survival curve? Is this possible? What about with a coxph or survreg object? TIA, Rob [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] Extra Sums of Squares from an anova table - why are the values different?

2011-10-26 Thread Joshua Wiley
Hi Stephen, Thanks for the disclosure. If you are referring to the difference in the third decimal place between your calculated F value and what R gives, yes, it is due to rounding. Try this: ## extract the mean squares from anova() and store in msq msq <- anova(x.lm)[, "Mean Sq"] mean(msq[4:

Re: [R] extract data for specific levels factor

2011-10-26 Thread Andrés Aragón
Dear all, Thanks for your help. Option of Sarah and Dan is just what I want: ff1<-mydata[mydata$cat%in%c(“wish1”, “wish2”, “wish3”),] Then I used ff1 in ggplot2 without problems. Option of Dennis (reshape2) does produced an output “no coherent”: content in he object contained data of categorical

[R] survival: fitting equation to survival curve?

2011-10-26 Thread Lancaster, Robert (Orbitz)
Given a survfit object, is it possible to fit an equation to the resulting survival curve? What about with a coxph or survreg object? TIA, Rob [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

Re: [R] Correlation Matrix in R

2011-10-26 Thread William Revelle
Alex, corr.test in psych will give you a matrix of correlations, a matrix of sample sizes, and a matrix of probabilities. You can combine the correlations and the probabilities to form what you want: try the following: > library(psych) > examp <- corr.test(sat.act) > mat.c.p <- lower.tri(exa

[R] Extra Sums of Squares from an anova table - why are the values different?

2011-10-26 Thread Stephen Sefick
#For full disclosure- I am working on a homework problem. However, my question revolves around computer rounding, I think. x <- (structure(list(y = c(0.222, 0.395, 0.422, 0.437, 0.428, 0.467, 0.444, 0.378, 0.494, 0.456, 0.452, 0.112, 0.432, 0.101, 0.232, 0.306, 0.0923, 0.116, 0.0764, 0.439, 0.

Re: [R] Plot complete dataset

2011-10-26 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of RMSOPS > Sent: Wednesday, October 26, 2011 9:59 AM > To: r-help@r-project.org > Subject: [R] Plot complete dataset > > > Hello, > > I am a new user of R, so I still have s

Re: [R] Logistic Regression - Variable Selection Methods With Prediction

2011-10-26 Thread Marc Schwartz
The reason that you are not likely getting replies is that what you propose to do is considered a poor way of building models. You need to get out of the "SAS Mindset". I would suggest you obtain a copy of Frank Harrell's book: http://www.amazon.com/exec/obidos/ASIN/0387952322/ and then con

Re: [R] Logistic Regression - Variable Selection Methods With Prediction

2011-10-26 Thread Bert Gunter
You mean the glm() _function_ in the stats package. ?glm (just to avoid confusion) -- Bert On Wed, Oct 26, 2011 at 10:31 AM, wrote: > Try the glm package > > Steve Friedman Ph. D. > Ecologist / Spatial Statistical Analyst > Everglades and Dry Tortugas National Park > 950 N Krome Ave (3rd Fl

Re: [R] Logistic Regression - Variable Selection Methods With Prediction

2011-10-26 Thread Weidong Gu
Check glmulti package for all subset selection. Weidong Gu On Wed, Oct 26, 2011 at 12:35 PM, RAJ wrote: > Can I atleast get help with what pacakge to use for logistic > regression with all possible models and do prediction. I know i can > use regsubsets but i am not sure if it has any prediction

Re: [R] Logistic Regression - Variable Selection Methods With Prediction

2011-10-26 Thread Steve Lianoglou
Hi, On Wed, Oct 26, 2011 at 12:35 PM, RAJ wrote: > Can I atleast get help with what pacakge to use for logistic > regression with all possible models and do prediction. I know i can > use regsubsets but i am not sure if it has any prediction functions to > go with it. Maybe you could try glmnet

Re: [R] SpatialLines

2011-10-26 Thread Duncan Murdoch
On 26/10/2011 1:11 PM, Mark Newcomb wrote: I'm hoping to use R for spatial analysis. In working through examples in Chapt. 4 of Applied Spatial Data Analysis with R I've come across the following error in trying to plot lines with the meuse data set. The text is verbatim from the book. > m

Re: [R] Logistic Regression - Variable Selection Methods With Prediction

2011-10-26 Thread Steve_Friedman
Try the glm package Steve Friedman Ph. D. Ecologist / Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 __

Re: [R] sometimes removing NAs from code

2011-10-26 Thread Schatzi
Thank you for the help and explanations. I used the "complete.cases" function and it is working great. adata[complete.cases(adata[,1:2]),] - In theory, practice and theory are the same. In practice, they are not - Albert Einstein -- View this message in context: http://r.789695.n4.nabble.

[R] Plot complete dataset

2011-10-26 Thread RMSOPS
Hello, I am a new user of R, so I still have some basic difficulties. I'm trying to create a bar graph completely from reading a file. The idea was on the x axis have the columns of the table Married ,Single,Divorced, widower the legend Ages 18-34 35-45 46-64 65-69 70-74 the dataset

[R] Guidance with PCA and Regression using complex categorical variables

2011-10-26 Thread sean st.clair
Hello. I need some guidance. I would like to run PCA and regression, and my predictor variables are mainly complex categorical variables (hundred's of levels for some of them). What packages and functions are useful for this? THanks. sean __ R-help@r

Re: [R] Logistic Regression - Variable Selection Methods With Prediction

2011-10-26 Thread RAJ
Can I atleast get help with what pacakge to use for logistic regression with all possible models and do prediction. I know i can use regsubsets but i am not sure if it has any prediction functions to go with it. Thanks On Oct 25, 6:54 pm, RAJ wrote: > Hello, > > I am pretty new to R, I have alwa

[R] SpatialLines

2011-10-26 Thread Mark Newcomb
I'm hoping to use R for spatial analysis. In working through examples in Chapt. 4 of Applied Spatial Data Analysis with R I've come across the following error in trying to plot lines with the meuse data set. The text is verbatim from the book. > m.sl <- SpatialLines(list(Lines(list(Line(cc)))

Re: [R] lock a package to specific R version

2011-10-26 Thread Uwe Ligges
On 26.10.2011 15:12, Mehmet Suzen wrote: -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: 26 October 2011 10:12 To: Uwe Ligges Cc: Mehmet Suzen; r-help@r-project.org Subject: Re: [R] lock a package to specific R version On Wed, 26 Oct 2011, Uwe Ligges wro

[R] help with means using tail()

2011-10-26 Thread Iara Faria
Hi all,   I have 5 series  (5 ts objects: rp, igpm, ereal, jurosreal, crescpib), and want to create a vector with the means of the last values of each variable. What I did was this:   mrp1<-mean(tail(rp,9)) migpm1<-mean(tail(igpm,9)) mereal1<-mean(tail(ereal,9)) mjr1<-mean(tail(jurosreal,9)) mcp1<

Re: [R] Want to exclude axis numbering in plot.ca

2011-10-26 Thread R. Michael Weylandt
I don't know what plot.ca is (it's not in base and you gave no package citation), but the usual way is to add xaxt = "n" to a plot call. Assuming plot.ca is an appropriately defined generic, this should work. E.g., layout(1:2) plot(1:5) plot(1:5, xaxt = "n") Michael On Wed, Oct 26, 2011 at 3:59

Re: [R] Creating data frame with residuals of a data frame

2011-10-26 Thread jim holtman
try this: > age<- c(5,6,10,14,16,NA,18) > value1<- c(30,70,40,50,NA,NA,NA) > value2<- c(2,4,1,4,4,4,4) > df<- data.frame(age, value1, value2) > > #Run linear regression to adjust for age and get residuals: > > lm_f <- function(x) { + x<- residuals(lm(data=df, formula= x ~ age)) + } > resid <- appl

Re: [R] sometimes removing NAs from code

2011-10-26 Thread William Dunlap
Instead of d[-which(condition)] use d[!condition] where 'condition' is a logical vector. which(condition) returns integer(0) (an integer vector of length 0) if there are no TRUEs in 'condition'. -integer(0) is identical to integer(0) and d[integer(0)] means to select zero elements from d. !

Re: [R] sometimes removing NAs from code

2011-10-26 Thread Sarah Goslee
Hi, On Wed, Oct 26, 2011 at 11:25 AM, Schatzi wrote: > Sometimes I have NA values within specific columns of a dataframe (in this > example, the first two columns can have NAs). If there are NA values, I > would like them to be removed. > > I have been using the code: > > y<-c(NA,5,4,2,5,6,NA) >

Re: [R] sometimes removing NAs from code

2011-10-26 Thread Marc Schwartz
On Oct 26, 2011, at 10:25 AM, Schatzi wrote: > Sometimes I have NA values within specific columns of a dataframe (in this > example, the first two columns can have NAs). If there are NA values, I > would like them to be removed. > > I have been using the code: > > y<-c(NA,5,4,2,5,6,NA) > z<-c(NA

Re: [R] sometimes removing NAs from code

2011-10-26 Thread jim holtman
?complete.cases > y<-c(NA,5,4,2,5,6,NA) > z<-c(NA,3,4,NA,1,3,7) > x<-1:7 > adata<-data.frame(y,z,x) > adata y z x 1 NA NA 1 2 5 3 2 3 4 4 3 4 2 NA 4 5 5 1 5 6 6 3 6 7 NA 7 7 > adata[complete.cases(adata),] y z x 2 5 3 2 3 4 4 3 5 5 1 5 6 6 3 6 On Wed, Oct 26, 2011 at 11:25 AM, Sc

Re: [R] sometimes removing NAs from code

2011-10-26 Thread Natalie Van Zuydam
Hi, Why don't you give subset a try: adata <- subset(adata, is.na(z)==FALSE&is.na(y)==FALSE) I'm not sure if you want to use AND or OR for this statement. Best wishes, Natalie On 26/10/2011 16:25, Schatzi wrote: Sometimes I have NA values within specific columns of a dataframe (in this exampl

Re: [R] Power mixed model ordinal logistic regression

2011-10-26 Thread Marc Schwartz
On Oct 26, 2011, at 8:57 AM, Scott Raynaud wrote: > Is there a package that will perform power calculations for mixed model > ordinal logistic regression? I searched an came up with nothing. I am not sure that there is a canned package or function that will do that. More than likely, you wil

Re: [R] dotPlot with diagonal

2011-10-26 Thread David L Carlson
Try again. There is no dotPlot() function in lattice and dotplot() does not take two separate rows so the example you gave us generates an error message if dotPlot is changed to dotplot. -- David L Carlson Associate Professor of Anthropology Texas A&M

[R] Using abline in lattice

2011-10-26 Thread weiflo
Dear all, being a relative beginner in R, I apologize for posting the second question within two days. So I want a stacked barchart, which should look like the one produced by this code: Tuvalu <- c(9,3,4,0,3,0,0) Singapor <- c(38,0,0,0,12,19,0) Samoa <- c(26,16,2,0,5,2,0) PNG <- c(56,4,0,5,2,0,5

Re: [R] Using abline in lattice

2011-10-26 Thread weiflo
Ups, sorry, just realized the first code is wrong, its one with a panel function already. The right code would be: Tuvalu <- c(9,3,4,0,3,0,0) Singapor <- c(38,0,0,0,12,19,0) Samoa <- c(26,16,2,0,5,2,0) PNG <- c(56,4,0,5,2,0,56) Micronesia <- c(6,0,0,0,0,0,0) graph4 <- data.frame(rbind(Tuvalu,Singa

[R] sometimes removing NAs from code

2011-10-26 Thread Schatzi
Sometimes I have NA values within specific columns of a dataframe (in this example, the first two columns can have NAs). If there are NA values, I would like them to be removed. I have been using the code: y<-c(NA,5,4,2,5,6,NA) z<-c(NA,3,4,NA,1,3,7) x<-1:7 adata<-data.frame(y,z,x) adata<-adata[-w

Re: [R] [BioC] comparing two tables

2011-10-26 Thread Steve Lianoglou
Hi Assa, On Wed, Oct 26, 2011 at 9:44 AM, Assa Yeroslaviz wrote: > Thanks Steve, > > I already did it and it went perfectly well. > > I was just trying to understand the functions David wrote, so that I can use > them maybe for other queries. > Unfortunately I wasn't able to add a condition for

Re: [R] merging two dataframes

2011-10-26 Thread Timothy Bates
So when I do the merge on your example frames, I get the expected result. But the example component dataframes you sent are already full of NAs, and there are no rows which are present in both data sets. So I think perhaps, that merge is just highlighting a problem that has its roots in your com

Re: [R] Building package/DESCRIPTION file not existing?

2011-10-26 Thread Francois Rousseu
Thanks to both of you. Indeed, it was a language issue. I eventually detected a check warning stating that the DESCRIPTION file had non-ASCII characters and unknown encoding, but no special characters were in the file. From reading various messages on mailing lists, I added Encoding: latin1 a

Re: [R] merging two dataframes

2011-10-26 Thread Petr PIKAL
> > Re: [R] merging two dataframes > > I pasted wrong function, I have changed from "date1" to "date" (ignore that). > I think it have to be something wrong with my data format. I can`t > understand why it don't work. I know I can use by.x= and by.y=, but > since both datasets have the

Re: [R] New column of data filled with the larger value from 2 columns

2011-10-26 Thread robgriffin247
data$C <- pmax(data$A,data$B) worked perfectly thank you very much -- View this message in context: http://r.789695.n4.nabble.com/New-column-of-data-filled-with-the-larger-value-from-2-columns-tp3940020p3940399.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Adding rows to a table with a loop

2011-10-26 Thread MJS
Thanks for the response, and the advice, glmulti looks like it could be quite a good alternative. As for the adding to the results table problem from within the loop, this webpage:

Re: [R] merging two dataframes

2011-10-26 Thread dividend
I pasted wrong function, I have changed from "date1" to "date" (ignore that). I think it have to be something wrong with my data format. I can`t understand why it don't work. I know I can use by.x= and by.y=, but since both datasets have the same variable name it should be unnecessary to do

Re: [R] Error in summary.mlm: formula not subsettable

2011-10-26 Thread Duncan Murdoch
On 26/10/2011 9:48 AM, Helios de Rosario wrote: When I fit a multivariate linear model, and the formula is defined outside the call to lm(), the method summary.mlm() fails. This works well: > y<- matrix(rnorm(20),nrow=10) > x<- matrix(rnorm(10)) > mod1<- lm(y~x) > summary(mod1) ... But this

Re: [R] Error in summary.mlm: formula not subsettable

2011-10-26 Thread Duncan Murdoch
On 26/10/2011 9:48 AM, Helios de Rosario wrote: When I fit a multivariate linear model, and the formula is defined outside the call to lm(), the method summary.mlm() fails. This works well: > y<- matrix(rnorm(20),nrow=10) > x<- matrix(rnorm(10)) > mod1<- lm(y~x) > summary(mod1) ... But this

[R] Power mixed model ordinal logistic regression

2011-10-26 Thread Scott Raynaud
Is there a package that will perform power calculations for mixed model ordinal logistic regression?  I searched an came up with nothing. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

[R] Error in summary.mlm: formula not subsettable

2011-10-26 Thread Helios de Rosario
When I fit a multivariate linear model, and the formula is defined outside the call to lm(), the method summary.mlm() fails. This works well: > y <- matrix(rnorm(20),nrow=10) > x <- matrix(rnorm(10)) > mod1 <- lm(y~x) > summary(mod1) ... But this does not: > f <- y~x > mod2 <- lm(f) > summary(mod

Re: [R] [BioC] comparing two tables

2011-10-26 Thread Assa Yeroslaviz
Thanks Steve, I already did it and it went perfectly well. I was just trying to understand the functions David wrote, so that I can use them maybe for other queries. Unfortunately I wasn't able to add a condition for the fact that there is a third parameter to be compared. I would still ove to k

Re: [R] merging two dataframes

2011-10-26 Thread Petr PIKAL
> > Hello. > > Now i tried to do what you told me. > I used the str(fuction), and data$date1 and data3$date1 where both listed You have no date1 only date. Therefore result<- merge(data, data3, by=c("date", "name"), all=T) takes all values from both data frames > dim(data) [1] 20 15 > dim(d

Re: [R] [BioC] comparing two tables

2011-10-26 Thread Steve Lianoglou
Hi, On Wed, Oct 26, 2011 at 8:17 AM, Assa Yeroslaviz wrote: > Hi David, > > your function works just fine if I take nly the region into account. But > unfortunately it does not consider the first column of the chromosomes. > There can be an overlap between the two tables only if the regions are o

Re: [R] dotPlot with diagonal

2011-10-26 Thread Jörg Reuter
Oh, sorry. library(lattice) (Seq <- matrix(c(1, 1, 6, 1, 2, 2, 5, 4, 3, 3, 4, 3, 4, 4, 3, 2, 5, 5, 2, 5, 6, 6, 1, 6), ncol = 6)) dotPlot(Seq[1,], Seq[2,], main = "Sequenz 1 und Sequenz 2", asp = 1) Is there a way to draw a small diagonal, begin at (0/0) to (6/6) (perhaps in red??) or must I use gi

Re: [R] lock a package to specific R version

2011-10-26 Thread Mehmet Suzen
>-Original Message- >From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] >Sent: 26 October 2011 10:12 >To: Uwe Ligges >Cc: Mehmet Suzen; r-help@r-project.org >Subject: Re: [R] lock a package to specific R version > >On Wed, 26 Oct 2011, Uwe Ligges wrote: > >> >> >> On 25.10.2011 11:42, M

Re: [R] dotPlot with diagonal

2011-10-26 Thread Dennis Murphy
Let's see: there is a dotPlot() function in each of the following packages: BHH2, caret, mosaic, qualityTools Would you be kind enough to share which of these packages (if any) you are using? Dennis On Wed, Oct 26, 2011 at 4:25 AM, Jörg Reuter wrote: > Hi, > I want draw a dotPlot. All works fine

Re: [R] RGtk2 problems

2011-10-26 Thread Michael Lawrence
The gain from updating will be that RGtk2 now looks in a specific (internal) place for the libraries, so you should no longer need to worry about library conflicts and PATH settings. In theory. Michael On Tue, Oct 25, 2011 at 5:46 PM, Aref wrote: > Thank you for the response and I am sorry abou

Re: [R] [BioC] comparing two tables

2011-10-26 Thread Assa Yeroslaviz
Hi David, your function works just fine if I take nly the region into account. But unfortunately it does not consider the first column of the chromosomes. There can be an overlap between the two tables only if the regions are on the same chromosome. This is why the first column of both tables is a

Re: [R] Random Forest Classification

2011-10-26 Thread Steve_Friedman
Explore the ModelMap package. It might offer some useful tools for your application. Steve Friedman Ph. D. Ecologist / Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax

Re: [R] merging two dataframes

2011-10-26 Thread Timothy Bates
I think you want something like this (I like to be explicit about what you are merging) df3 = merge(df1, df2, by = "date", all=T) You can be explicit about what you are merging on in each file: df3 = merge(df1,df2, by.x = "date”, by.y="date", all=T) You were trying to merge on “date1” but it l

Re: [R] Calculate the difference using ave

2011-10-26 Thread Dimitris Rizopoulos
Maybe one approach could be: set.seed(123) df1 <- data.frame(measure = rep(c("A1", "A2", "A3"), each=3), water = sample(c(100:200), 9), tide = sample(c(-10:+10), 9)) 100 * tail(df1$tide, -3) / head(df1$water, -3) I hope it helps. Best, Dimitris On 10/26/2011 12

Re: [R] New column of data filled with the larger value from 2 columns

2011-10-26 Thread Ben Bolker
robgriffin247 hotmail.com> writes: > > Hi, > I'm sure there is a pretty simple answer to this but I have had my head > buried in the R book and on help pages for a while now and I've not made any > progress. > > In simple terms: > I have 2 columns of data, column A and column B. I want to creat

Re: [R] set different font family for strings in mtext or text?

2011-10-26 Thread Prof Brian Ripley
On Wed, 26 Oct 2011, Jinsong Zhao wrote: Thank you very much for the quick reply. On 2011-10-26 18:24, Prof Brian Ripley wrote: See ?par: check the 'family' paramater. You can select 'family' for each call to mtext or text. Yes, I can select 'family' for each call to mtext or text. however,

[R] Calculate the difference using ave

2011-10-26 Thread Patrick Hausmann
Dear R users, It may be very simple but it is being difficult for me. I'd like to calculate the difference in percent between to measures. My data looks like this: set.seed(123) df1 <- data.frame(measure = rep(c("A1", "A2", "A3"), each=3), water = sample(c(100:200), 9),

Re: [R] Correlation Matrix in R

2011-10-26 Thread AlexC
Thank you for your quick reply and helpful advice. Using this argument allows me to do what I needed to do Now the only other thing I wanted to accomplish was to obtain the top half of the matrix with p values and the bottom half with the correlations, to observe the significant correlations. I

[R] New column of data filled with the larger value from 2 columns

2011-10-26 Thread robgriffin247
Hi, I'm sure there is a pretty simple answer to this but I have had my head buried in the R book and on help pages for a while now and I've not made any progress. In simple terms: I have 2 columns of data, column A and column B. I want to create a new column (C) and fill it with the largest value

Re: [R] merging two dataframes

2011-10-26 Thread dividend
Hello. Now i tried to do what you told me. I used the str(fuction), and data$date1 and data3$date1 where both listed "character". I changed "name" to character but it did not work either. I also changed all variables to character, with no positive result. str(data) 'data.frame': 14446 obs. of

Re: [R] Simulation from discrete uniform

2011-10-26 Thread Mehmet Suzen
Why don't you use sample; > sample(1:10,10,replace=TRUE) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of BSanders Sent: 26 October 2011 08:49 To: r-help@r-project.org Subject: Re: [R] Simulation from discrete uniform If you wanted

[R] dotPlot with diagonal

2011-10-26 Thread Jörg Reuter
Hi, I want draw a dotPlot. All works fine: (Seq <- matrix(c(1, 1, 6, 1, 2, 2, 5, 4, 3, 3, 4, 3, 4, 4, 3, 2, 5, 5, 2, 5, 6, 6, 1, 6), ncol = 6)) dotPlot(Seq[1,], Seq[2,], main = "Sequenz 1 und Sequenz 2", asp = 1) Is there a way to draw a small diagonal, begin at (0/0) to (6/6) (perhaps in red??) or

Re: [R] Example(chron) doesn't work

2011-10-26 Thread Gabor Grothendieck
On Wed, Oct 26, 2011 at 12:21 AM, hchui wrote: > Hi, there, > > I have a similar problem. The chron example gives NA. dates doesn't work but > times does. > > I would appreciate it if there's a fix for it. > > Thanks, > Helena > >> example(chron) > > chron> dts <- dates(c("02/27/92", "02/27/92", "

Re: [R] set different font family for strings in mtext or text?

2011-10-26 Thread Jinsong Zhao
Thank you very much for the quick reply. On 2011-10-26 18:24, Prof Brian Ripley wrote: See ?par: check the 'family' paramater. You can select 'family' for each call to mtext or text. Yes, I can select 'family' for each call to mtext or text. however, when it's necessary to put both Chinese an

Re: [R] strucchange Nyblom-Hansen Test?

2011-10-26 Thread Achim Zeileis
On Wed, 26 Oct 2011, buehlerman wrote: Thank you, things seem to be clearer :-) Great. Hansen extended this to the linear regression model and proposed to either compute one test statistic per parameter (which you can do with the "parm" argument of gefp) or a joint statistic for all paramete

Re: [R] difficulties with MuMIn model generation with coxph

2011-10-26 Thread Kamil Bartoń
Dear Sophie, The answer is 'typo'. 'dredge' does not have an argument named 'marge.ex'. k Dnia 2011-10-25 12:00, r-help-requ...@r-project.org pisze: Message: 131 Date: Mon, 24 Oct 2011 17:08:41 -0700 (PDT) From: sgilbert To:r-help@r-project.org Subject: [R] difficulties with MuMIn model gener

Re: [R] set different font family for strings in mtext or text?

2011-10-26 Thread Prof Brian Ripley
See ?par: check the 'family' paramater. You can select 'family' for each call to mtext or text. However, mixing families is rather ugly, and there are font families that cover both English and Chinese. Note that the main problem with postscript() and pdf() is the limited support in those lang

Re: [R] strucchange Nyblom-Hansen Test?

2011-10-26 Thread buehlerman
Thank you, things seem to be clearer :-) > Hansen extended this to the linear regression model and proposed to either > compute one test statistic per parameter (which you can do with the "parm" > argument of gefp) or a joint statistic for all parameters. Hansen included > in "all" parameters also

[R] set different font family for strings in mtext or text?

2011-10-26 Thread Jinsong Zhao
Hi there, Is it possible to set different font family for strings in mtext or text? For example, on windows platform with windows() device: plot(1:10, type = "n") text(5,5, "Chinese (English)") #Chinese for Chinese characters it will give the correct Chinese and English characters with two di

Re: [R] Help with a scatter plot

2011-10-26 Thread Dennis Murphy
Hi: The sort of thing you appear to want is fairly straightforward to in lattice and ggplot2, as both have ways to automate conditioning plots. Since you were looking at ggpot2, let's consider that problem. You don't really show enough data to provide a useful demonstration, but let's see if we ca

Re: [R] gam predictions with negbin model

2011-10-26 Thread Kari Ruohonen
On 26/10/11 12:10, Achim Zeileis wrote: On Wed, 26 Oct 2011, Kari Ruohonen wrote: Hi, I wonder if predict.gam is supposed to work with family=negbin() definition? It seems to me that the values returned by type="response" are far off the observed values. Here is an example output from the ne

  1   2   >