On 24-Feb-10 20:03, Henrique Dallazuanna wrote:
You can use tryCatch also:
cat(tryCatch(sprintf('found %s in col %d\n', s, c), error =
function(x)cat('Not Found\n')))
Ah .. one more way .. thanks, I've saved it away in my set of
R tricks!
Best,
Esmail
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Esmail
> Sent: Wednesday, February 24, 2010 10:07 AM
> To: r-help@r-project.org
> Subject: [R] sprintf + integer(0) problem
>
> Hello all,
>
>
You can use tryCatch also:
cat(tryCatch(sprintf('found %s in col %d\n', s, c), error =
function(x)cat('Not Found\n')))
On Wed, Feb 24, 2010 at 9:49 PM, esmail wrote:
>
>
> Henrique Dallazuanna wrote:
>>
>> You can try this:
>>
>> cat(sprintf(ifelse(any(grepl(s, nn)), 'found %s in col %d\n', 'Col
Henrique Dallazuanna wrote:
>
> You can try this:
>
> cat(sprintf(ifelse(any(grepl(s, nn)), 'found %s in col %d\n', 'Column
> %s not found'), s, match(s, nn)))
>
>
Wow .. one can always learn something new .. that looks pretty complex, I
have a bunch of print statements. I was hoping for a s
You can try this:
cat(sprintf(ifelse(any(grepl(s, nn)), 'found %s in col %d\n', 'Column
%s not found'), s, match(s, nn)))
On Wed, Feb 24, 2010 at 3:06 PM, Esmail wrote:
> Hello all,
>
> I am stuck with R v2.8.0 under Linux for the time being and I am
> running into a small problem that doesn't e
Hello all,
I am stuck with R v2.8.0 under Linux for the time being and I am
running into a small problem that doesn't exist under 2.9.x and 2.10.x
with sprintf.
If I have the following code segment to help me determine the column
number for a specific column header/label:
nn = names(Dataset)
6 matches
Mail list logo