Hi Colin,

The GAMLSS package can model heterogeneity in the scale parameter (e.g.
standard deviation) [and also heterogeity in skewness and kurtosis
parameters].of the response variable distribution.
For parametric models a generalized likelihood ratio test can be used to
test whether the heterogeity is needed.
Alternatively a generalized Akaike information criterion (GAIC) can be used
to compare models.
Robert


From: COLLINL@pitt.edu
To: Simon Wood <s.wood@bath.ac.uk>
Cc: r-help@r-project.org
Subject: Re: [R] Heteroscedasticity and mgcv.
Message-ID:
        <3bdf3bb77da8961a6647ea00fbb0b646.squirrel@webmail.pitt.edu>
Content-Type: text/plain; charset=iso-8859-1

Thank you Simon that's quite helpful!  I'll compare that with the GLMSS
models.

        Best,
        Collin.

>
>> (1) Am I correct in understanding that Heteroscedasticity is a problem
>> for
>> Generalized Additive Models as it is for standard linear models?  I am
>> asking particularly about the GAMs as implemented in the mgcv package.
>> Based upon my online search it seems that some forms of penalized
>> splines
>> can address heteroscedasticity while others cannot and I'm not sure what
>> is true of the methods used in mgcv.
> - Yes, the mgcv implementation estimates the models via penalized
> likelihood maximisation, and will be as sensitive to violation of the
> assumed mean variance relationship as any GLM fitted by MLE.
>
>>
>> (2) Assuming that heteroscedasticity is a problem for the mgcv GAMs, can
>> anyone recommend a good test implementation?  I am familiar with the
>> ncvTest method implemented in the car package but that applies only to
>> lms.
> - I tend to check for heteroscedasticity graphically using the usual
> plots of residuals vs fitted values, predictors (and possibly
> combinations of predictors). I like the way that plots often point
> towards a solution to any problem they show.
>
> best,
> Simon
>
>
>
>
>>
>>      Thank you,
>>      Collin Lynch.
>>
>> ______________________________________________
>> 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<http://www.r-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
> --
> Simon Wood, Mathematical Science, University of Bath BA2 7AY UK
> +44 (0)1225 386603               http://people.bath.ac.uk/sw283
>



------------------------------

Message: 23
Date: Tue, 29 Oct 2013 12:32:02 -0500
From: David Carlson <dcarlson@tamu.edu>
To: "'Federico Calboli'" <f.calboli@imperial.ac.uk>, "'r-help'"
        <r-help@stat.math.ethz.ch>
Subject: Re: [R] R vs octave development strategy (and success)
Message-ID: <074701ced4cc$c75c60a0$561521e0$@tamu.edu>
Content-Type: text/plain; charset="us-ascii"

This covers the topic you mention, but from the perspective of
the role of the R Core team. The point about Octave is a single
sentence/footnote:

Fox, John. 2009. Aspects of the Social Organization and
Trajectory of the R Project. The R Journal 1/2: 5-13.

http://rjournal.github.io/archive/2009-2/RJournal_2009-2_Fox.pdf

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: r-help-bounces@r-project.org
[mailto:r-help-bounces@r-project.org] On Behalf Of Federico
Calboli
Sent: Tuesday, October 29, 2013 11:22 AM
To: r-help
Subject: [R] R vs octave development strategy (and success)

Hi All,

if memory serves me well I recall some paper comparing the
relative success in getting mainstream acceptance (as mainstream
as statistics can be) of both R and Octave.  I remember vaguely
that the fact the development strategies (core team vs one main
developer) played a major role in the relative success of the
two programs.  I tried to find this paper, but my goggle skills
are failing me.  Would anyone know where to find it?

Best

F



------------------------------

Message: 24
Date: Tue, 29 Oct 2013 13:44:25 -0400
From: Sarah Goslee <sarah.goslee@gmail.com>
To: "Lopez, Dan" <lopez235@llnl.gov>
Cc: "R help \(r-help@r-project.org\)" <r-help@r-project.org>
Subject: Re: [R] Regular Expression returning unexpected results
Message-ID:
        <CAM_vjum9OhapbG-F3=eZmUOSE2g5Wv73CCfRdiV7u50zZKCOxQ@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Oct 29, 2013 at 1:13 PM, Lopez, Dan <lopez235@llnl.gov> wrote:
> grep("^([a-z]+) +\1 +[a-z]+ [0-9]",lines)

Your expression has a typo:

R> grep("^([a-z]+) +\\1 +[a-z]+ [0-9]",lines)
[1] 2


--
Sarah Goslee
http://www.functionaldiversity.org



------------------------------

Message: 25
Date: Tue, 29 Oct 2013 11:08:14 -0700
From: Jeff Newmiller <jdnewmil@dcn.davis.CA.us>
To: "Lopez, Dan" <lopez235@llnl.gov>,   "R help (r-help@r-project.org)"
        <r-help@r-project.org>
Subject: Re: [R] Regular Expression returning unexpected results
Message-ID: <19d82256-f568-47c3-922b-8a34afe4f1a8@email.android.com>
Content-Type: text/plain; charset=UTF-8

Please read and follow the Posting Guide, in particular re plain text email.

You need to keep in mind that the characters in literal strings in R source
have to make it into RAM before the regex code can parse it. Since regex
needs a single backslash to escape normal parsing and interpret 1 as a back
reference, but the R parser also recognizes and removes backslashes in
string literals as escape characters, you need to escape the backslash with
a backslash in your R string literal.

nchar tells you how many characters are in the string. print renders the
string as it would need to be entered as R source code. cat sends the
string directly to the output (console). Study the output of the following
commands at the R prompt.

?Quotes

nchar("^([a-z]+) +\1 +[a-z]+ [0-9]")
print("^([a-z]+) +\1 +[a-z]+ [0-9]")
cat("^([a-z]+) +\1 +[a-z]+ [0-9]")

On most systems, a raw character code 1 is also known as Control-A, but the
effect it has on the terminal used as the console may vary according to
your setup, and it's effect on my system is  not clear to me.

nchar("^([a-z]+) +\\1 +[a-z]+ [0-9]")
print("^([a-z]+) +\\1 +[a-z]+ [0-9]")
cat("^([a-z]+) +\\1 +[a-z]+ [0-9]")
grep("^([a-z]+) +\\1 +[a-z]+ [0-9]",lines)

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

"Lopez, Dan" <lopez235@llnl.gov> wrote:
>Hi,
>
>So I just took an intro to R programming class and one of the lectures
>was on Regular Expressions. I've been playing around with various R
>functions that use Regular Expressions.
>But this has me stumped. This was part of a quiz and I got it right
>through understanding the syntax. But when I try to run the thing it
>returns 'integer(0)'. Can you please tell me what I am doing wrong?
>
>#I copied and pasted this:
>going up and up and up
>night night at 8
>bye bye from up high
>heading, heading by 9
>
>#THEN
>lines<-readLines("clipboard")
>#This is what it looks like in R
>lines
>[1] "going up and up and up"
>[2] "night night at 8"
>[3] "bye bye from up high"
>[4] "heading, heading by 9"
>
>#THIS IS WHAT IS NOT WORKING THE WAY I THOUGHT. I was expecting it to
>return 2.
># "night night at 8" follows the pattern: Begins with a word then has
>at least one space then the same word then has at least one space then
>a word then a space then a single digit number.
>grep("^([a-z]+) +\1 +[a-z]+ [0-9]",lines)
>integer(0)
>
>#But simple examples DO work
>grep("[Hh]",lines)
>[1] 2 3 4
>grep('[0-9]',lines)
>[1] 2 4
>
>       [[alternative HTML version deleted]]
>
>______________________________________________
>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<http://www.r-project.org/posting-guide.html>
>and provide commented, minimal, self-contained, reproducible code.



