Re: [R] Conditional recoding for purpose of imputing

2014-02-10 Thread Yvan Richard
The idea behind the treatment of NAs is that if you don't know what the value is, how do you know if it's 1 or not (in your case)? Therefore, it's normal that the result to your query is NA. First, I guess your command was supposed to be: y - ifelse(x==1, 'NO', 'YES') Secondly, if you want to

[R] model specification issue

2014-02-10 Thread Miles O'Brien
Hi all, I'm reviewing a paper and ran into a mystery (hopefully not to you) trying to reproduce the stats. The authors uploaded their data to a repository. I've created a similar (though random) data set for confidentiality reasons. So the authors include one four-level treatment variable, but

[R] Which distribution to select (massive fitting)

2014-02-10 Thread Alaios
Hi all, I have a large number of measurements from which I select a large number of unique vectors. For each vectors I would like to test which distribution might be a candidate for fitting. It is impossible to look on each vector separately but I can inside a for loop test different models and

[R] lattice question: removing strips

2014-02-10 Thread Martin Ivanov
Dear lattice users, I am trying to produce a lattice graph with two conditioning variables. My problem is that I only want to show the strips for the levels of the second conditioning variable. I want to remove the strips for the levels of the first conditioning variable. I tried with the strip

Re: [R] lattice question: removing strips

2014-02-10 Thread Pascal Oettli
Hello, Please provide a commented, minimal, self-contained, reproducible code, as requested. Regards, Pascal On 10 February 2014 19:48, Martin Ivanov tra...@abv.bg wrote: Dear lattice users, I am trying to produce a lattice graph with two conditioning variables. My problem is that I only

Re: [R] lattice question: removing strips

2014-02-10 Thread Martin Ivanov
Dear Pascal, Thank You very much for Your reply. Here is a minimal working example: library(lattice); # this is with both strips plotted: data - data.frame(x=1:5, y=6:10, f1=c(a1, a1, a1, a2, a3), f2=c(b1, b2, b2, b1, b2)); p - xyplot(y ~ x | f1 + f2, data=data) print(p); # and this is my

Re: [R] lattice question: removing strips

2014-02-10 Thread Duncan Mackay
Hi Martin If you only had 1 strip then strip = FALSE would suffice. With 2 I think you are getting into the realm of strip.default because of the first 2 arguments strip.default(which.given, which.panel, ) and having to modify it An easy solution is library(latticeExtra)

Re: [R] Two x axes - top and bottom

2014-02-10 Thread Duncan Mackay
And for the lattice solution see ? lattice::print.trellis Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: r-help-boun...@r-project.org

[R] Problem with metaMDS in vegan

2014-02-10 Thread Fabian B
Hello, I am relatively new to vegan and need some help with metaMDS. My R is Version 3.0.2. I am analysing cuticular profiles of flys from different locations an different gender. My data is in a 48 x 70 matrix. It is about percentages and so, there are a lot of 0s included. If I run metaMDS, it

[R] reversing data axis in stripchart not working?

2014-02-10 Thread Hermann Schier
Hi, I tried to reverse the data axis in stripchart which should work according to docu with xlim = c(Hi, Lo) but it did not work. Same effect in DotPlot from lessR. Any there work arounds or hints? Thanks Hermann example: x - stats::rnorm(50) stripchart(x) # setting limits works

Re: [R] meaning of lubridate setdiff

2014-02-10 Thread Garrett Grolemund
Dan, That's a bug in setdiff. I've fixed it in the development version of lubridate at http://github.com/hadley/lubridate. Thank you for finding it. setdiff *does* intend to trap the two interval result and return an error. The part of the visit where Chris is *not* there would be

Re: [R] Which distribution to select (massive fitting)

2014-02-10 Thread Bert Gunter
I believe this is more a question for SO (stats.stackexchange.com). There are many possible goodness of fit statistics that can easily be calculated in R, but I think the fundamental question is: To what end? First, there are probably several parametric distributions that give (essentially)

Re: [R] Legend text populated with calculated values and super script?

2014-02-10 Thread Douglas M. Hultstrand
Thanks everyone for the help. Dennis, the bquote version work great. Thanks, Doug On 2/7/2014 7:08 PM, Dennis Murphy wrote: Here's a bquote version: x=c(1,2,3,4); y=c(1,2,3,4); z=c(1.25,1.5,2.5,3.5) # first stats based on data, used to populate legend wdt_n = 50; wdt_mbias = 0.58 wdt_mae =

Re: [R] Problem with metaMDS in vegan

2014-02-10 Thread David Carlson
Without more information, it is hard to say. You did not tell us much about the data beyond the dimensions, but it looks like you have several different kinds of measurements including location and gender (probably categorical) and cuticular profiles (presumably numeric). Without the commands

Re: [R] reversing data axis in stripchart not working?

2014-02-10 Thread David Carlson
You are correct, but I do not know why stripplot works differently from plot. I can give you two ways to get around the problem though. The easiest is to use the plot command to emulate stripchart: plot(x, rep(1, length(x)), xlim=c(2, -2), yaxt=n, ylab=, pch=0) Or using stripchart:

