Hi David and Rui,
Sorry to be so slow in replying. Thank you both for pointing out that the
problem with my code was that I was using comparison operators on mixed data
types. This is something I'll have to be more careful about in the future.
In an earlier email, David talked about how R can s
Hi Marc,
That the code I wrote initially is over engineered is certainly possible. Of
course, Rui's solution is a reworking of that code. If starting from scratch,
Rui likely would have done something quite different. I focused on Rui's code
because it was complete and was a clear improvement o
Hello,
I'm glad it helped.
>
> Error in if (any(is.na(x) & M != "un" & Y != "un")) cat("Warning: Invalid
> date values in", :
> missing value where TRUE/FALSE needed
>
> Why is this happening? If the code correctly correctly handles the date
> "06/20/1840" without producing an error,
> why can
On Jan 30, 2012, at 1:30 PM, Marc Schwartz wrote:
>
> On Jan 30, 2012, at 12:15 PM, David Winsemius wrote:
>
>>
>> On Jan 30, 2012, at 8:44 AM, Paul Miller wrote:
>>
>>> Hi Rui, Marc, and Gabor,
>>>
>>> Thanks for your replies to my question. All were helpful and it was
>>> interesting to s
On Jan 30, 2012, at 12:15 PM, David Winsemius wrote:
>
> On Jan 30, 2012, at 8:44 AM, Paul Miller wrote:
>
>> Hi Rui, Marc, and Gabor,
>>
>> Thanks for your replies to my question. All were helpful and it was
>> interesting to see how different people approach various aspects of the same
>>
On Jan 30, 2012, at 8:44 AM, Paul Miller wrote:
Hi Rui, Marc, and Gabor,
Thanks for your replies to my question. All were helpful and it was
interesting to see how different people approach various aspects of
the same problem.
Spent some time this weekend looking at Rui's solution, which
Hi Rui, Marc, and Gabor,
Thanks for your replies to my question. All were helpful and it was interesting
to see how different people approach various aspects of the same problem.
Spent some time this weekend looking at Rui's solution, which is certainly much
clearer than my own. Managed to figu
Hello, again.
I now have a more complete answer to your points.
> 1. It's too long. My understanding is that skilled programmers can usually
> or often complete tasks like this in a few lines.
It's not very shorter but it's more readable. (The programmer is always
suspect)
> 2. It's not vectori
On Tue, Jan 24, 2012 at 11:54 AM, Paul Miller wrote:
> Hello Everyone,
>
> Still new to R. Wrote some code that finds and prints invalid dates (see
> below). This code works but I suspect it's not very good. If someone could
> show me a better way, I'd greatly appreciate it.
>
> Here is some inf
st now it is fully functional.
>
> It may be that, as I transition to using R, I'll have to live with some less
> than ideal code, at least at the outset. I'll just have to write and re-write
> my code as I improve.
>
> Appreciate your help.
>
> Paul
: r-help@r-project.org
Subject: Re: [R] Checking for invalid dates: Code works but needs
improvement
Message-ID: <1327427697928-4324533.p...@n4.nabble.com>
Content-Type: text/plain; charset=us-ascii
Hello,
Point 3 is very simple, instead of 'print' use 'cat'.
Unlike 'p
Hello,
Point 3 is very simple, instead of 'print' use 'cat'.
Unlike 'print' it allows for several arguments and (very) simple formating.
{ cat("Error: Invalid date values in", DateNames[[i]], "\n",
TestDates[DateNames][[i]][TestDates$Invalid==1], "\n") }
Rui Barradas
--
View
Hello Everyone,
Still new to R. Wrote some code that finds and prints invalid dates (see
below). This code works but I suspect it's not very good. If someone could show
me a better way, I'd greatly appreciate it.
Here is some information about what I'm trying to accomplish. My sense is that
th
13 matches
Mail list logo