------------------------------

Message: 26
Date: Tue, 29 Oct 2013 13:19:50 -0500
From: Erin Hodgess <erinm.hodgess@gmail.com>
To: <collinl@cs.pitt.edu>
Cc: R help <r-help@stat.math.ethz.ch>
Subject: Re: [R] sh /bin/sh bad interpreter error when loading certain
        packages
Message-ID:
        <CACxE24myoCUY5aWs8TMJm1rcO0Py-_h-vmMSGgxYvb67jqacbA@mail.gmail.com>
Content-Type: text/plain

Thanks for the good suggestions!

This is how I solved it (with lots of internet help):

Create a tempdir.  Do a chmod 777 on it.

Within R

> Sys.setenv(TMPDIR="/home/erin/tempdir")
> install.packages("Cairo",depen=TRUE)

and all was well.

Thanks,
Erin



On Tue, Oct 29, 2013 at 12:24 PM, <COLLINL@pitt.edu> wrote:

> > On Tue, 29 Oct 2013, Erin Hodgess wrote:
> >
> >> I'm on a Centos 5 Red Hat system and I'm trying to install such
packages
> >> as
> >> Cairo, Rserve, etc.
> >> However, I keep getting an error:  sh:/bin/sh bad interpreter.
>
> Erin, just to add to what Rich wrote, this may be a disk related result as
> well.  I get this error occasionally on my posix systems.  Assuming that
> you are using install.packages I would check the disk permissions for the
> files and for the disk they reside on.  If, for example, you are
> installing them on a disk partition that does not have the executable flag
> set in fstab you may get this error because the system is unwilling to run
> code resident on those partitions.
>
>     Collin.
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>



--
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess@gmail.com

        [[alternative HTML version deleted]]



------------------------------

Message: 27
Date: Tue, 29 Oct 2013 19:56:25 +0100
From: peter dalgaard <pdalgd@gmail.com>
To: <dcarlson@tamu.edu>
Cc: r-help <r-help@stat.math.ethz.ch>,  Federico Calboli
        <f.calboli@imperial.ac.uk>
Subject: Re: [R] R vs octave development strategy (and success)
Message-ID: <97E212CC-0964-4D94-86E8-4E17E60F3526@gmail.com>
Content-Type: text/plain; charset="windows-1252"

This is from the other perspective

http://www.r-project.org/conferences/DSC-2001/Proceedings/Eaton.pdf

I can?t spot any direct comparison (and there is no mention of R in the
references), but I recall the ideas contrasting the two projects being
bandied about at the time. That discussion is likely what is echoed in the
Fox paper. John Eaton was running out of steam at the time and the paper is
not making a secret of it.

-pd

On 29 Oct 2013, at 18:32 , David Carlson <dcarlson@tamu.edu> wrote:

> This covers the topic you mention, but from the perspective of
> the role of the R Core team. The point about Octave is a single
> sentence/footnote:
>
> Fox, John. 2009. Aspects of the Social Organization and
> Trajectory of the R Project. The R Journal 1/2: 5-13.
>
> http://rjournal.github.io/archive/2009-2/RJournal_2009-2_Fox.pdf
>
> -------------------------------------
> David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77840-4352
>
> -----Original Message-----
> From: r-help-bounces@r-project.org
> [mailto:r-help-bounces@r-project.org] On Behalf Of Federico
> Calboli
> Sent: Tuesday, October 29, 2013 11:22 AM
> To: r-help
> Subject: [R] R vs octave development strategy (and success)
>
> Hi All,
>
> if memory serves me well I recall some paper comparing the
> relative success in getting mainstream acceptance (as mainstream
> as statistics can be) of both R and Octave.  I remember vaguely
> that the fact the development strategies (core team vs one main
> developer) played a major role in the relative success of the
> two programs.  I tried to find this paper, but my goggle skills
> are failing me.  Would anyone know where to find it?
>
> Best
>
> F
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes@cbs.dk  Priv: PDalgd@gmail.com



------------------------------

Message: 28
Date: Tue, 29 Oct 2013 14:05:38 -0500
From: "David Carlson" <dcarlson@tamu.edu>
To: "'Lopez, Dan'" <lopez235@llnl.gov>, "'R help'"
        <r-help@r-project.org>
Subject: Re: [R] Regular Expression returning unexpected results
Message-ID: <074901ced4d9$db0babd0$91230370$@tamu.edu>
Content-Type: text/plain;       charset="us-ascii"

>From ?regex

"(do remember that backslashes need to be doubled when entering
R character strings, e.g. from the keyboard)."

> lines[grep("^([a-z]+) +\\1 +[a-z]+ [0-9]",lines)]
[1] "night night at 8"

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: r-help-bounces@r-project.org
[mailto:r-help-bounces@r-project.org] On Behalf Of Lopez, Dan
Sent: Tuesday, October 29, 2013 12:13 PM
To: R help (r-help@r-project.org)
Subject: [R] Regular Expression returning unexpected results

Hi,

So I just took an intro to R programming class and one of the
lectures was on Regular Expressions. I've been playing around
with various R functions that use Regular Expressions.
But this has me stumped. This was part of a quiz and I got it
right through understanding the syntax. But when I try to run
the thing it returns 'integer(0)'. Can you please tell me what I
am doing wrong?

#I copied and pasted this:
going up and up and up
night night at 8
bye bye from up high
heading, heading by 9

#THEN
lines<-readLines("clipboard")
#This is what it looks like in R
lines
[1] "going up and up and up"
[2] "night night at 8"
[3] "bye bye from up high"
[4] "heading, heading by 9"

#THIS IS WHAT IS NOT WORKING THE WAY I THOUGHT. I was expecting
it to return 2.
# "night night at 8" follows the pattern: Begins with a word
then has at least one space then the same word then has at least
one space then a word then a space then a single digit number.
grep("^([a-z]+) +\1 +[a-z]+ [0-9]",lines)
integer(0)

#But simple examples DO work
grep("[Hh]",lines)
[1] 2 3 4
grep('[0-9]',lines)
[1] 2 4

        [[alternative HTML version deleted]]

______________________________________________
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<http://www.r-project.org/posting-guide.html>
and provide commented, minimal, self-contained, reproducible
code.



------------------------------

Message: 29
Date: Tue, 29 Oct 2013 19:09:59 +0000
From: "Lopez, Dan" <lopez235@llnl.gov>
To: Jeff Newmiller <jdnewmil@dcn.davis.CA.us>, "R help
        (r-help@r-project.org)" <r-help@r-project.org>
Cc: "Bert Gunter \(gunter.berton@gene.com\)" <gunter.berton@gene.com>
Subject: Re: [R] Regular Expression returning unexpected results
Message-ID:
        <
56180B40A4F72A4083C75B30DA86297333D9B948@PRDEXMBX-05.the-lab.llnl.gov>

Content-Type: text/plain; charset="utf-8"

Hi Jeff,

I was reviewing my old lecture notes and see that the professor did use \1
so I think he was talking about regex in a non-platform specific context.
But obviously \\1 is the way to do it in R.
The examples you gave me to study really helped.

I was also going to ask how to identify empty strings AND blank character
strings but you will be happy to know that I figured it out on my own:
grep("^ *$",x)

Thank you.

Thank you Sarah, Bert and David too

Dan


-----Original Message-----
From: Jeff Newmiller [mailto:jdnewmil@dcn.davis.CA.us]
Sent: Tuesday, October 29, 2013 11:08 AM
To: Lopez, Dan; R help (r-help@r-project.org)
Subject: Re: [R] Regular Expression returning unexpected results

Please read and follow the Posting Guide, in particular re plain text email.

