Re: [R] Oddity with internet access and R 11.0 with Sophos firewall and Windoze XP - solved (and version numbers corrected!)

2010-04-24 Thread chrishold
Ah, Dr. Who's got nothing on me!

Beg pardon, I'm recuperating from an operation and clearly more than
usually disoriented.  I meant 2.10.1 and 2.11.0 of course.

Now that I'm here, courtesy of my time slip, what I'd really love to see
in R 10.0.0, or even 2.12.0, is the choice to have output either in the
current plain text or to some simple formatting primitives that would
have default tabs & tables for matrices etc. and allow embedded
graphics.  I'd love to be able to opt to save that as HTML, XML, TeX,
RTF, ODF wihthout the complexities of Sweave, ODFWeave, R2HTML etc.

I know the complexities of Sweave etc. are child's play to numerically
and computer gifted people such as yourself Professor, and the R core
team, but for those of us who proselytise for R to mere psychologists,
doctors, psychotherapists etc., that complexity is hard and the hassles
of reformatting text to nice tables etc. discourages people from coming
across from SPSS I know.

OK, back into my tardis and thanks for the correction!!

Chris

Prof Brian Ripley sent the following  at 24/04/2010 11:57:

> Could you please explain how you manage to travel to the future to get
> access to R 11.0[.0] and 10.1.0.  I'm sure the other R developers would
> also love to know what new features we are going to implement in the
> next several decades.
> 
> On Fri, 23 Apr 2010, Chris Evans wrote:
> 
>> Just in case anyone else hits this.  I just installed R 11.0 alongside R
>> 10.1.0 (off my D: drive in D:\R\... but I think that's irrelevent) and
>> all went well, I selected my nearest CRAN mirror (Bristol is the one I
>> like) and getting the selection list seemed to take ages though it did
>> come eventually.  However, I then got an error message saying that R
>> couldn't make contact on port 80.  I rechecked with R 10.1.0: fine.  I
>> reinstalled R 11.0.0 and selected "internet2" instead of "standard" for
>> internet, no change.
>>
>> I thought "Can't be the firewall as it wouldn't get the list of mirrors"
>> but I went into Sophos firewall and manually added R 11.0.0 and
>> everything is now fine.
>>
>> Very odd and I'd be interested to hear if some clever person can explain
>> why R 11.0.0 was making (very slow) access to the internet to get the
>> list of mirrors but then failing (I have the 10.1.0 location in the
>> windows path but not, yet, the 11.0.0 one, could it be that?)
>>
>> However, ultimately this seems to me to be a problem with Sophos's
>> firewall not R and I'm just reporting it here in case anyone else sees
>> the same and finds this helpful.
>>
>> Thanks to the R team, yet again, for an amazing product!
>>
>> Chris
>>
>>
>> -- 
>> Chris Evans  Skype: chris-psyctc
>> Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
>> Trust Research Governance Lead and Clinical Director, Psychological
>>  Therapies Directorate in Local Services, Nottinghamshire NHS Trust;
>> Professor, Psychotherapy, Nottingham University
>> *If I am writing from one of those roles, it will be clear. Otherwise*
>> *my views are my own and not representative of those institutions*
>> If you have difficulty Emailing me on this address or getting a reply,
>> send again but cc to:   chris dot evans at nottshc dot nhs dot uk
>> and to: c dot evans at nottingham dot ac dot uk
>>
>> __
>> R-help@r-project.org mailing list
>> 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.
>>
> 




-- 
Chris Evans  Skype: chris-psyctc
Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
Trust Research Governance Lead and Clinical Director, Psychological
  Therapies Directorate in Local Services, Nottinghamshire NHS Trust;
Professor, Psychotherapy, Nottingham University
*If I am writing from one of those roles, it will be clear. Otherwise*
*my views are my own and not representative of those institutions*
If you have difficulty Emailing me on this address or getting a reply,
send again but cc to:   chris dot evans at nottshc dot nhs dot uk
and to: c dot evans at nottingham dot ac dot uk

__
R-help@r-project.org mailing list
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.


Re: [R] formatted output facilities ... was ..Oddity with internet access and R 11.0 - solved

2010-04-24 Thread chrishold
David Winsemius sent the following  at 24/04/2010 18:24:
>> Now that I'm here, courtesy of my time slip, what I'd really love to see
>> in R 10.0.0, or even 2.12.0, is the choice to have output either in the
>> current plain text or to some simple formatting primitives that would
>> have default tabs & tables for matrices etc. and allow embedded
>> graphics.  I'd love to be able to opt to save that as HTML, XML, TeX,
>> RTF, ODF wihthout the complexities of Sweave, ODFWeave, R2HTML etc.
>>
>> I know the complexities of Sweave etc. are child's play to numerically
>> and computer gifted people such as yourself Professor, and the R core
>> team, but for those of us who proselytise for R to mere psychologists,
>> doctors, psychotherapists etc., that complexity is hard and the hassles
>> of reformatting text to nice tables etc. discourages people from coming
>> across from SPSS I know.
> 
> -- 
>> require(xtable)
> Loading required package: xtable
>> ?xtable
> 
> -- 
> David (a mere doctor).

Not "mere" to me David.

Yes, I know xtable and use it a bit, well, quite a lot when I was
writing R things for cgi use on the web.  I'm sure it's evolved (quick
check suggests it has and great to see that aov, lm etc. are all
covered).  However, it really does underline my point: you have to know
it exists, you have to load it, then what you get on screen is either
TeX or HTML formatted things and it doesn't embed graphics.  As I
generally (boo hiss) have to get things to end up in Word documents it
means I have to save to HTML and import from there.

I did also work a bit with ODFweave and really liked it but kept hitting
problems and found the extra layer between me and debugging my very bad
R coding meant that I didn't really make the leap from using ESS & R and
raw output.  Not helped by work restrictions ensuring I couldn't really
make the leap from Word to Open Office but the main problems were more
of a feeling of more layers between me and R.  I've got used to ESS and
love it but that leaves me stuck with these output reformatting challenges.

Xtable is wonderful and surely provides a lot of the functions that I'd
love to see embedded into the R core.  If we get into my R tardis, and
go to R 10.0.0, or could it only be R 2.13.0 say, those things would
support an option to stream R output into lightly formatted form AND
render and save that.  I'm looking for table handling such as xtable
provides, tabs and embedding of graphics though if that last didn't come
for years, I'd still be happy to have the text formatting and I'd love
to be able to chose saving to at least a couple of ODF, RTF, HTML, Tex.

As well as the code in xtable, I'm sure other resources are in ODFweave,
Sweave that would help this.  I know it's a significant programming
challenge to do that, particularly in a program that so brilliantly
embraces so many different platforms.

One of my guesses is that just allowing addition of tabs into the
routine R output and encouraging us all to start using them, would be a
huge step forward.

Thanks,

Chris

P.S. I'm cc'g to r-core as this is really a plea to the core team.
Sorry if that's a breach of R etiquette.

-- 
Chris Evans  Skype: chris-psyctc
Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
Trust Research Governance Lead and Clinical Director, Psychological
  Therapies Directorate in Local Services, Nottinghamshire NHS Trust;
Professor, Psychotherapy, Nottingham University
*If I am writing from one of those roles, it will be clear. Otherwise*
*my views are my own and not representative of those institutions*
If you have difficulty Emailing me on this address or getting a reply,
send again but cc to:   chris dot evans at nottshc dot nhs dot uk
and to: c dot evans at nottingham dot ac dot uk

__
R-help@r-project.org mailing list
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.


Re: [R] Oddity: I seem to have a variable in a dataframe that doesn't show in colnames() - can anyone advise?

2011-05-29 Thread chrishold
I thought it might have been that but stupidly didn't search on "$" and
I can now see that the one partial match I tried would have been
ambiguous so "$" hadn't resolved it.  Patrick Burns tells me I could
have found this in the wonderful "R inferno" and I'm sure I could have,
probably have, read that in other things, perhaps things I read way back.

What a reminder that you/we ... OK, _I_ ... can use R for some 13 years
or so now but still not known or forget crucial things like that.

This seems to me a good example of the sort of thing that R uses that
can be useful but can also be a trap for part-timer.  I keep getting
tripped up by R moving things to factors and me not realising that, so
now I've opted to go for options(stringsAsFactors=FALSE) so I can force
myself to retain explicit control of that.  I also repeatedly stumble on
aspects of date handling in R.

Every time I stumble in this sort of way I can see the reasons why R is
designed as it is and the power and efficiency in it and my respect for
the core team grows.  However, it can still make the learning curve
steep & hard.  Thanks to r-help for providing the free tour guide up
Everest (or into the inferno)!

Specific thanks to you both for pointing this one out and apologies if
this is just wasted bandwidth.

Chris

Phil Spector sent the following  at 29/05/2011 16:06:
> Chris -
> If you check the documentation for the "$" operator, for example by
> typing
> 
> help("$")
> 
> you'll find (among a lot of other information):
> 
> name: A literal character string or a name (possibly backtick
>   quoted).  For extraction, this is normally (see under
>   ¡Environments¢) partially matched to the ¡names¢ of the
>   object.
> 
> So when you use the "$" operator (but not "[" or "[["), partial
> matching is performed.  For example:
> 
>> x = data.frame(PHQ9=1:10)
>> x$PHQ
>  [1]  1  2  3  4  5  6  7  8  9 10
>> x[,'PHQ']
> Error in `[.data.frame`(x, , "PHQ") : undefined columns selected
>> x[['PHQ']]
> NULL
> 
> So if you don't want this "feature", you can use brackets instead
> of the dollar sign for extraction.
> 
> - Phil Spector
>  Statistical Computing Facility
>  Department of Statistics
>  UC Berkeley
>  spec...@stat.berkeley.edu


-- 
Chris Evans  Skype: chris-psyctc
Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
Professor, Psychotherapy, Nottingham University
*If I am writing from one of those roles, it will be clear. Otherwise*
*my views are my own and not representative of those institutions*
If you have difficulty Emailing me on this address or getting a reply,
send again but cc to:   chris dot evans at nottshc dot nhs dot uk
and to: c dot evans at nottingham dot ac dot uk

__
R-help@r-project.org mailing list
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.


Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-05-06 Thread chrishold
Tal Galili sent the following  at 06/05/2010 17:33:
> Hi Chris,
> 
> Following this thread, I started experimenting with the R2wd package myself.
> 
> I wrote to the developer who gave me some promising news (that is - that
> an updated package is expected to be released in the next couple of months)

That's good news, I haven't followed the problem I was having up with
the author yet ...

> I wrote about this, and gave an example session on what I found can be
> done with R2wd here:
> http://www.r-statistics.com/2010/05/exporting-r-output-to-ms-word-with-r2wd-an-example-session/

OK, I see that you've written a workaround that gets lm output to Word:
impressive.

However, I think this beautifully supports my wish that we move toward
better formatted text output in the R core and that we do that by moving
through allowing, and encouraging, the tab character to be put into
routine R text output as the output from lm is, of course, the raw
monospaced font style output aligned using monospace font spaces.
Wonderfully statistically powerful and correct and cosmetically and
humanly ugly and time consuming to reformat.

> This package is in it's early stages, but can still function well
> (though probably much less then what a Latex person can do with Sweave)

Agreed!

Many thanks again for this and great to see interest in the issues, I do
think they are important.

Very best to all,

Chris



-- 
Chris Evans  Skype: chris-psyctc
Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
Trust Research Governance Lead and Clinical Director, Psychological
  Therapies Directorate in Local Services, Nottinghamshire NHS Trust;
Professor, Psychotherapy, Nottingham University
*If I am writing from one of those roles, it will be clear. Otherwise*
*my views are my own and not representative of those institutions*
If you have difficulty Emailing me on this address or getting a reply,
send again but cc to:   chris dot evans at nottshc dot nhs dot uk
and to: c dot evans at nottingham dot ac dot uk

__
R-help@r-project.org mailing list
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.


Re: [R] What is the best way to have "R" output tables in an MS Word format? (shaping R core)

2010-05-06 Thread chrishold
I've changed the subject line a bit here as Max is asking such a
fundamental question.

Max Kuhn sent the following  at 01/05/2010 19:22:
> Chris,
> 
...

> Why is it R Core's job to fulfill your wants and desires? I have a
> hard time thinking that very busy people would spend extra time doing
> something that they may or may not have a direct need for. Write it
> yourself or get a group of people together to do it. That what we did
> with odfWeave (for better or worse). If the task is beyond what you
> feel you can do, fund it.

Ouch.  OK. I'm hugely grateful for your work on odfWeave Max and sorry
that Open Office isn't a solution for me at the moment.  However, I
don't think I'm being unreasonable or selfish.

1) Certainbly it's not R core's job to fulfil my wants and desires and
they will have ways to discuss what would strengthen R for lots of us.
Clearly I can submit a wishlist item to the R bugzilla and I should but
that's very particulate: how can the team find out of wishes are common
or would help increase use of R?

