I think we need a bit more info on the data layout and what decision rule you 
are using to update the Date of Service. Are you just updating a record to 
provide the most recent DoS or are you correcting errors?
Have a look at 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
 or
Reproducibility · Advanced R.for some susggestions on how to form a good 
question for R-help. Some of the details mentioned in those links can be of 
great help to R-help readers in trying to suggest approaches.



| 
| 
|  | 
Reproducibility · Advanced R.


 |

 |

 |

We probably should see some sample data both of the existing data set and the 
update data set.  Please supply it using dput()  ---discussed in the links 
above.  This is the best way to provide sample data as it ensures that we see 
exactly the same data as you see. 
As Jeff says, it is best to keep all communications on the R-help list. It 
allows many people to see and hopefully contribute to a solution.
Welcome to R.  Most beginners spend much of their time pounding head on desk or 
wall but once you get a feel for the way it works it is an incredibly powerful 
tool.


On Saturday, August 19, 2017, 5:02:23 PM EDT, Jeff Newmiller 
<jdnew...@dcn.davis.ca.us> wrote:

You might get someone on this last willing to invent something from scratch, 
but really this mailing list works best if you give very specific information, 
such as a verbatim copy of several records worth of your data file including 
all the stuff you want to skip over. Usually if someone is planning on 
inventing an example from scratch they make a blog post which you could find 
via search engine.  Helping you offline is also not preferred since multiple 
people can offer advice (or correct each other) if you keep the discussion on 
the list. And no, giving some of the code you have tried is indeed helpful, 
since it can highlight things you don't know that might seem obvious to us. 

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html (read the 
vignette)
-- 
Sent from my phone. Please excuse my brevity.

On August 19, 2017 10:39:26 AM PDT, Nic <ncecch...@gmail.com> wrote:
>Hello all,
>
>I'm a novice R programmer and I don't have a clue as to how to approach
>
>this. I have tried many different approaches only to fail and I can't 
>seem to wrap my head around it.  So I turn to the experts.
>
>I have a text file with patient data that has incorrect dates of 
>service.  I need to update the dates of service in the text file with 
>data that's in a dataframe.
>
>Data in the text file looks like this (call it PatRecs):
>
>PatientID #:  12345
>Date of Service:  8/1/2017
>.
>
>.
>
>.
>
>PatientID #:  12346
>Date of Service: 8/2/2017
>
>.
>
>.
>
>.
>
>The dots are other data.  I'm just focused on the PatientID and DOS.
>
>The data in the data frame (call it DF) looks like
>
>Id2    DOS
>
>12345, 8/3/2017
>12346, 8/4/2017
>
>etc.
>
>The lists for both are longer than this.
>
>I know that in programming for this that there should be readLines and 
>writeLines and greps - but I'm far too new to using R to figure out the
>
>usage of these commands.
>
>How can I update the text file (PatRecs) with the incorrect Date of 
>Service, with the correct DOS in the dataframe (DF)???
>
>This is not a homework assignment, I promise.  This is just my attempt 
>to automate data quality using R, and so that I can learn something 
>new.  In any event, providing you with anything I've done so far would 
>be meaningless.  In an effort to minimize email space, please email me 
>directly.  If there is any interest I'll compile the responses and 
>forward them.  I humbly thank you all for any assistance with this.
>
>Best,
>
>Nic
>
>______________________________________________
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to