You need to keep in mind that the characters in literal strings in R source
have to make it into RAM before the regex code can parse it. Since regex
needs a single backslash to escape normal parsing and interpret 1 as a back
reference, but the R parser also recognizes and removes backslashes in
string literals as escape characters, you need to escape the backslash with
a backslash in your R string literal.

nchar tells you how many characters are in the string. print renders the
string as it would need to be entered as R source code. cat sends the
string directly to the output (console). Study the output of the following
commands at the R prompt.

?Quotes

nchar("^([a-z]+) +\1 +[a-z]+ [0-9]")
print("^([a-z]+) +\1 +[a-z]+ [0-9]")
cat("^([a-z]+) +\1 +[a-z]+ [0-9]")

On most systems, a raw character code 1 is also known as Control-A, but the
effect it has on the terminal used as the console may vary according to
your setup, and it's effect on my system is  not clear to me.

nchar("^([a-z]+) +\\1 +[a-z]+ [0-9]")
print("^([a-z]+) +\\1 +[a-z]+ [0-9]")
cat("^([a-z]+) +\\1 +[a-z]+ [0-9]")
grep("^([a-z]+) +\\1 +[a-z]+ [0-9]",lines)

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

"Lopez, Dan" <lopez235@llnl.gov> wrote:
>Hi,
>
>So I just took an intro to R programming class and one of the lectures
>was on Regular Expressions. I've been playing around with various R
>functions that use Regular Expressions.
>But this has me stumped. This was part of a quiz and I got it right
>through understanding the syntax. But when I try to run the thing it
>returns 'integer(0)'. Can you please tell me what I am doing wrong?
>
>#I copied and pasted this:
>going up and up and up
>night night at 8
>bye bye from up high
>heading, heading by 9
>
>#THEN
>lines<-readLines("clipboard")
>#This is what it looks like in R
>lines
>[1] "going up and up and up"
>[2] "night night at 8"
>[3] "bye bye from up high"
>[4] "heading, heading by 9"
>
>#THIS IS WHAT IS NOT WORKING THE WAY I THOUGHT. I was expecting it to
>return 2.
># "night night at 8" follows the pattern: Begins with a word then has
>at least one space then the same word then has at least one space then
>a word then a space then a single digit number.
>grep("^([a-z]+) +\1 +[a-z]+ [0-9]",lines)
>integer(0)
>
>#But simple examples DO work
>grep("[Hh]",lines)
>[1] 2 3 4
>grep('[0-9]',lines)
>[1] 2 4
>
>       [[alternative HTML version deleted]]
>
>______________________________________________
>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<http://www.r-project.org/posting-guide.html>
>and provide commented, minimal, self-contained, reproducible code.


------------------------------

Message: 30
Date: Tue, 29 Oct 2013 18:02:52 +0100
From: paladini@trustindata.de
To: r-help@r-project.org
Subject: [R] mapping data to a geographic map of Europe
Message-ID:
        <20131029180252.Horde.8zbcwmvAgWnUOg2ZGLW6RA6@webmail.df.eu>
Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes

Hello,
I would like to draw a map of Europe. Each country should be colored
depending on how it scores in an index called GPIndex.
Say a dark red for real bad countries a light red for those which are
not so bad, light blue for the fairly good ones and so on up to the
really good ones in a dark blue.
I never worked with geographic maps before so I tried library maps but
I didn't get far,- especially because all examples I found only seem
to work for the United states. So I'm a bit lost.
I would be nice if somebody could help me.

Thanking you in anticipation!

Best regards

Claudia



------------------------------

Message: 31
Date: Tue, 29 Oct 2013 15:11:35 +0000
From: Dirk Eddelbuettel <edd@debian.org>
To: <r-help@stat.math.ethz.ch>
Subject: Re: [R] R CMD check Error: package MASS was built before R
        3.0.0 - not true!?
Message-ID: <loom.20131029T161054-163@post.gmane.org>
Content-Type: text/plain; charset="us-ascii"

Christian Hennig <ucakche <at> ucl.ac.uk> writes:
> I just updated my R to 3.0.2 and ran
> R CMD check --as-cran on the just produced new version of fpc.
>
> I got an error
> Error: package "MASS" was built before R 3.0.0: please re-install it
>
> - but I actually *did* re-install MASS without error just before that and
> within R library(MASS) works just fine.
>
> What can I do about this?

Look at .libPaths() and check the directories it lists for a different
copy of MASS.

Dirk



------------------------------

Message: 32
Date: Tue, 29 Oct 2013 17:08:13 +0000
From: "Hennig, Christian" <c.hennig@ucl.ac.uk>
To: Jeff Newmiller <jdnewmil@dcn.davis.CA.us>, r-help-request Mailing
        List    <r-help@r-project.org>
Subject: Re: [R] R CMD check Error: package MASS was built before R
        3.0.0 - not true!?
Message-ID:
        <
75c53e1cbcea4d1982c6dd19a93115a3@AM3PR01MB209.eurprd01.prod.exchangelabs.com
>

Content-Type: text/plain; charset="us-ascii"

Dear Jeff,

thanks. Somehow R didn't install MASS where it later looked for it. I still
haven't understood properly what caused the problem but I managed to fix it
now (by specifying lib when installing it).

Best wishes,
Christian

*** --- ***
Christian Hennig
University College London, Department of Statistical Science
Gower St., London WC1E 6BT, phone +44 207 679 1698
c.hennig@ucl.ac.uk, www.homepages.ucl.ac.uk/~ucakche

________________________________________
From: Jeff Newmiller <jdnewmil@dcn.davis.CA.us>
Sent: 29 October 2013 15:12
To: Hennig, Christian; r-help-request Mailing List
Subject: Re: [R] R CMD check Error: package MASS was built before R 3.0.0 -
not true!?

Perhaps check your R_LIBS* variables?

http://stat.ethz.ch/R-manual/R-devel/library/base/html/libPaths.html
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.

Christian Hennig <ucakche@ucl.ac.uk> wrote:
>Hi there,
>
>I just updated my R to 3.0.2 and ran
>R CMD check --as-cran on the just produced new version of fpc.
>
>I got an error
>Error: package "MASS" was built before R 3.0.0: please re-install it
>
>- but I actually *did* re-install MASS without error just before that
>and
>within R library(MASS) works just fine.
>
>What can I do about this?
>
>Best wishes,
>Christian
>
>*** --- ***
>Christian Hennig
>University College London, Department of Statistical Science
>Gower St., London WC1E 6BT, phone +44 207 679 1698
>c.hennig@ucl.ac.uk, www.homepages.ucl.ac.uk/~ucakche
>
>______________________________________________
>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<http://www.r-project.org/posting-guide.html>
>and provide commented, minimal, self-contained, reproducible code.





------------------------------

Message: 33
Date: Tue, 29 Oct 2013 13:27:07 -0400
From: Michael Stauffer <mgstauff@gmail.com>
To: "R-Help Mailing List (r-help@r-project.org)"
        <r-help@r-project.org>
Subject: Re: [R] 'yum install R' failing with tcl/tk issue
Message-ID:
        <CANBOegKE=P=Oc-4mKDhGfxfBa3-3orkiyO4GpG+PEzvSBjJg4w@mail.gmail.com>
Content-Type: text/plain

Thanks everyone for the replies to my question. The issue turns out to be
that I'm on a Rocks cluster head node, and the Rocks distribution disables
alternate repos by defaut so it's using the Rocks-6.1 repo which has the
old R.

In the meantime I've built R 3.0.2 from source, which seems a better idea
anyway, as I'll need multiple versions of R installed over time.

-M


On Fri, Oct 25, 2013 at 7:43 AM, Marc Schwartz <marc_schwartz@me.com> wrote:

>
> On Oct 25, 2013, at 1:29 AM, Prof Brian Ripley <ripley@stats.ox.ac.uk>
> wrote:
>
> > On 25/10/2013 02:33, Michael Stauffer wrote:
> >> Hi,
> >>
> >> I'm trying to install R on CentOS 6.4.
> >
> > This is not the right list.  But
> >
> > - As the posting guide says, we only support current R here.  R 2.10.0
> is ancient, and other people seem to have found 3.0.1 RPMs for Centos 6.3.
> >
> > - It seems your RPM is linked against Tcl/Tk 8.4, also ancient.  Tcl/Tk
> 8.6 is current.
> >
> > I suggest you install R 3.0.2 from the sources, in which case R-devel
> would be the right list.  For binary installations on CentOS, R-sig-Fedora
> is.
> >
>
> There are several inconsistencies in the output, as 3.0.1 is available as
> an RPM from the EPEL repos:
>
>   http://dl.fedoraproject.org/pub/epel/6/x86_64/repoview/R.html
>
> In addition, the output below shows that the R rpm being installed is from
> 'el5', rather than 'el6'. If this was CentOS 5, rather than 6, R 2.15.2 is
> available:
>
>   http://dl.fedoraproject.org/pub/epel/5/x86_64/repoview/R.html
>
> Something seems to be amiss with the configuration not getting the right
> yum repo paths.
>
> A Google search came up with this link:
>
>   http://lancegatlin.org/tech/centos-6-clear-the-yum-cache
>
> which might be helpful, as it suggests a similar issue of yum picking up
> incorrect versions. You may need to reinstall the EPEL repo RPM after
these
> steps.
>
> Regards,
>
> Marc Schwartz
>
>
> >>
> >> Following some instructions online, I've done this:
> >>
> >> rpm -Uvh
> >>
>
http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
> >>
> >> yum install R
> >>
> >> But yum fails, with this (full output below):
> >>
> >> Error: Package: R-core-2.10.0-2.el5.x86_64 (Rocks-6.1)
> >>            Requires: libtcl8.4.so()(64bit)
> >> Error: Package: R-core-2.10.0-2.el5.x86_64 (Rocks-6.1)
> >>            Requires: libtk8.4.so()(64bit)
> >>
> >> I have tcl/tk 8.5 already installed. Does anyone have any suggestion?
> >> Thanks!
> >>
> >> Full output:
> >>
> >> [root@picsl-cluster ~]# yum install R
> >> Repository base is listed more than once in the configuration
> >> Rocks-6.1
> >>                           | 1.9 kB     00:00
> >> base
> >>                            | 3.7 kB     00:00
> >> Setting up Install Process
> >> Resolving Dependencies
> >> --> Running transaction check
> >> ---> Package R.x86_64 0:2.10.0-2.el5 will be installed
> >> --> Processing Dependency: libRmath-devel = 2.10.0-2.el5 for package:
> >> R-2.10.0-2.el5.x86_64
> >> --> Processing Dependency: R-devel = 2.10.0-2.el5 for package:
> >> R-2.10.0-2.el5.x86_64
> >> --> Running transaction check
> >> ---> Package R-devel.x86_64 0:2.10.0-2.el5 will be installed
> >> --> Processing Dependency: R-core = 2.10.0-2.el5 for package:
> >> R-devel-2.10.0-2.el5.x86_64
> >> ---> Package libRmath-devel.x86_64 0:2.10.0-2.el5 will be installed
> >> --> Processing Dependency: libRmath = 2.10.0-2.el5 for package:
> >> libRmath-devel-2.10.0-2.el5.x86_64
> >> --> Running transaction check
> >> ---> Package R-core.x86_64 0:2.10.0-2.el5 will be installed
> >> --> Processing Dependency: libtk8.4.so()(64bit) for package:
> >> R-core-2.10.0-2.el5.x86_64
> >> --> Processing Dependency: libtcl8.4.so()(64bit) for package:
> >> R-core-2.10.0-2.el5.x86_64
> >> --> Processing Dependency: libgfortran.so.1()(64bit) for package:
> >> R-core-2.10.0-2.el5.x86_64
> >> ---> Package libRmath.x86_64 0:2.10.0-2.el5 will be installed
> >> --> Running transaction check
> >> ---> Package R-core.x86_64 0:2.10.0-2.el5 will be installed
> >> --> Processing Dependency: libtk8.4.so()(64bit) for package:
> >> R-core-2.10.0-2.el5.x86_64
> >> --> Processing Dependency: libtcl8.4.so()(64bit) for package:
> >> R-core-2.10.0-2.el5.x86_64
> >> ---> Package compat-libgfortran-41.x86_64 0:4.1.2-39.el6 will be
> installed
> >> --> Finished Dependency Resolution
> >> Error: Package: R-core-2.10.0-2.el5.x86_64 (Rocks-6.1)
> >>            Requires: libtcl8.4.so()(64bit)
> >> Error: Package: R-core-2.10.0-2.el5.x86_64 (Rocks-6.1)
> >>            Requires: libtk8.4.so()(64bit)
> >>  You could try using --skip-broken to work around the problem
> >> ** Found 57 pre-existing rpmdb problem(s), 'yum check' output follows:
> >> foundation-git-1.7.11.4-0.x86_64 has missing requires of
> perl(SVN::Client)
> >> foundation-git-1.7.11.4-0.x86_64 has missing requires of
perl(SVN::Core)
> >> foundation-git-1.7.11.4-0.x86_64 has missing requires of
> perl(SVN::Delta)
> >> foundation-git-1.7.11.4-0.x86_64 has missing requires of perl(SVN::Ra)
> >> 1:guestfish-1.7.17-26.el6.x86_64 has missing requires of libguestfs =
> ('1',
> >> '1.7.17', '26.el6')
> >> opt-perl-AcePerl-1.92-0.el6.x86_64 has missing requires of
> >> perl(Ace::Browser::LocalSiteDefs)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Apache::DBI)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::ASN1::EntrezGene)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Expression::Contact)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Expression::DataSet)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Expression::Platform)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Expression::Sample)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Phylo::Factory)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Phylo::Forest::Tree)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Phylo::IO)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Phylo::Matrices)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Phylo::Matrices::Datum)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Bio::Phylo::Matrices::Matrix)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Convert::Binary::C)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> perl(DBD::Pg)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(PostScript::TextBlock)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Test::Exception)
> >> opt-perl-BioPerl-1.6.901-0.el6.noarch has missing requires of
> >> perl(Test::Warn)
> >> opt-perl-BioPerl-DB-1.006900-0.el6.noarch has missing requires of
> >> perl(DBD::Oracle)
> >> opt-perl-BioPerl-Run-1.006900-0.el6.noarch has missing requires of
> >> perl(Bio::Tools::Run::StandAloneBlastPlus::BlastMethods)
> >> opt-perl-BioPerl-Run-1.006900-0.el6.noarch has missing requires of
> >> perl(Bio::Tools::Run::WrapperBase::CommandExts)
> >> opt-perl-Cache-Cache-1.06-0.el6.noarch has missing requires of
> >> perl(IPC::ShareLite)
> >> opt-perl-DBI-1.622-0.el6.x86_64 has missing requires of perl(Coro)
> >> opt-perl-DBI-1.622-0.el6.x86_64 has missing requires of
> perl(Coro::Handle)
> >> opt-perl-DBI-1.622-0.el6.x86_64 has missing requires of
> perl(Coro::Select)
> >> opt-perl-DBI-1.622-0.el6.x86_64 has missing requires of
> perl(RPC::PlClient)
> >>> = ('0', '0.2000', None)
> >> opt-perl-DBI-1.622-0.el6.x86_64 has missing requires of
> perl(RPC::PlServer)
> >>> = ('0', '0.2001', None)
> >> opt-perl-DBI-1.622-0.el6.x86_64 has missing requires of
> perl(Win32::ODBC)
> >> opt-perl-Data-Stag-0.11-0.el6.x86_64 has missing requires of perl(Tk)
> >> opt-perl-Data-Stag-0.11-0.el6.x86_64 has missing requires of
> perl(Tk::Label)
> >> opt-perl-Data-Stag-0.11-0.el6.x86_64 has missing requires of
> perl(Tk::Tree)
> >> opt-perl-Digest-Perl-MD5-1.8-0.el6.noarch has missing requires of
> >> /usr/bin/false
> >> opt-perl-HTTP-Cookies-6.01-0.el6.noarch has missing requires of
> perl(Win32)
> >> opt-perl-IPC-Run-0.92-0.el6.noarch has missing requires of
> >> perl(Win32::Process)
> >> opt-perl-IPC-Run-0.92-0.el6.noarch has missing requires of
> >> perl(Win32API::File)
> >> opt-perl-MLDBM-2.04-0.el6.noarch has missing requires of
> perl(FreezeThaw)
> >> opt-perl-Moose-2.0604-0.el6.x86_64 has missing requires of
> >> perl(Moose::Conflicts)
> >> opt-perl-Moose-2.0604-0.el6.x86_64 has missing requires of
> >> perl(Moose::Error::Util)
> >> opt-perl-Package-Stash-0.33-0.el6.noarch has missing requires of
> >> perl(Package::Stash::Conflicts)
> >> opt-perl-SOAP-Lite-0.715-0.el6.noarch has missing requires of
> >> perl(MIME::Lite)
> >> opt-perl-SOAP-Lite-0.715-0.el6.noarch has missing requires of
> >> perl(SOAP::Transport::TCP)
> >> opt-perl-Spreadsheet-ParseExcel-0.59-0.el6.noarch has missing requires
> of
> >> perl(Jcode)
> >> opt-perl-Spreadsheet-ParseExcel-0.59-0.el6.noarch has missing requires
> of
> >> perl(Spreadsheet::WriteExcel)
> >> opt-perl-Spreadsheet-ParseExcel-0.59-0.el6.noarch has missing requires
> of
> >> perl(Unicode::Map)
> >> opt-perl-XML-SAX-0.99-0.el6.noarch has missing requires of
> >> perl(XML::SAX::PurePerl::DTDDecls)
> >> opt-perl-XML-SAX-0.99-0.el6.noarch has missing requires of
> >> perl(XML::SAX::PurePerl::DocType)
> >> opt-perl-XML-SAX-0.99-0.el6.noarch has missing requires of
> >> perl(XML::SAX::PurePerl::EncodingDetect)
> >> opt-perl-XML-SAX-0.99-0.el6.noarch has missing requires of
> >> perl(XML::SAX::PurePerl::XMLDecl)
> >> opt-perl-YAML-0.84-0.el6.noarch has missing requires of
> perl(Test::Base) >=
> >> ('0', '0.47', None)
> >> opt-perl-YAML-0.84-0.el6.noarch has missing requires of
> >> perl(Test::Base::Filter)
> >> opt-perl-libwww-perl-6.04-0.el6.noarch has missing requires of
> >> perl(Authen::NTLM)
> >> opt-perl-libwww-perl-6.04-0.el6.noarch has missing requires of
> >> perl(HTTP::GHTTP)
>
>

        [[alternative HTML version deleted]]