There are files of key R core team members' wish lists on the R site but
almost none relate in any way to output and some appear to be years old.
I've worked with R (about 14 years I think) and as I look particularly
at the recent release notes, I see a lot of work went into changing the
help system which is one sort of output from R and a huge amount of work
went into transitions in the object orientation (S3 to S4).  I think
that what I am suggesting is about a core issue of seeing
a set of object properties for numeric output as including insertion of
tabs, ideally as providing flexible presenting and viewing of all
matrices, data frames and lists, and, some day, cross linkage of
graphics into output.  Ideally, as with the capacity of R to export its
graphics in a number of formats, I'd love to see this capitalising on
the work you have done for ODF and others have done for TeX etc.

These strike me as central object handling issues, not things that
should for ever be offloaded to the libraries/packages.

2) Do it myself: I wish!  I'm a terrible programmer and work 50-70 hours
a week in my main jobs (I'm so outspoken here at the moment partly
because I'm off work post-op.)  I'm quite a good psychotherapist and
capable of working in several different modes of psychotherapy and with
individuals, couples, groups and families and I'm a fairly competent
researcher and clinical director.  I wish I'd been born or learned to be
a better programmer as I wish I'd been more musical and able to dance
but I'm not.  I can contribute ideas, help debug things and hope to
contribute much more of this when I retire from the main jobs.  I have
no links with programmers at work nor in my university location so I
have no colleagues with whom I can form a team to do this.

3) Pay for it myself: I was pretty ignorant about ways of paying for
R things.  I can't see me persuading my NHS employer to pay as we're
contracting rapidly and don't officially use R.  If we had the
outputting I'm describing in the R core I think I might be able to get
us to stop paying some thousands of pounds a year for SPSS and might be
able to shift say 1k in gratitude to R though NHS purchasing rules don't
make that easy.  (That, I think, is one of the huge challenges to open
source s'ware, if someone can tell me about ways to get organisations
who have to justify their purchasing as we do manage to pay for open
source development, I'd like to hear and I'll try to make it happen.)

Prompted by your Email I have found the R project membership form and
'faxed it off with payment and will probably donate some more on top of
that 25 euros.  However, I would love a way to make a donation
that would encourage someone to do this bit of work but I'm currently
unlikely, personally, to have the money to pay for all that's needed.

Hope this helps explain my position.  I'm genuinely keen to hear others'
views.  Very best to all,

Chris


-- 
Chris Evans  Skype: chris-psyctc
Consultant Psychiatrist in Psychotherapy, Notts. PDD network;
Trust Research Governance Lead and Clinical Director, Psychological
  Therapies Directorate in Local Services, Nottinghamshire NHS Trust;
Professor, Psychotherapy, Nottingham University
*If I am writing from one of those roles, it will be clear. Otherwise*
*my views are my own and not representative of those institutions*
If you have difficulty Emailing me on this address or getting a reply,
send again but cc to:   chris dot evans at nottshc dot nhs dot uk
and to: c dot evans at nottingham dot ac dot uk

__
R-help@r-project.org mailing list
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.