[R] trouble with \textless in Hmisc latex() on a drop1 object

2010-10-21 Thread Christopher W Ryan
Yes, it's homework . . . delete now if desired . . . but I think it is an interesting problem. Running R 2.11.1, LaTeX on WinXP, via Sweave. A drop1() object from a glm() produces, as part of its output, a string that looks like this: none The trouble I run into is that running latex() on a

Re: [R] Learning ANOVA

2010-08-13 Thread Christopher W Ryan
Read documentation for TukeyHSD by typing the command: ?TukeyHSD The input to that function should usually be, a fitted model object, usually an aov fit. You have not created a fitted model object. This seems to work: model - aov(InsectSprays$count ~ InsectSprays$spray) TukeyHSD(model) The

[R] OT: model diagnostics in the published literature

2010-09-09 Thread Christopher W. Ryan
This is a more general statiscal question, not specific to R: As I move through my masters curriculum in statistics, I am becoming more and more attuned to issues of model fit and diagnostics (graphical methods, AIC, BIC, deviance, etc.) As my regression professor always likes to say, only

Re: [R] R Founding

2010-09-16 Thread Christopher W. Ryan
I mailed a check for an R Foundation membership almost a year ago, along with the form. In US dollars, corrected by the then-current Euro exchange rate. It has never been cashed. Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street

Re: [R] R editor in ubuntu!

2010-10-05 Thread Christopher W Ryan
As an alternative to emacs-ess, you could try gedit with the R plugin. --Chris Ryan I am looking for an editor to be able to execute commands into R in Linux ubuntu. Is there any suggestion? [[alternative HTML version deleted]] __

[R] multiple car scatterplots on one graph

2010-10-14 Thread Christopher W Ryan
R version 2.11.1 on WinXP How do I get 3 scatterplots with marginal boxplots (from the car package) onto a single plot? I have a data frame called bank dim(bank) [1] 46 5 head(bank) x1x2 x3 x4 pop 1 -0.45 -0.41 1.09 0.45 0 2 -0.56 -0.31 1.51 0.16 0 3 0.06 0.02 1.01 0.40

[R] multiple car scatterplots on one graph--sorry for duplicate post--already solved

2010-10-14 Thread Christopher W Ryan
Apologies for the duplicate post. I'm caught between different misbehaving email clients on different computers at the moment. Didn't see my original post, nor Greg's reply, nor any evidence in my sent folder that my original message ever went out. I've got them now. --Chris Ryan On Thu, Oct 14,

Re: [R] managing data and removing lines

2010-04-16 Thread Christopher W. Ryan
Tara-- Welcome to R! Your questions could be answered from a variety of angles. I'd start by asking, where did the n/a's come from--they were in your text file, I assume, to represent missing data? If so, when you imported your data from that text file into R, those n/a's were considered

Re: [R] Adding new column variable to a existing spreadsheet

2010-04-23 Thread Christopher W Ryan
You should be aware that if you have read the data from your csv file into an object in R, generally nothing you do with that object in R will change your original csv file (this is generally a good thing), until/unless, you save or write something from R to that csv file (which is sometimes not a

Re: [R] Use of R in clinical trials

2010-02-18 Thread Christopher W. Ryan
? Or was there not such emphasis on and need for thorough data analysis back then? --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu If you want to build a ship, don't drum up the men to gather wood, divide

Re: [R] Use of R in clinical trials

2010-02-18 Thread Christopher W. Ryan
Anyone have any recollection of Prophet software, from the National (US) Center for Research Resources? --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu If you want to build a ship

[R] conditional coloring of output text in console or in GUI

2009-06-30 Thread Christopher W. Ryan
suppose I have some logical vector x - as.logical(c(0,0,0,1,0,0,1,1,0)) x How would I make the words TRUE appear on the screen in a different color from the words FALSE? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street

[R] xemacs and ess: keyboard shortcut for sending line to R

2009-06-30 Thread Christopher W. Ryan
, but Xemacs gives me error messages that these keys are not defined. Appreciate any advice. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu If you want to build a ship, don't drum up

[R] is a sequence of dates consecutive, without gaps?

2009-07-21 Thread Christopher W. Ryan
I have a long sequence of dates, about 6 years worth, as one column in a data frame. How can I test whether the sequence is consecutive, that is, without gaps? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City

Re: [R] is a sequence of dates consecutive, without gaps?

2009-07-21 Thread Christopher W. Ryan
Thanks, Phil and Marc; exactly what I needed! I didn't know about the diff function. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu If you want to build a ship, don't drum up the men

[R] stuck on making a line graph across time, with 4 categories

2008-06-26 Thread Christopher W. Ryan
/Workload.png Thank you. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build a ship, don't drum up the men

Re: [R] stuck on making a line graph across time, with 4 categories--SOLVED

2008-06-26 Thread Christopher W. Ryan
Ben-- worked perfectly. Thank you. My first real experience with lattice graphics. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com

[R] question about a small for loop

2008-07-14 Thread Christopher W. Ryan
} for (i in 2:6) { jaw$age.i - jaw$age^i } for (i in 2:6) { jaw$age.i - jaw$age^i } What is the proper syntax to create and name these variables all at once? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street