[R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Michael Friendly
With data like the following, a frequency table in data frame form, I'd like to fit a collection of loglm models of independence of ~ attitude + memory for each combination of education and age. I can use apply() if I first convert the data to a 2 x 2 x 3 x 3 array, but I can't figure out an

Re: [R] Help

2014-02-10 Thread arun
Hi,  set.seed(42) mat1 - matrix(sample(40,5*3,replace=TRUE),ncol=3) mat2 - apply(mat1,1,sort,decreasing=TRUE)  mat2[1,]- mat2[2,] A.K. Thank you. And if I have a lot of rows? How can I apply this for row? On Sunday, February 9, 2014 8:20 PM, arun smartpink...@yahoo.com wrote: Based

Re: [R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Bert Gunter
Perhaps: ?tapply and/or various wrappers like ?by . Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Mon, Feb 10, 2014 at 8:05 AM, Michael Friendly

[R] Split dataframe by year

2014-02-10 Thread Zilefac Elvis
Hi, I have a dataframe in R and would like to split the data (1900-1980) into two sets. For example, one dataframe should have data from 1900-1960 and the other from 1961-1980. Thanks for your help. AT. [[alternative HTML version deleted]] __

Re: [R] Split dataframe by year

2014-02-10 Thread Rich Shepard
On Mon, 10 Feb 2014, Zilefac Elvis wrote: I have a dataframe in R and would like to split the data (1900-1980) into two sets. For example, one dataframe should have data from 1900-1960 and the other from 1961-1980. If you want two separate dataframes (while leaving the original), subset()

Re: [R] Split dataframe by year

2014-02-10 Thread Jeff Newmiller
Suggestions: Read the posting guide mentioned at the bottom of this email. Note request to post in plain text and provide reproducible example. Knowing how your data are constructed allows us to make more concrete suggestions as to how Rio solve your problem. Read help files: ?%in%, ?subset,

Re: [R] Problem with metaMDS in vegan

2014-02-10 Thread Fabian B
Thanks for the fast response! My data is actually just the percentages of the substances found in the cuticular layer of the flies. The quantitative and qualitative composition of this layer differs in gender, locality and so on. My 70 „species“ are the chemical compounds we identified and my 48

[R] eutils query not working

2014-02-10 Thread email
Hi: I am running the following code to query Pubmed database, but getting the error couldn't connect to host. library(RCurl) library(XML) library(tm) url - http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?; q - db=pubmedterm=saunders+nf[au]usehistory=y esearch -

[R] How to write a regression model for finding the radius of a cylinder given height and volume

2014-02-10 Thread nivek
Hello, I’m new to R and I’m trying to solve a simple problem for finding the radius of a cylinder given the height and volume. I’ve included the data file where the height in cm is column 2 and volume is in column 1. I know the equation needed is r= √(V/H(3.14)). My question is how do I code this

Re: [R] fitting structured conditional (subset) models with loglm

2014-02-10 Thread Michael Friendly
On 2/10/2014 11:12 AM, Bert Gunter wrote: Perhaps: ?tapply and/or various wrappers like ?by . Cheers, Bert Thanks, Bert The examples for ?by gave the answer I was looking for: # using by() mods - with(Punishment, by(Punishment, list(age, education), function(x)

Re: [R] Trouble with pmvnorm?

2014-02-10 Thread peter dalgaard
On 09 Feb 2014, at 10:56 , Paul Parsons pparsons...@gmail.com wrote: Many thanks, Peter. Creating a wrapper function for integrand using Vectorize, and then integrating the wrapper, does indeed solve the problem. I tried your final suggestion, but the variable x still gets passed into

Re: [R] Problem with metaMDS in vegan

2014-02-10 Thread David Carlson
A reproducible example would help. Look at the example in metaMDS using the dune data set. It consists of 20 observations (sites) with 30 species observed (columns). You indicate that your compounds (species) are the rows and your sites are the columns. So perhaps you are analyzing the

Re: [R] How to write a regression model for finding the radius of a cylinder given height and volume

2014-02-10 Thread David Carlson
We have a policy of not doing your homework for you, but I can point you to a valuable resource for learning R http://cran.r-project.org/doc/contrib/Paradis-rdebuts_en.pdf. Your problem involves simple arithmetic. There is no regression problem unless you are trying to predict height from

[R] Help with SEM: Error in 1:m : NA/NaN argument

2014-02-10 Thread AnnalisaStacchini
Hi, I am trying to fit a SEM model (the ram specification of the model, along with the estimated polycoric VCmatrix (CC32), is attacched), but I get the following error message: Error in 1:m : NA/NaN argumentI did not find any help on internet, so I tried to understend what is going wrong

[R] Regression Modeling Strategies 4-Day Short Course March 2014

2014-02-10 Thread Frank Harrell
My yearly Regression Modeling Strategies course is expanded to 4 days this year to be able relax the pace a bit. Details are below. Questions welcomed. - *RMS Short Course 2014* Frank E. Harrell, Jr., Ph.D., Professor and Chair

[R] stats course

2014-02-10 Thread Highland Statistics Ltd
We would like to announce the following statistics course: Topic: Data exploration, linear regression, GLM GAM in R. With introduction to R. Where: Aston University. Birmingham, UK When: 12-16 May, 2014 Info: http://www.highstat.com/statscourse.htm Flyer:

Re: [R] Exclude lines in based in multiple strings

2014-02-10 Thread arun
Hi, Try: ##Assuming X and Y are matrices (as stated) Y[!Y %in% X,,drop=FALSE] #     numberall #[1,] gen3   #[2,] gen4   #[3,] genx4   A.K. I would like to exclude entire lines in matrix Y based in 2 collumns in matrix X: Matrix X:   number1  number2    gen1     genx1      gen1    

[R] svyglm error message

2014-02-10 Thread Claire Wladis
Hello, I am using the survey package for the first time to analyze a dataset that has both weights and 200 BRR replication weights. When I try to run svyglm on the output from svrepdesign, I get an error message that I do not know how to interpret, and an extended period of time searching for

Re: [R] raster package: OpenStreetMap broken on Ubuntu, works on Mac

2014-02-10 Thread Hillary Sanders
i.e. remove.packaghttp://127.0.0.1:16060/help/library/utils/help/remove.packages es('raster') install.packages('raster') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] raster package: OpenStreetMap broken on Ubuntu, works on Mac

2014-02-10 Thread Hillary Sanders
Hey all, I uninstalled and then reinstalled raster, and the problem fixed itself. Cheers __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] Which distribution to select (massive fitting)

2014-02-10 Thread David Winsemius
On Feb 10, 2014, at 6:34 AM, Bert Gunter wrote: I believe this is more a question for SO (stats.stackexchange.com). Actually it might get closed on SO since it is not an R programming question per se but rather an advice for statistical approach. It's a better fit for CrossValidated.com

[R] rpart - Export rpart object branch splits

2014-02-10 Thread Jared Stabach
I am trying to export the tree splitting results from a rpart object. I can visualize the splits by printing the rpart object (shown below for my rpart object, model.prune). However, this printed result is not a dataframe and I am unable to export this information in .csv format. I can view the

Re: [R] Which distribution to select (massive fitting)

2014-02-10 Thread Bert Gunter
My mistake. I gave the right URL but referred to it as SO instead of CV. Gotta get my nomenclature right! Bert On Feb 10, 2014, at 3:32 PM, David Winsemius dwinsem...@comcast.net wrote: On Feb 10, 2014, at 6:34 AM, Bert Gunter wrote: I believe this is more a question for SO

[R] sensuc function in rms package

2014-02-10 Thread Nathan Pace
Hi All, I¹m using the twang package to estimate ATE propensity scores. These are being used (inverse probability weighting) in a Cox model estimated by cph in the rms package with cluster(id) set. I set options to include a datadist object before running cph. I want to check for sensitivity to

Re: [R] Dividing by NA?

2014-02-10 Thread arun
Hi, dat - read.table(text=A B   1 0  2 2  3 1  4 NA,sep=,header=TRUE)   within(dat,{C-A/B;C[!is.finite(C)]-0}) #  within(dat,{C-A/B;C[!is.finite(C)]-NA}) A.K. Hi R users, Just wondering is it possible to divide two columns with some NA or Zero values?  E.g.:

[R] building a package

2014-02-10 Thread Cathy Lee Gierke
Hi, I'm building a package in R and not able to find key information for a couple of things. 1. I have a .png graphic that the R code uses in print-outs it creates. What is the appropriate folder, or manner to incorporate a .png into the package? 2. I have two .txt data files I want

[R] hepl

2014-02-10 Thread Amaleswara Rao
Hi, This is My Dataset Requriment. If Possible To solve This Task. Please send reply I Have Take 3 Numeric Values 1.Is Age 2.Is Income 3.Is Cast If We Have To Arranged In Order Is Age Income Cast 15 15000 5000 18 12000 4500 20 16000 6000 25 22000 11000 28 11000 6000 30

Re: [R] How to write a regression model for finding the radius of a cylinder given height and volume

2014-02-10 Thread nivek
Thank you for your help. This is not homework however and my difficulty is in the fact that i cannot figure out how the declare a variable for the height or the volume given a data set where the matrix is already formed. I have looked on many sites for the is answer and it seems like it would be

Re: [R] how can i count appearence of zero?

2014-02-10 Thread arun
Hi, Try dat1- as.matrix(read.table(text=V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11   6  6  6  6  6  0  0  0  0   0   0   5  5  5  5  5  5  5  5  5   5   5   1  0  0  0  0  0  0  0  0   0   0   5  5  5  0  0  0  0  0  0   0   0   6  8 11  0  9  0  0  0  0   0   0   2  0  0  2  0  0  0  0  0   2