------------------------------

Message: 34
Date: Tue, 29 Oct 2013 16:31:17 +0100
From: "Rossenu, Stefaan" <stefaan.rossenu@merck.com>
To: "r-help@R-project.org" <r-help@r-project.org>
Subject: [R] calculating quantiles
Message-ID:
        <283BADBCB74E69438047FA030D918EE58C063F6E02@BEBRMXP51006.merck.com>
Content-Type: text/plain

Hi,

I'm having the following loop:

result <- vector("list",100)
for (i in 1:max(dat$simNumber))
{
result[[i]]<-survfit(Surv(dat[dat$simNumber==i,]$TAFD,dat[dat$simNumber==i,]$DV)~1)

}

In a next step, I would like to calculate the mean, 5% and 95% PI of the
Kaplan-Meier estimates of the 100 simulated problems stored under result in
the result[[i]]$surv.

Can anyone help me with this?

Tx!



Notice:  This e-mail message, together with any attachme...{{dropped:14}}



------------------------------

Message: 35
Date: Tue, 29 Oct 2013 20:27:13 +0100
From: Petar Milin <pmilin@gmail.com>
To: HELP-R-HELP <r-help@stat.math.ethz.ch>
Subject: [R] How to save very large matrix?
Message-ID: <F51E600F-39FF-43D0-9F2C-63F3511AD321@gmail.com>
Content-Type: text/plain; charset="us-ascii"