Re: [R] question about a small for loop

2008-07-14 Thread Christopher W. Ryan
Thank you to all for your ideas. They all solved my problem nicely. And I learned about paste() too! --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http

[R] OT: course in research administration

2008-07-24 Thread Christopher W. Ryan
online/distance learning? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build a ship, don't drum

[R] surveillance package useful for daily surveillance?

2009-06-09 Thread Christopher W. Ryan
’ April 19, 2009 Title Outbreak detection algorithms for surveillance data Version 1.0-2 Date 2009-05-03 Author M. Höhle with contributions from T. Correa, M. Hofmann, C. Lang, M. Paul, A. Riebler and V. Wimmer Thanks. -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus

[R] extracting items from R objects and using them in \Sexpr with Sweave--problem with $

2007-11-29 Thread Christopher W. Ryan
. Thank you. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build a ship, don't drum up the men to gather wood

[R] automatic exploration of all possible loglinear models?

2009-04-20 Thread Christopher W. Ryan
Is there a way to automate fitting and assessing loglinear models for several nominal variables . . . something akin to step or drop1 or add1 for linear or logistic regression? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch

Re: [R] automatic exploration of all possible loglinear models?

2009-04-21 Thread Christopher W. Ryan
in this case, it is a required ritual. We've gone over the dubious worth of the P-values in previous class discussions. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu If you want to build a ship

Re: [R] Staging area for data before read into R

2008-10-20 Thread Christopher W. Ryan
for task. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build a ship, don't drum up the men to gather wood, divide

Re: [R] Staging area for data before read into R

2008-10-21 Thread Christopher W. Ryan
this is also the sort of thing that EpiData does very well. That's what it was designed for: data entry with minimal errors. Also simplifies double data entry for error checking, if you need/want that. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus

[R] trying to figure out reorder.factor in gdata

2008-10-30 Thread Christopher W. Ryan
, new.order=c(Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday)) table(data$DischargeDayNew) Monday Tuesday Wednesday ThursdayFriday SaturdaySunday 0 0 0 0 0 0 0 -- Christopher W. Ryan, MD SUNY Upstate Medical University

Re: [R] trying to figure out reorder.factor in gdata--solved--silly--

2008-10-30 Thread Christopher W. Ryan
Original dataset used abbreviations for the day of week, while I was trying to use whole words :( Thanks anyway. Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http

[R] using Sweave with a master file that has several iputted .tex files

2009-01-27 Thread Christopher W. Ryan
} Some of the inputted files contain R code, enclosed in chunkname= and @. Several of them don't contain any R code. Can I compile the whole document with Sweave(Master.Rnw) ? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street

Re: [R] using Sweave with a master file that has several iputted .tex files

2009-01-27 Thread Christopher W. Ryan
. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build a ship, don't drum up the men to gather wood, divide

[R] problem using identify() after plot()

