[R] Create new data frame with conditional sums

2023-10-14 Thread Jason Stout, M.D.
This seems like it should be simple but I can't get it to work properly. I'm starting with a data frame like this: Tract Pct Totpop 1 0.054000 2 0.033500 3 0.014500 4 0.124100 5 0.21

Re: [R] Create new data frame with conditional sums

2023-10-15 Thread Jason Stout, M.D.
the result result So thanks to all for considering this query�we're in a brave new world of AI-generated coding. Message: 3 Date: Fri, 13 Oct 2023 20:13:56 + From: "Jason Stout, M.D." To: "r-help@r-project.org" Subject: [R] Create new data frame with conditi

[R] Assigning a variable value based on multiple columns

2013-04-24 Thread Jason Stout, M.D.
Hi All, I'm hoping someone can help me with a relatively simple problem. Take the following dataset: IDDiabetesESRDHIVContact 100NA0 210NA0 3NA 100 40

Re: [R] Assigning a variable value based on multiple columns

2013-04-25 Thread Jason Stout, M.D.
Thanks Patrick--I think this solution will work perfectly. Jason Jason Stout, MD, MHS Box 102359-DUMC Durham, NC 27710 FAX 919-681-7494 From: Patrick Coulombe [patrick.coulo...@gmail.com] Sent: Thursday, April 25, 2013 1:53 AM To: Jason Stout, M.D. Cc: r

[R] Conditional assignment of values to vector using ifelse

2014-05-24 Thread Jason Stout, M.D.
Hi R-users, I'm trying to simulate the outcome of several diagnostic tests with binary outcomes (positive/negative) and different performance characteristics. What I would like to generate is a dataframe with the first column representing the result of a "perfect" test, and different columns t

Re: [R] Conditional assignment of values to vector using ifelse

2014-05-24 Thread Jason Stout, M.D.
. Jason Stout, MD, MHS Box 102359-DUMC Durham, NC 27710 FAX 919-681-7494 From: David Winsemius [dwinsem...@comcast.net] Sent: Saturday, May 24, 2014 11:35 AM To: Jason Stout, M.D. Cc: r-help@r-project.org Subject: Re: [R] Conditional assignment of values to

Re: [R] Conditional assignment of values to vector using ifelse

2014-05-24 Thread Jason Stout, M.D.
MC Durham, NC 27710 FAX 919-681-7494 ____________ From: Jason Stout, M.D. Sent: Saturday, May 24, 2014 11:47 AM To: David Winsemius Cc: r-help@r-project.org Subject: RE: [R] Conditional assignment of values to vector using ifelse This is obviously an oversimplified way of simulating differen