Hello!
I have a very large matrix of results: 50000x100000. I saved it as RDS, but
I would also need to save it as txt or csv. Is there a way to do it? Now,
with write.table I am receiving an error:
Error in .External2(C_writetable, x, file, nrow(x), p, rnames, sep, eol,  :
  long vectors not supported yet: io.c:1116

Please, help! Many thanks!

PM


------------------------------

Message: 36
Date: Tue, 29 Oct 2013 21:16:51 +0100
From: Marius Hofert <marius.hofert@math.ethz.ch>
To: R-help <r-help@r-project.org>
Subject: [R] (gam) formula: Why different results for terms being
        factor vs.      numeric?
Message-ID:
        <CAM3-Kja0oDJ+koJFPpN404F+uKRWC8iinfVbVhDZH=30atQ2Dg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Dear expeRts,

If I specify group = as.factor(rep(1:2, each=n)) in the below
definition of dat, I get the expected behavior I am looking for. I
wonder why I
don't get it if group is *not* a factor... My guess was that,
internally, factors are treated as natural numbers (and this indeed
seems to be true if you convert the latter to factors [essentially
meaning changing the levels]), but replacing factors by numeric values
(as below) does not provide the same answer.

Cheers,
Marius


require(mgcv)

n <- 10
yrs <- 2000+seq_len(n)
set.seed(271)
dat <- data.frame(year  = rep(yrs, 2),
                  group = rep(1:2, each=n), # *not* a factor
(as.factor() provides the expected behavior)
                  resp  = c(seq_len(n)+runif(n), 5+seq_len(n)+runif(n)))
fit3 <- gam(resp ~ year + group - 1, data=dat)
plot(yrs, fit3$fitted.values[seq_len(n)], type="l", ylim=range(dat$resp),
     xlab="Year", ylab="Response") # fit group A; mean over all
responses in this group
lines (yrs, fit3$fitted.values[n+seq_len(n)], col="blue") # fit group
B; mean over all responses in this group
points(yrs, dat$resp[seq_len(n)]) # actual response group A
points(yrs, dat$resp[n+seq_len(n)], col="blue") # actual response group B
## => hmmm... because it is not a factor (?), this does not give an
expected answer,
##    but gam() still correctly figures out that there are two groups



------------------------------

Message: 37
Date: Wed, 30 Oct 2013 04:26:43 +0800 (SGT)
From: Ron Michael <ron_michael70@yahoo.com>
To: "r-help@r-project.org" <r-help@r-project.org>
Subject: [R] R function to locate Excel sheet?
Message-ID:
        <1383078403.49158.YahooMailNeo@web190503.mail.sg3.yahoo.com>
Content-Type: text/plain; charset=utf-8

Hi,

I am looking for some R function which will tell me, whether a particular
sheet in an Excel file (.xlsx/.xls) exists or not. I just need to get some
TRUE/FALSE type of answer.

Can somebody give me any pointer if such function exists or not?

Thanks and regards,



------------------------------

Message: 38
Date: Tue, 29 Oct 2013 15:26:04 -0500
From: "Adams, Jean" <jvadams@usgs.gov>
To: <paladini@trustindata.de>
Cc: R help <r-help@r-project.org>
Subject: Re: [R] mapping data to a geographic map of Europe
Message-ID:
        <CAN5YmCHnKATgmwohcaHyTbzRSi4vyqcYg-jphxJ7AQ2m-wCbZg@mail.gmail.com>
Content-Type: text/plain

Check out this link for some examples
    http://www.r-bloggers.com/maps-in-r-choropleth-maps/

Jean


On Tue, Oct 29, 2013 at 12:02 PM, <paladini@trustindata.de> wrote:

> Hello,
> I would like to draw a map of Europe. Each country should be colored
> depending on how it scores in an index called GPIndex.
> Say a dark red for real bad countries a light red for those which are not
> so bad, light blue for the fairly good ones and so on up to the really
good
> ones in a dark blue.
> I never worked with geographic maps before so I tried library maps but I
> didn't get far,- especially because all examples I found only seem to work
> for the United states. So I'm a bit lost.
> I would be nice if somebody could help me.
>
[[elided Yahoo spam]]
>
> Best regards
>
> Claudia
>
> ______________________________**________________
> R-help@r-project.org mailing list
>
https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help
>
> PLEASE do read the posting guide http://www.R-project.org/<http://www.r-project.org/>
**
> posting-guide.html <http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
>
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



------------------------------

Message: 39
Date: Tue, 29 Oct 2013 13:31:00 -0700
From: Bert Gunter <gunter.berton@gene.com>
To: Marius Hofert <marius.hofert@math.ethz.ch>
Cc: R-help <r-help@r-project.org>
Subject: Re: [R] (gam) formula: Why different results for terms being
        factor vs. numeric?
Message-ID:
        <CACk-te1b7v8WXD1Ws9DZjsxjwyewmM8n5nSZXGyO5nGxYUW6VA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Think about it. How can one define a smooth term with a factor???

Further discussion is probably offtopic. Post on
stats.stackexchange.com if it still isn't obvious.

Cheers,
Bert

On Tue, Oct 29, 2013 at 1:16 PM, Marius Hofert
<marius.hofert@math.ethz.ch> wrote:
> Dear expeRts,
>
> If I specify group = as.factor(rep(1:2, each=n)) in the below
> definition of dat, I get the expected behavior I am looking for. I
> wonder why I
> don't get it if group is *not* a factor... My guess was that,
> internally, factors are treated as natural numbers (and this indeed
> seems to be true if you convert the latter to factors [essentially
> meaning changing the levels]), but replacing factors by numeric values
> (as below) does not provide the same answer.
>
> Cheers,
> Marius
>
>
> require(mgcv)
>
> n <- 10
> yrs <- 2000+seq_len(n)
> set.seed(271)
> dat <- data.frame(year  = rep(yrs, 2),
>                   group = rep(1:2, each=n), # *not* a factor
> (as.factor() provides the expected behavior)
>                   resp  = c(seq_len(n)+runif(n), 5+seq_len(n)+runif(n)))
> fit3 <- gam(resp ~ year + group - 1, data=dat)
> plot(yrs, fit3$fitted.values[seq_len(n)], type="l", ylim=range(dat$resp),
>      xlab="Year", ylab="Response") # fit group A; mean over all
> responses in this group
> lines (yrs, fit3$fitted.values[n+seq_len(n)], col="blue") # fit group
> B; mean over all responses in this group
> points(yrs, dat$resp[seq_len(n)]) # actual response group A
> points(yrs, dat$resp[n+seq_len(n)], col="blue") # actual response group B
> ## => hmmm... because it is not a factor (?), this does not give an
> expected answer,
> ##    but gam() still correctly figures out that there are two groups
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.



--

Bert Gunter
Genentech Nonclinical Biostatistics

(650) 467-7374



------------------------------

Message: 40
Date: Tue, 29 Oct 2013 15:31:40 -0500
From: "Adams, Jean" <jvadams@usgs.gov>
To: Petar Milin <pmilin@gmail.com>
Cc: HELP-R-HELP <r-help@stat.math.ethz.ch>
Subject: Re: [R] How to save very large matrix?
Message-ID:
        <CAN5YmCGfp9X0FPsQNNu=Reca_kRwSx6k1HQiLA-379M2Wx-4dA@mail.gmail.com>
Content-Type: text/plain

Have you tried write.csv() or write.matrix()?  I really don't know, but
they may be more efficient than write.table() with large matrices.

Jean


On Tue, Oct 29, 2013 at 2:27 PM, Petar Milin <pmilin@gmail.com> wrote:

> Hello!
> I have a very large matrix of results: 50000x100000. I saved it as RDS,
> but I would also need to save it as txt or csv. Is there a way to do it?
> Now, with write.table I am receiving an error:
> Error in .External2(C_writetable, x, file, nrow(x), p, rnames, sep, eol,
:
>   long vectors not supported yet: io.c:1116
>
[[elided Yahoo spam]]
>
> PM
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



------------------------------

Message: 41
Date: Wed, 30 Oct 2013 07:32:02 +1100
From: Jim Lemon <jim@bitwrit.com.au>
To: paladini@trustindata.de
Cc: r-help@r-project.org
Subject: Re: [R] mapping data to a geographic map of Europe
Message-ID: <52701B42.3090200@bitwrit.com.au>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 10/30/2013 04:02 AM, paladini@trustindata.de wrote:
> Hello,
> I would like to draw a map of Europe. Each country should be colored
> depending on how it scores in an index called GPIndex.
> Say a dark red for real bad countries a light red for those which are
> not so bad, light blue for the fairly good ones and so on up to the
> really good ones in a dark blue.
> I never worked with geographic maps before so I tried library maps but I
> didn't get far,- especially because all examples I found only seem to
> work for the United states. So I'm a bit lost.
> I would be nice if somebody could help me.
>
Hi Claudia,
If you draw a map of Europe something like this:

world.map<-map('world', fill = TRUE,
  col = 1:10,xlim=c(-15,40),ylim=c(37,70))

you have a "col" argument that you can pass the colors you want. What
you must do is look at the "names" component of "world.map":

$names
   [1] "Denmark"
   [2] "USSR"
   [3] "Italy"
   [4] "Netherlands"
   [5] "Iraq"
...

to get the indices of the countries. Say Denmark was fairly good, USSR
was fairly bad, and so on. You could then pass colors like this:

col=c("lightblue","lightred",...)

in the call to map for as many countries as you wanted. Pass NA for
those countries that you don't want to color.

Jim



------------------------------

Message: 42
Date: Wed, 30 Oct 2013 09:35:14 +1300
From: Rolf Turner <r.turner@auckland.ac.nz>
To: peter dalgaard <pdalgd@gmail.com>
Cc: "r-help@r-project.org help" <r-help@r-project.org>, Achim Zeileis
        <Achim.Zeileis@uibk.ac.at>,     kmmoon100 <
k.moon@student.unimelb.edu.au>
Subject: Re: [R] Optimization failed in fitdistr (Weibull
        distribution)
Message-ID: <52701C02.1020009@auckland.ac.nz>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 10/29/13 19:44, peter dalgaard wrote:


     <SNIP>
> There really is no substitute for knowledge and understanding! Did it not
occur to you that the Windspeed column needs to enter into your analysis?

     <SNIP>

Fortune!

     cheers,

     Rolf Turner



------------------------------

Message: 43
Date: Tue, 29 Oct 2013 19:54:36 -0000
From: "Sue Lewis" <sue.lewis@ed.ac.uk>
To: <r-help@r-project.org>
Subject: [R] Conditional wald statistics in ASRemlR
Message-ID: <001c01ced4e0$b2b03be0$1810b3a0$@ed.ac.uk>
Content-Type: text/plain; charset="us-ascii"

Hi, I'm running a model in ASRemlR and the conditional wald statistics table
is producing groupings for the marginality of some variables (A's B's and
C's in the tables below) that we are struggling to understand. From our
understanding of the model we are fitting and the reference manual, we were
expecting main effects to be grouped together (e.g Maring "A") and the two
way interactions to be grouped together (e.g. Margin "B") and to be marginal
with respect to main effects and then the three-way interactions to be
grouped together (e.g. Margin "C") and to be marginal with respect to
two-way interactions and main effects. However, this doesn't seem to be
happening. For example, the main effect of yr (year - of which there are 2
and is a factor) appears to be given Margin "C",which groups it with a
number of 2-way interactions and the three-way interactions in terms of
marginality. Does anyone have any suggestions as to why is this the case?

I have been told that ASReml has a general algorithm for determining the
groupings which is not fool proof.  Stand-alone ASReml allows you to
redefine the groupings.  What we would like to know is whether those
capabilities exist for the R version, and if not, are there other ways we
can set up the model to get the terms in the appropriate grouping.



Thanks so much for any suggestions,

Sue



> W1<-wald.asreml(m1.asreml, ssType="conditional")



  asreml 3.0 (15 April 2013), Library: 3.0hj (15 November 2011), X86_64

     LogLik         S2      DF      wall     cpu

   -50111.3907      0.0010 51482  09:02:03    15.9



> W1$Wald$p<-round(1-pf(W1$Wald[,2], W1$Wald[,1], 90),3)

> W1

$Wald

                                Df           F.inc
F.con                     Margin    p

(Intercept)         1              1772.0000            585100.0
0.000

yr                             1             7.6790                   9030.0
C             0.007

months                5              9.1350                   10790.0
A            0.000

dayc                       1              21.9900                 19780.0
B             0.000

haschicks             1              38.0200                 50740.0
B             0.000

chickagec             1              6.5720                   14020.0
B             0.012

bsc                         1               191.3000             192600.0
B             0.000

sex                          1             0.7405                   742.4
A             0.392

winspc                   1             45.7700                  44840.0
A             0.000

sinwinc                 1              3.4120                   2586.0
A             0.068

rainc                      1              16.4300                 15910.0
A             0.000

months:dayc         5          15.2400                 14320.0
C             0.000

months:sex          5            5.3200                   669.1
B             0.000

haschicks:sex       1           7.7330                   8906.0
C             0.007

chickagec:sex       1           0.2351                   288.6
C             0.629

bsc:sex                  1             1.9470                   1726.0
C             0.166

sex:winspc          1             23.1700                 19900.0
B             0.000

sex:sinwinc         1             12.4700                 5766.0
B             0.001

sex:rainc               1             0.7769                   625.3
B             0.380

months:sex:winspc  10    2.7480                 2258.0                   C
0.005

months:sex:sinwinc 10    2.6850                 1834.0                   C
0.006

months:sex:rainc   10    1.7060                   1706.0                   C
0.091











~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sue Lewis

NERC fellow

Institute of Evolutionary Biology

School of Biological Sciences

University of Edinburgh

Edinburgh, EH9 3JT, UK



Email: sue.lewis@ed.ac.uk

Tel: +44 (0)131 6505444

http://lewis.bio.ed.ac.uk <http://lewis.bio.ed.ac.uk/>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <
https://stat.ethz.ch/pipermail/r-help/attachments/20131029/38802e1a/attachment.ksh
>

------------------------------

Message: 44
Date: Tue, 29 Oct 2013 15:36:06 -0500
From: "Adams, Jean" <jvadams@usgs.gov>

Cc: "r-help@r-project.org" <r-help@r-project.org>
Subject: Re: [R] R function to locate Excel sheet?
Message-ID:
        <CAN5YmCEmL-oy0EW7uOi=-yOFDz8bA6=gWMFBP66ti5wXXSRKHg@mail.gmail.com>
Content-Type: text/plain

You could use the XLConnect package to do this.  For example, something
like this might do the trick ...

library(XLConnect)
mysheet <- "Sheet4"
wb <- loadWorkbook("C:/temp/MyData.xlsx")
wbsheets <- getSheets(wb)
mysheet %in% wbsheets

Jean




> Hi,
>
> I am looking for some R function which will tell me, whether a particular
> sheet in an Excel file (.xlsx/.xls) exists or not. I just need to get some
> TRUE/FALSE type of answer.
>
> Can somebody give me any pointer if such function exists or not?
>
> Thanks and regards,
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



------------------------------

Message: 45
Date: Tue, 29 Oct 2013 21:37:44 +0100
From: andrija djurovic <djandrija@gmail.com>

Cc: "r-help@r-project.org" <r-help@r-project.org>
Subject: Re: [R] R function to locate Excel sheet?
Message-ID:
        <CABcwgRRCJFJ9ub0Fr_eL2yPxpVOd+mfTRoSXOyWhLsZsWsEKSw@mail.gmail.com>
Content-Type: text/plain

Hi here is the solutions using XLConnect package:

library(XLConnect)
wb <- loadWorkbook(path to your Excel file)
 c("particular sheet name")%in%getSheets(wb)

Andrija








> Hi,
>
> I am looking for some R function which will tell me, whether a particular
> sheet in an Excel file (.xlsx/.xls) exists or not. I just need to get some
> TRUE/FALSE type of answer.
>
> Can somebody give me any pointer if such function exists or not?
>
> Thanks and regards,
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



------------------------------

Message: 46
Date: Tue, 29 Oct 2013 20:42:47 +0000
From: Rui Barradas <ruipbarradas@sapo.pt>
To: Petar Milin <pmilin@gmail.com>, HELP-R-HELP
        <r-help@stat.math.ethz.ch>
Subject: Re: [R] How to save very large matrix?
Message-ID: <52701DC7.8000808@sapo.pt>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed

Hello,

You can use the argument to write.csv or write.table  append = TRUE to
write the matrix in chunks. Something like the following.



bigwrite <- function(x, file, rows = 1000L, ...){
        passes <- NROW(x) %/% rows
        remaining <- NROW(x) %% rows
        k <- 1L
        write.table(x[k:rows, ], file, row.names = FALSE, ...)
        k <- k + rows
        for(i in seq_len(passes)[-1]){
                write.table(x[k:(rows*i), ], file, append = TRUE, row.names
= FALSE,
col.names = FALSE, ...)
                k <- k + rows
        }
        if(remaining > 0)
                write.table(x[k:NROW(x), ], file, append = TRUE, row.names
= FALSE,
col.names = FALSE, ...)
}

f <- "temp"
m <- matrix(0, 50012, 10)

bigwrite(m, f, sep = ",")  # Use 'sep' to get a csv file



Hope this helps,

Rui Barradas


Em 29-10-2013 19:27, Petar Milin escreveu:
> Hello!
> I have a very large matrix of results: 50000x100000. I saved it as RDS,
but I would also need to save it as txt or csv. Is there a way to do it?
Now, with write.table I am receiving an error:
> Error in .External2(C_writetable, x, file, nrow(x), p, rnames, sep, eol,
:
>    long vectors not supported yet: io.c:1116
>
[[elided Yahoo spam]]
>
> PM
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>



------------------------------

Message: 47
Date: Tue, 29 Oct 2013 21:47:07 +0100
From: Eik Vettorazzi <E.Vettorazzi@uke.de>
To: "Thaler,Thorn,LAUSANNE,Applied Mathematics"
        <Thorn.Thaler@rdls.nestle.com>, "R-Help Mailing List
        (r-help@r-project.org)" <r-help@r-project.org>
Subject: Re: [R] Automatically Remove Aliased Terms from a Model
Message-ID: <52701ECB.30101@uke.de>
Content-Type: text/plain; charset="iso-8859-1"

Hi Thorn,
it is not entirely clear (at least for me) what you want to accomplish.
an easy and fail safe way of extracting used terms in a (g)lm-object is
names(model.frame(l))
if you want to extract terms to finally select a model, have a look at
drop1 and/or MASS::dropterm

Hth

Am 28.10.2013 17:19, schrieb Thaler,Thorn,LAUSANNE,Applied Mathematics:
> Dear all,
>
> I am trying to implement a function which removes aliased terms from a
model. The challenge I am facing is that with "alias" I get the aliased
coefficients of the model, which I have to translate into the terms from
the model formula. What I have tried so far:
>
> ------------------8<------------------
> d <- expand.grid(a = 0:1, b=0:1)
> d$c <- (d$a + d$b)  %% 2
> d$y <- rnorm(4)
> d <- within(d, {a <- factor(a); b <- factor(b); c <- factor(c)})
> l <- lm(y ~ a * b + c, d)
>
> removeAliased <- function(mod) {
>   ## Retrieve all terms in the model
>   X <- attr(mod$terms, "term.label")
>   ## Get the aliased coefficients
>   rn <- rownames(alias(mod)$Complete)
>   ## remove factor levels from coefficient names to retrieve the terms
>   regex.base <- unique(unlist(lapply(mod$model[, sapply(mod$model,
is.factor)], levels)))
>   aliased <- gsub(paste(regex.base, "$", sep = "", collapse = "|"),  "",
gsub(paste(regex.base, ":", sep = "", collapse = "|"), ":", rn))
>   uF <- formula(paste(". ~ .", paste(aliased, collapse = "-"), sep = "-"))
>   update(mod, uF)
> }
>
> removeAliased(l)
> ------------------>8------------------
>
> This function works in principle, but this workaround with removing the
factor levels is just, well, a workaround which could cause problems in
some circumstances (when the name of a level matches the end of another
variable, when I use a different contrast and R names the coefficients
differently etc. - and I am not sure which other cases I am overlooking).
>
> So my question is whether there are some more intelligent ways of doing
what I want to achieve? Is there a function to translate a coefficient of a
LM back to the term, something like:
>
> termFromCoef("a1") ## a1
> termFromCoef("a1:b1") ## a:b
>
> With this I could simply translate the rownames from alias into the terms
needed for the model update.
>
> Thanks for your help.
>
> Kind Regards,
>
> Thorn Thaler
> NRC Lausanne
> Applied Mathematics
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

--
Eik Vettorazzi

Department of Medical Biometry and Epidemiology
University Medical Center Hamburg-Eppendorf

Martinistr. 52
20246 Hamburg

T ++49/40/7410-58243
F ++49/40/7410-57790
--

Besuchen Sie uns auf: www.uke.de
_____________________________________________________________________

Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen
Rechts; Gerichtsstand: Hamburg
Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Prof. Dr. Dr.
Uwe Koch-Gromus, Joachim Pr?l?, Rainer Schoppik
_____________________________________________________________________

SAVE PAPER - THINK BEFORE PRINTING



------------------------------

Message: 48
Date: Tue, 29 Oct 2013 14:06:55 -0700 (PDT)

To: R help <r-help@r-project.org>
Subject: Re: [R] Mean error
Message-ID:
        <1383080815.87521.YahooMailNeo@web142604.mail.bf1.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1

Hi,
Try either:
res1 <- apply(mydata[,1:2],2,mean)
?res2 <- colMeans(mydata[,1:2])
?identical(res1,res2)
#[1] TRUE

# Also if you need to find means for each group ("Ungrazed vs. "Grazed")
by(mydata[,-3],mydata[,3],colMeans)

#or if column names are "V1", "V2", "V3"
aggregate(.~V3,mydata,mean)
#or
library(plyr)
?ddply(mydata,.(V3),numcolwise(mean))


A.K.


I have a data set with two columns of data that I want to find the mean of.
?
1 ? 6.225 ?59.77 Ungrazed
2 ? 6.487 ?60.98 Ungrazed
3 ? 4.919 ?14.73 Ungrazed
4 ? 5.130 ?19.28 Ungrazed
5 ? 5.417 ?34.25 Ungrazed
6 ? 5.359 ?35.53 Ungrazed
7 ? 7.614 ?87.73 Ungrazed
8 ? 6.352 ?63.21 Ungrazed
9 ? 4.975 ?24.25 Ungrazed
10 ?6.930 ?64.34 Ungrazed
11 ?6.248 ?52.92 Ungrazed
12 ?5.451 ?32.35 Ungrazed
13 ?6.013 ?53.61 Ungrazed
14 ?5.928 ?54.86 Ungrazed
15 ?6.264 ?64.81 Ungrazed
16 ?7.181 ?73.24 Ungrazed
17 ?7.001 ?80.64 Ungrazed
18 ?4.426 ?18.89 Ungrazed
19 ?7.302 ?75.49 Ungrazed
20 ?5.836 ?46.73 Ungrazed
21 10.253 116.05 Ungrazed
22 ?6.958 ?38.94 ? Grazed
23 ?8.001 ?60.77 ? Grazed
24 ?9.039 ?84.37 ? Grazed
25 ?8.910 ?70.11 ? Grazed
26 ?6.106 ?14.95 ? Grazed
27 ?7.691 ?70.70 ? Grazed
28 ?8.988 ?80.31 ? Grazed
29 ?8.975 ?82.35 ? Grazed
30 ?9.844 105.07 ? Grazed
31 ?8.508 ?73.79 ? Grazed
32 ?7.354 ?50.08 ? Grazed
33 ?8.643 ?78.28 ? Grazed
34 ?7.916 ?41.48 ? Grazed
35 ?9.351 ?98.47 ? Grazed
36 ?7.066 ?40.15 ? Grazed
37 ?8.158 ?52.26 ? Grazed
38 ?7.382 ?46.64 ? Grazed
39 ?8.515 ?71.01 ? Grazed
40 ?8.530 ?83.03 ? Grazed

This is from an introduction handout that instructs me to enter the command
>mean(mydata[,1:2])
but when I enter it, I get an error message
Warning message:
In mean.default(mydata[, 1:2]) :
? argument is not numeric or logical: returning NA
I've tried tacking on na.rm=T to the end of it, but I get the same
message. Can someone tell me what I'm doing wrong, or how to fix it?

I've tried searching the forum, but can't find a post relevant to this
problem.



------------------------------

Message: 49
Date: Tue, 29 Oct 2013 21:16:50 +0000
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
To: Rui Barradas <ruipbarradas@sapo.pt>, Petar Milin
        <pmilin@gmail.com>,     HELP-R-HELP <r-help@stat.math.ethz.ch>
Subject: Re: [R] How to save very large matrix?
Message-ID: <527025C2.6050409@stats.ox.ac.uk>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed

On 29/10/2013 20:42, Rui Barradas wrote:
> Hello,
>
> You can use the argument to write.csv or write.table  append = T...

[Message clipped]  View entire message Reply Forward




14% full
Using 4.44 GB of your 30 GBŠ2013 Google - Terms of Service - Privacy Policy
- Programme Policies
Powered by Last account activity: 19 hours ago
DetailsPeople (2)r-help-request
r-help-request@r-project.org



Show details

14% fullUsing 4.44 GB of your 30 GBŠ2013 Google - Terms of Service -
Privacy Policy - Programme Policies Powered by Last account activity: 19
hours agoDetailsYou have 2 new messages.

Companies Act 2006 : http://www.londonmet.ac.uk/companyinfo

	[[alternative HTML version deleted]]