2009-01-30 Thread Christopher W. Ryan
31 16.5 20 32 16.5 19 33 9.0 4 34 9.5 4 35 7.0 1 36 8.0 4 37 8.5 13 38 18.5 13 39 9.0 9 40 11.0 1 41 4.0 7 42 11.5 26 43 3.5 12 44 8.5 12 45 10.0 15 46 11.0 5 Thanks --Chris -- Christopher W. Ryan, MD

Re: [R] cronbachs alpha - score.items(psych) vs reliability(Rcmdr)

2009-02-04 Thread Christopher W. Ryan
The item.total command in the multilevel package will give you what you want. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw

Re: [R] Off-topic -- an eye on a stats presentation for clinicians?

2008-12-31 Thread Christopher W. Ryan
I'd love to take a look at it. I run journal club for our family practice residents and have to do this all the time (with more or less success; often less, it seems.) --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY

Re: [R] finding yap.exe with Sweave

2008-12-31 Thread Christopher W. Ryan
successfully. What do you mean you had to use, notepad++ to tell Sweave where Latex.exe and yap.exe where located under MikTex path? --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP

[R] trouble converting an array to a dataframe

2009-01-20 Thread Christopher W. Ryan
NA 2 2 NA 312 13 416 16 512 10 613 11 718 NA 8 8 NA . . . . cut off for brevity . . . -- Christopher W. Ryan, MD SUNY Upstate Medical

Re: [R] Stat textbook recommendations?

2009-01-23 Thread Christopher W. Ryan
in their masters program now. Colorado State University offers similar things, also no campus visits needed. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http

[R] compound outcome variables (not specifically R-related)

2009-01-23 Thread Christopher W. Ryan
good articles discussing the issues? Thanks. --Chris Ryan -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw/ If you want to build

[R] high values of my response variable get chopped off of lattice dotplots

2009-01-23 Thread Christopher W. Ryan
of variable. Any idea how I can find out what happened to the values 8? Thanks. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 40 Arch Street, Johnson City, NY 13790 cryanatbinghamtondotedu PGP public keys available at http://home.stny.rr.com/ryancw

Re: [R] questions about Cusum

2010-03-08 Thread Christopher W. Ryan
I've found the surveillance package useful for monitoring walk-in clinic visits in our county as the influenza pandemic evolved. It might serve your needs for monitoring IFI (invasive fungal infections?) in your hospital. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University

[R] trouble calculating rates--sometimes the denominator is missing

2010-03-10 Thread Christopher W. Ryan
(), rather than relying on always having a complete, rectangular, data file, every line containing the necessary value for a denominator? Thanks. -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu

[R] trouble calculating rates--sometimes the denominator is missing

2010-03-10 Thread Christopher W. Ryan
be able to look up the necessary value for each school from this dataframe. But I can't get my head around using indices to do it. Thanks again. --Chris -- Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904

Re: [R] trouble calculating rates--sometimes the denominator is missing

2010-03-11 Thread Christopher W. Ryan
Thanks! I think that will do the trick. I had not known of the match function before. Always learn something new on this list. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu If you

[R] adding vertical segments to an xyplot in lattice

2011-03-22 Thread Christopher W Ryan
I have a dataframe that looks like this: str(chr) 'data.frame': 84 obs. of 7 variables: $ county: Factor w/ 3 levels Broome,Nassau,..: 3 3 3 3 3 3 3 3 3 3 ... $ item : Factor w/ 28 levels Access to healthy foods,..: 21 19 20 18 16 3 2 6 17 8 ... $ value : num 8644 15 3.5 3.9 7.7 ... $

Re: [R] adding vertical segments to an xyplot in lattice

2011-03-23 Thread Christopher W. Ryan
Peter-- That's it exactly! Thanks. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu Observation is a more powerful force than you could possibly reckon. The invisible

[R] having trouble extracting week from chron object

2011-08-30 Thread Christopher W Ryan
Running R 2.13.1 on Windows XP. I would like to get week of the year (1-52) for each date. library(chron) dts - dates(c(02/27/92, 02/27/92, 01/14/92,02/28/92, 02/01/92)) dts dts.chron - as.chron(dts) dts.chron class(dts.chron) # all of these component extractions work: months(dts.chron)

Re: [R] having trouble extracting week from chron object

2011-08-30 Thread Christopher W Ryan
base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] chron_2.3-42 Thanks. --Chris Ryan On Tue, Aug 30, 2011 at 1:54 PM, David Winsemius dwinsem...@comcast.net wrote: On Aug 30, 2011, at 1:36 PM, Christopher W Ryan wrote: Running R

Re: [R] question on simple graph

2012-01-31 Thread Christopher W. Ryan
Without knowing more about what you are trying to accomplish, and what you have tried so far (code) it's difficult to say. But I'll venture this: are you sure you need a graph? Seems like a table might suffice. BT - sample(1:5, 50, replace=TRUE) RA - sample(1:5, 50, replace=TRUE) table(BT)

[R] specifying scales in lattice xyplot makes the lines disappear?

2011-05-10 Thread Christopher W Ryan
I have a dataframe concerning manner of death from death certificates, from 2005 to 2009 inclusive, with the following structure: str(MannerYoung.plot.data) 'data.frame': 245 obs. of 4 variables: $ year : Factor w/ 5 levels 2005,2006,..: 1 2 3 4 5 1 2 3 4 5 ... $ manner :

Re: [R] About GAM in R, Need YOUR HELP!

2011-06-20 Thread Christopher W Ryan
If you use the mgcv package for GAMs, I found this book very helpful: Wood, SN Generalized additive models: An introduction with R CRC Press, 2006 ISBN-13: 9781584884743 --Chris Ryan SUNY Upstate Medical University On Mon, Jun 20, 2011 at 1:25 AM, pigpigmeow gloryk...@hotmail.com wrote: I'm

Re: [R] Hist with Dates

2013-01-15 Thread Christopher W Ryan
If all you want is frequencies, could you use table()? dd - c(2001-01-02, 2001-01-02, 2001-01-02, 2001-01-02, 2001-01-02, 2001-01-02, 2001-01-02, 2001-01-02, 2001-01-02, 2001-01-03, 2001-01-03, 2001-01-03, 2001-01-03, 2001-01-03, 2001-01-03, 2001-01-03, 2001-01-03, 2001-01-04, 2001-01-04) ddd -

[R] empty density plot for point pattern in spatstat

2014-05-20 Thread Christopher W Ryan
I'm running R-3.0.3 on Windows XP Professional on an institutional PC. (My freedom to update to a more recent version of R is limited, although I might be able to prevail upon the powers that be, if that would solve the problem.) I installed spatstat via install.packages() and received version

Re: [R] read.dta()

2013-09-05 Thread Christopher W. Ryan
I don't know about 3.0.1, but the 2.15.x that I'm still using requires the foreign package--that's where the read.dta command resides. library(foreign) --Chris Ryan SUNY Upstate Medical University Binghamton, NY USA Debasish Roy wrote: I've been using R 3.0.1 version. I tried to read a file

[R] making a wider, shorter, 4-column table instead of the narrower, longer, 2-column table I get with tm, Hmisc, and Sweave

2013-09-19 Thread Christopher W. Ryan
-- Christopher W. Ryan, MD, MS SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu Once we recognize that we do not err out of laziness, stupidity, or evil intent, we can liberate ourselves from the impossible burden of trying

[R] follow up on teaching R to high school students

2013-01-02 Thread Christopher W. Ryan
) may have kept to themselves out of courtesy to me!) A post-workshop survey of the students has just begun, basically asking them if they have downloaded R on their own computers, and whether they have used it in any way since the workshop. --Chris -- Christopher W. Ryan, MD, MS SUNY Upstate

[R] introducing R to high school students

2012-04-17 Thread Christopher W Ryan
I participate peripherally on a listserve for middle- and high-school science teachers. Sometimes questions about graphing or data analysis come up. I never miss an opportunity to advocate for R. However, the teachers are often skeptical that their students would be able to issue commands or write

Re: [R] introducing R to high school students

2012-04-18 Thread Christopher W. Ryan
preference for hand-drawn graphs for learners (a very good point), why is Excel fine but R not? At any rate, I should probably migrate this thread over to the Teaching SIG listserve, which I didn't know about before. Thanks again. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical

Re: [R] introducing R to high school students

2012-04-22 Thread Christopher W. Ryan
I have to agree that Excel is a poor tool for serious scientific and engineering data analysis (love the phrase.) I too have spent way too much time beating Excel files into submission, with workarounds and manipulations, just to be able to do anything useful with them. I'm told that one can

Re: [R] Conditional average

2012-04-25 Thread Christopher W. Ryan
Kebrab67-- It's difficult to answer in the absence of a small bit of representative data, and more information about it. How is age76 recorded, as numerical years or in categories (age ranges?) And what are years (you didn't mention them as a variable in your data.) That being said,

Re: [R] Conditional average

2012-04-25 Thread Christopher W. Ryan
I think this will accomplish what you describe: dd - data.frame(id=c(1:6), age76=c(25, 27, 30, 82, 20, 25), Wage76=c(102456, 15432, 12340, 6, 2, 15000), Grade76=c(12, 15, 16, 88, 16, 12), Black=c(1, 0, 1, 0, 1, 1), imigrt=c(0, 1, 1, 0, 1, 1)) dd dd.sub - subset(dd, Grade76 %in%

Re: [R] Plot txt

2012-05-23 Thread Christopher W. Ryan
Dear Trying: after g - read.table(ip.txt) enter str(g) You will see that g is a dataframe with one variable, called V1. V1 contains the data you want to plot. So type plot(g$V1, type=l) or with(g, plot(V1, type=l)) or, if you prefer to attach g: attach(g) plot(V1, type=l) --Chris

Re: [R] R for a stats intro for undergrads in the US?

2013-11-17 Thread Christopher W. Ryan
I would recommend it. I have no experience teaching statistics to psychology students, but I have done a sequence of hands-on workshops introducing R to a class of high school students who were engaged in a three-year-long science research class. My presentations were not discipline-specific, and

Re: [R] Hello R user!

2013-12-17 Thread Christopher W Ryan
What do you mean by merge them into one? Make both graphs appear on the same page of a document? Make a single figure containing both graphs? Plot data from both dataframes on the same set of axes? --Chris Ryan On Tue, Dec 17, 2013 at 12:33 PM, bibek sharma mbhpat...@gmail.com wrote: Hello R

[R] a better method than a long expression with many OR clauses

2013-12-17 Thread Christopher W Ryan
dd - data.frame(longVariableName1=sample(1:4, 10, replace=TRUE), longVariableName2=sample(1:4, 10, replace=TRUE)) dd # define who is a case and who is not transform(dd, case=(longVariableName1==3 | longVariableName2==3)) But in reality I have 9 of those longVariableName variables, all of this

Re: [R] Hello R user!

2013-12-17 Thread Christopher W Ryan
Here is a simple example (without the proportional size bubbles--you've been given some references on that) using the lattice package: # one dataframe holds the data from both sources I call them. # they would be data from your two separate dataframes, # that you call graph1 and graph2 dd -

Re: [R] demonstrating R in introductory class using point-and-click software

2014-01-17 Thread Christopher W. Ryan
be averse to writing code. --Chris Christopher W. Ryan, MD, MS SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu Once we recognize that we do not err out of laziness, stupidity, or evil intent, we can liberate ourselves

Re: [R] empty density plot for point pattern in spatstat

2014-06-17 Thread Christopher W Ryan
the figure border # and a thin vertical box for the color ramp # but no color ramp in it Any other ideas? I'd be much obliged. Thanks. --Chris Ryan On Tue, May 20, 2014 at 4:31 PM, Christopher W Ryan cr...@binghamton.edu

Re: [R] empty density plot for point pattern in spatstat

2014-06-18 Thread Christopher W. Ryan
From: Pablo Ramón [para...@utpl.edu.ec] Sent: Wednesday, 18 June 2014 9:36 PM To: Rolf Turner Cc: Christopher W Ryan; R-help; Adrian Baddeley Subject: Re: [R] empty density plot for point pattern in spatstat Dear Rolf, The problem persists with the function

Re: [R] empty density plot for point pattern in spatstat

2014-06-20 Thread Christopher W Ryan
I'm back in the office with the machine that was giving me trouble. # fresh start-up of R 3.1.0, installed on the my machine's hard drive, #under Windows XP Service Pack 3. # spatstat version 1.37-0 library(spatstat) data(redwood) dens - density(redwood) str(dens) # everything looks to be in

Re: [R] empty density plot for point pattern in spatstat

2014-07-02 Thread Christopher W Ryan
...@utpl.edu.ec wrote: Hi Chris, Try the form: plot(dens, useRaster=FALSE, ribargs=list(useRaster=FALSE)) Pablo 2014-06-20 15:58 GMT-05:00 Christopher W Ryan cr...@binghamton.edu: I'm back in the office with the machine that was giving me trouble. # fresh start-up of R 3.1.0, installed on the my

[R] package loadable in R 3.1.1 Rterm but not in emacs/ESS

2014-09-26 Thread Christopher W Ryan
I'm running R on Windows 7. Clean install on a brand new computer yesterday. I installed Protext then R then Vincent Goulet's emacs with ESS, in that order. I then installed some R packages, in the R terminal window. Among them was car Today I opened emacs, hit M-x R to start an R session, and

Re: [R] Best Beginner Books?

2014-10-01 Thread Christopher W Ryan
I would recommend these for the absolute beginner with R: A Beginner's Guide to R by Zuur and Data Manipulation with R by Spector I have not seen this, but if their pattern holds, this one coming out from Highland Statistics will also probably be useful for a newcomer: A Beginner's Guide to

Re: [R] plotting the one-dimensional density of events in time

2015-03-09 Thread Christopher W. Ryan
Tom and Bill-- Thanks! Both excellent solutions. --Chris Christopher W. Ryan, MD, MS cryanatbinghamtondotedu Early success is a terrible teacher. You’re essentially being rewarded for a lack of preparation, so when you find yourself in a situation where you must prepare, you can’t do it. You

[R] plotting the one-dimensional density of events in time

2015-03-06 Thread Christopher W. Ryan
prefer labeling the start of each month plot(density(as.numeric(dd)), axes=FALSE) library(zoo) new.axis - as.yearmon(dd) # but then what? This is where I get stuck--adding back a sensible axis Grateful for any guidance. Thanks. --Chris -- Christopher W. Ryan, MD, MS cryanatbinghamtondotedu

Re: [R] detecting any element in a vector of strings, appearing anywhere in any of several character variables in a dataframe

2015-07-13 Thread Christopher W Ryan
doesn't (though it could easily be modified to do that). Best, John -Original Message- From: Christopher W Ryan [mailto:cr...@binghamton.edu] Sent: July-09-15 2:49 PM To: Bert Gunter Cc: Jeff Newmiller; R Help; John Fox Subject: Re: [R] detecting any element in a vector of strings

Re: [R] detecting any element in a vector of strings, appearing anywhere in any of several character variables in a dataframe

2015-07-10 Thread Christopher W Ryan
John Fox, Professor McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ On Wed, 08 Jul 2015 22:23:37 -0400 Christopher W. Ryan cr...@binghamton.edu wrote: Running R 3.1.1 on windows 7 I want to identify as a case any record

[R] detecting any element in a vector of strings, appearing anywhere in any of several character variables in a dataframe

2015-07-09 Thread Christopher W. Ryan
Running R 3.1.1 on windows 7 I want to identify as a case any record in a dataframe that contains any of several keywords in any of several variables. Example: # create a dataframe with 4 variables and 10 records v2 - c(white bird, blue bird, green turtle, quick brown fox, big black dog, waffle

[R] detecting any element in a vector of strings, appearing anywhere in any of several character variables in a dataframe

2015-07-09 Thread Christopher W Ryan
Running R 3.1.1 on windows 7 I want to identify as a case any record in a dataframe that contains any of several keywords in any of several variables. Example: # create a dataframe with 4 variables and 10 records v2 - c(white bird, blue bird, green turtle, quick brown fox, big black dog, waffle

Re: [R] anonymizing subject identifiers for survival analysis

2016-05-17 Thread Christopher W. Ryan
Excellent, thanks. Much simpler. --Chris Christopher W. Ryan, MD, MS cryanatbinghamtondotedu https://www.linkedin.com/in/ryancw Early success is a terrible teacher. You’re essentially being rewarded for a lack of preparation, so when you find yourself in a situation where you must prepare, you

[R] anonymizing subject identifiers for survival analysis

2016-05-13 Thread Christopher W Ryan
I would like to conduct a survival analysis, examining a subject's time to *next* appearance in a database, after their first appearance. It is a database of dated events. I need to obfuscate or anonymize or mask the subject identifiers (a combination of name and birthdate). And obviously any

Re: [R] What is the easiest way to turn a dataframe into a barplot?

2016-05-13 Thread Christopher W. Ryan
Here is one way: dd <- data.frame(var1=c("string1", "string2", "string3"), var2=c(3,7,4)) dd with(dd, barplot(var2, names.arg=var1)) --Chris Ryan Binghamton, NY yoursurrogate...@gmail.com wrote: > Hello, I can't post my code since it's on a work computer. > > But basically, I have a dataframe

[R] I'm getting confused with notation and terminology in output from weibull parametric survival model from survreg()

2016-07-29 Thread Christopher W. Ryan
I'm trying to run a Weibull parametric survival model for recurrent event data, with subject-specific frailties, using survreg() in the survival package, and I'm having trouble understanding the output and its notation, and how that translates to some of the books I am using as references (DF

Re: [R] what happened to inside-r? [possibly OT]

2016-08-01 Thread Christopher W Ryan
nowhere to be found. Alas! But thanks anyway. --Chris On Fri, Jul 29, 2016 at 3:54 PM, David Winsemius <dwinsem...@comcast.net> wrote: > Been off the grid for the last year? MS bought Revolution R. > > > Sent from my iPhone > >> On Jul 29, 2016, at 11:30

Re: [R] R code, heat wave statistics

2016-07-18 Thread Christopher W Ryan
I think much depends on how you define heat wave. --Chris Ryan Broome County Health Department Binghamton, NY USA On Mon, Jul 18, 2016 at 6:16 AM, Damjan / wrote: > Dar all, > > I have a txt file with 4 column data about daily maximum temperature for > some years. > >

[R] what happened to inside-r? [possibly OT]

2016-07-29 Thread Christopher W. Ryan
This might be a bit off-topic, but up until recently (a day or so ago?) I loved using inside-r.org as a quick and easy way to access help pages on R commands. Took me to what I needed without any fuss. Now that URL redirects to the "Microsoft R Application Network"? Looks to be something

Re: [R] Documenting data

2016-06-30 Thread Christopher W Ryan
the changes on the objects in R. Have you looked into various "reproducible research" systems for R, like Sweave or knitr?  They allow you to include analysis code and text of a manuscript or report all together in one file. Christopher W. Ryan sent from my phone with BlueMail On Ju

[R] dplyr or plyr or both?

2016-09-15 Thread Christopher W Ryan
I've set myself the task of learning about these packages, and about tidy data concepts. What is the relationship between plyr and dplyr? Does the latter replace the former (meaning I can concentrate on learning the latter)? Or is there ever a need to use functions from both (meaning I should

Re: [R] dplyr or plyr or both?

2016-09-15 Thread Christopher W. Ryan
I have the impression that it is also possible to library dplyr after plyr, but it is better to remove plyr! This is a serious problem that has been reported before, but not solved (in dplyr 0.5.0 and plyr 1.8.4) Frams 2016-09-15 16:09 GMT+02:00 Christopher W Ryan <cr...@binghamton.edu <mailto:cr...@

[R] trouble with starting date in sts and disProg objects in the surveillance package

2016-12-27 Thread Christopher W Ryan
I create a data frame, then, using package surveillance version 1.3, I convert it to a surveillance time series (sts) object and then to a disProg object. But in the plot of the disProg object, the dates seem to be mislabelled? Grateful for any advice. --Chris Ryan Broome County Health

Re: [R] Help

2017-06-20 Thread Christopher W Ryan
Leonardo-- R-help can be a very useful resource. Some suggestions to use it well: 1. use an informative subject line, not "help" 2. include a "minimal working example:" a *little* data, the code that, with those data, reproduces your problem, and the error message that resulted. As to your

Re: [R] How to Transform a Factor Variable into a Date

2017-06-19 Thread Christopher W Ryan
A couple thoughts: 1. converting factors into dates often requires that they be converted to character first. 2. you don't really have dates; you have just months and years 3. therefore perhaps the as.yearmon() function in the zoo package could help library(zoo) my.factor <- factor("Feb 2017")

Re: [R] about fitting a regression line

2017-06-15 Thread Christopher W Ryan
Rather than just posting your error message, it helps immensely to post the code that produced the error--indeed with some small sample data that reproduces the problem. x <- rnorm(40) y <- 0.6 * x + rnorm(40, sd = 0.3) plot(y ~ x) model <- lm(y ~ cos(x)) summary(model) plot(y ~ cos(x))

Re: [R] Data cleaning & Data preparation, what do R users want?

2017-11-29 Thread Christopher W. Ryan
Great question. What do I want? I want my co-workers to stop using Excel spreadsheets for data entry, storage, and sharing! I want them to understand the value of data discipline. But alas . . . . I work in a county health department in the US. Between dplyr, stringr, grep, grepl, and the base R

[R] printing an arbitrary-length character vector in columns on a page of a pdf report

2018-06-05 Thread Christopher W Ryan
I'm writing code for a recurring report, using an R --> Sweave --> pdflatex workflow. It includes a character vector of short words that I would like to display compactly, in columns on a page, rather than one word per line, which would waste a lot of space. The vector of words will increase

Re: [R] printing an arbitrary-length character vector in columns on a page of a pdf report

2018-06-05 Thread Christopher W. Ryan
Richard-- Nice. If I understand your code correctly, in the line ddm <- matrix("", (n+2) %/% nc, nc) I could instead use ddm <- matrix("", (n + nc - 1) %/% nc, nc) for generalizability, as I may have to increase nc as the list of words grows ever longer. Thanks everyone. Several good

[R] How would I color points conditional on their value in a plot of a time series

2018-05-01 Thread Christopher W Ryan
How would I color points conditional on their value in a plot of a time series. Something like this: ## demonstration data ttt <- ts(rpois(12, lambda = 8), start = c(2000, 1), freq = 4) ttt plot(ttt, type = "p") ## doesn't work--all points the same color plot(ttt, type = "p", col = ifelse(ttt <

Re: [R] How would I color points conditional on their value in a plot of a time series

2018-05-01 Thread Christopher W Ryan
se(ttt<8, > "black", "red")) > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Tue, May 1, 2018 at 1:17 PM, Christopher W Ryan <cr...@binghamton.edu> > wrote: > >> How would I color points conditional on their value in a plot

Re: [R] R maintains old values

2018-07-03 Thread Christopher W Ryan
This TV series might have some advice on that. https://www.imdb.com/title/tt2543312/ --Chris Ryan On Tue, Jul 3, 2018 at 9:25 AM, J C Nash wrote: > . . . Now, to add to the controversy, how do you set a computer on fire? > > JN > > [[alternative HTML version deleted]]

Re: [R] Reasons to Use R in a Public Administrations and Ideas for a Short Training

2018-04-19 Thread Christopher W Ryan
A few years ago I gave two 5-hour workshops about R to a class of US high school students in a somewhat-accelerated science research class (so these were already science-motivated kids). They had been using mainly Excel, and some SPSS for which the school had a license. Overall they seemed to

Re: [R] Help installing netReg

2019-04-15 Thread Christopher W. Ryan
Sorry, was typing on my phone. Not "compy." "Computer." I was asking whether you were working on your own, standalone, computer, or whether perhaps this was an institutional, networked, machine, on which you don't have write permissions that you need. --Chris Ryan Spencer Brackett wrote: >

[R] reading in csv files, some of which have column names and some of which don't

2019-08-13 Thread Christopher W Ryan
Alas, we spend so much time and energy on data wrangling . . . . I'm given a collection of csv files to work with---"found data". They arose via saving Excel files to csv format. They all have the same column structure, except that some were saved with column names and some were not. I have a

  1   2   >