[R] coeftest() R squared

2017-02-14 Thread T.Riedle

Dear all,
I want to run a regression using lm() with Newey West corrected standard errors.

This is the code

Reg<-lm(g~sent + liquidity + Cape, data=dataUsa)
CoefNW<-coeftest(Reg, vcov.=NeweyWest)
CoefNW

In contrast to summary(Reg) the output of CoefNW neither returns the adjusted R 
squared nor the F-statistic. How can I obtain the R squared for coeftest? 
Alternatively, how do I get robust standard errors and the R squared of the 
regression?
Thanks for your help.

__
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.


Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Hervé Pagès

On 02/14/2017 06:39 PM, Bert Gunter wrote:

Yes, exactly.

So my point is that this:

  "X: a vector-like object that supports subsetting with `[`, typically
 an atomic vector."

is incorrect, or at least a bit opaque, without further emphasizing
that FUN must accept the result of "[".


Maybe this kind of details belong to the description of the FUN
argument. However please note that the man page for lapply() or the
other *apply() functions don't emphasize the fact that the supplied
FUN must be a function that accepts the things it applies to either,
and nobody seems to make a big deal of it. Maybe because it's obvious?


With atomic vectors, the error
that you produced was obvious, but with lists, I believe not so.


Well, it's the same error. Maybe what's not obvious is that in both
cases the error is coming from sum(), not from tapply() itself.
sum() is complaining that it receives something that it doesn't
know how to handle. The clue is in how the error message starts:

  Error in FUN(X[[i]], ...):

Maybe one could argue this is a little bit cryptic. Note the difference
when the error is coming from tapply() itself:

  > X <- letters[1:9]
  > INDEX <- c(rep(1,5),rep(2,5))
  > tapply(X, INDEX, FUN=identity)
  Error in tapply(X, INDEX, FUN = identity) :
arguments must have same length

H.


I Appreciate the desire for brevity, but I think clarity should be the
primary goal. Maybe it *is* just me, but I think a few extra words of
explanation here would not go amiss.

But, anyway, thanks for the clarification.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 6:04 PM, Hervé Pagès  wrote:

Right. More precisely the function passed thru the FUN argument must
work on the subsets of X generated internally by tapply(). You can
actually see these subsets by passing the identity function:

  X <- letters[1:10]
  INDEX <- c(rep(1,5),rep(2,5))
  tapply(X, INDEX, FUN=identity)
  # $`1`
  # [1] "a" "b" "c" "d" "e"
  #
  # $`2`
  # [1] "f" "g" "h" "i" "j"

Doing this shows you how tapply() splits the vector-like object X into
a list of subsets. If you replace the identity function with a function
that cannot be applied to these subsets, then you get an error:

  tapply(X, INDEX, FUN=sum)
  # Error in FUN(X[[i]], ...) : invalid 'type' (character) of argument

As you can see, here we get an error even though X is an atomic vector.

H.



On 02/14/2017 05:41 PM, Richard M. Heiberger wrote:


The problem with Bert's second example is that sum doesn't work on a list.
The tapply worked correctly.


unlist(l[1:5])


[1] 1 2 3 4 5


sum(l[1:5])


Error in sum(l[1:5]) : invalid 'type' (list) of argument



On Tue, Feb 14, 2017 at 8:28 PM, Bert Gunter 
wrote:


Hervé:

Kindly explain this, then:


l <- as.list(1:10)
is.atomic(l) # FALSE


[1] FALSE


index <- c(rep(1,5),rep(2,5))


tapply(l,index,unlist)


$`1`
[1] 1 2 3 4 5

$`2`
[1]  6  7  8  9 10



## But

tapply(l,index, sum)


Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 5:10 PM, Hervé Pagès 
wrote:


Hi,

tapply() will work on any object 'X' that has a length and supports
single-bracket subsetting. These objects are sometimes called
"vector-like" objects. Atomic vectors, lists, S4 objects with a "length"
and "[" method, etc... are examples of "vector-like" objects.

So instead of saying

  X: an atomic object, typically a vector.

I think it would be more accurate if the man page was saying something
like

  X: a vector-like object that supports subsetting with `[`, typically
 an atomic vector.

H.

On 02/04/2017 04:17 AM, Tal Galili wrote:



In the help page of ?tapply it says that the first argument (X) is "an
atomic object, typically a vector."

However, tapply seems to be able to handle list objects. For example:

###

l <- as.list(1:10)
is.atomic(l) # FALSE
index <- c(rep(1,5),rep(2,5))
tapply(l,index,unlist)


tapply(l,index,unlist)



$`1`
[1] 1 2 3 4 5

$`2`
[1]  6  7  8  9 10


###

Hence, does it mean a list an atomic object? (which I thought it
wasn't)
or
is the help for tapply needs updating?
(or some third option I'm missing?)

Thanks.





Contact
Details:---
Contact me: tal.gal...@gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew)
|
www.r-statistics.com (English)


--

[[alternative HTML version deleted]]


Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Bert Gunter
Yes, exactly.

So my point is that this:

  "X: a vector-like object that supports subsetting with `[`, typically
 an atomic vector."

is incorrect, or at least a bit opaque, without further emphasizing
that FUN must accept the result of "[". With atomic vectors, the error
that you produced was obvious, but with lists, I believe not so. I
Appreciate the desire for brevity, but I think clarity should be the
primary goal. Maybe it *is* just me, but I think a few extra words of
explanation here would not go amiss.

But, anyway, thanks for the clarification.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 6:04 PM, Hervé Pagès  wrote:
> Right. More precisely the function passed thru the FUN argument must
> work on the subsets of X generated internally by tapply(). You can
> actually see these subsets by passing the identity function:
>
>   X <- letters[1:10]
>   INDEX <- c(rep(1,5),rep(2,5))
>   tapply(X, INDEX, FUN=identity)
>   # $`1`
>   # [1] "a" "b" "c" "d" "e"
>   #
>   # $`2`
>   # [1] "f" "g" "h" "i" "j"
>
> Doing this shows you how tapply() splits the vector-like object X into
> a list of subsets. If you replace the identity function with a function
> that cannot be applied to these subsets, then you get an error:
>
>   tapply(X, INDEX, FUN=sum)
>   # Error in FUN(X[[i]], ...) : invalid 'type' (character) of argument
>
> As you can see, here we get an error even though X is an atomic vector.
>
> H.
>
>
>
> On 02/14/2017 05:41 PM, Richard M. Heiberger wrote:
>>
>> The problem with Bert's second example is that sum doesn't work on a list.
>> The tapply worked correctly.
>>
>>> unlist(l[1:5])
>>
>> [1] 1 2 3 4 5
>>
>>> sum(l[1:5])
>>
>> Error in sum(l[1:5]) : invalid 'type' (list) of argument
>>
>>
>>
>> On Tue, Feb 14, 2017 at 8:28 PM, Bert Gunter 
>> wrote:
>>>
>>> Hervé:
>>>
>>> Kindly explain this, then:
>>>
 l <- as.list(1:10)
 is.atomic(l) # FALSE
>>>
>>> [1] FALSE

 index <- c(rep(1,5),rep(2,5))


 tapply(l,index,unlist)
>>>
>>> $`1`
>>> [1] 1 2 3 4 5
>>>
>>> $`2`
>>> [1]  6  7  8  9 10
>>>

 ## But

 tapply(l,index, sum)
>>>
>>> Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument
>>>
>>> Cheers,
>>> Bert
>>> Bert Gunter
>>>
>>> "The trouble with having an open mind is that people keep coming along
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>>
>>>
>>> On Tue, Feb 14, 2017 at 5:10 PM, Hervé Pagès 
>>> wrote:

 Hi,

 tapply() will work on any object 'X' that has a length and supports
 single-bracket subsetting. These objects are sometimes called
 "vector-like" objects. Atomic vectors, lists, S4 objects with a "length"
 and "[" method, etc... are examples of "vector-like" objects.

 So instead of saying

   X: an atomic object, typically a vector.

 I think it would be more accurate if the man page was saying something
 like

   X: a vector-like object that supports subsetting with `[`, typically
  an atomic vector.

 H.

 On 02/04/2017 04:17 AM, Tal Galili wrote:
>
>
> In the help page of ?tapply it says that the first argument (X) is "an
> atomic object, typically a vector."
>
> However, tapply seems to be able to handle list objects. For example:
>
> ###
>
> l <- as.list(1:10)
> is.atomic(l) # FALSE
> index <- c(rep(1,5),rep(2,5))
> tapply(l,index,unlist)
>
>> tapply(l,index,unlist)
>
>
> $`1`
> [1] 1 2 3 4 5
>
> $`2`
> [1]  6  7  8  9 10
>
>
> ###
>
> Hence, does it mean a list an atomic object? (which I thought it
> wasn't)
> or
> is the help for tapply needs updating?
> (or some third option I'm missing?)
>
> Thanks.
>
>
>
>
>
> Contact
> Details:---
> Contact me: tal.gal...@gmail.com |
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew)
> |
> www.r-statistics.com (English)
>
>
> --
>
> [[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.
>

 --
 Hervé Pagès

 Program in Computational Biology

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Hervé Pagès

Right. More precisely the function passed thru the FUN argument must
work on the subsets of X generated internally by tapply(). You can
actually see these subsets by passing the identity function:

  X <- letters[1:10]
  INDEX <- c(rep(1,5),rep(2,5))
  tapply(X, INDEX, FUN=identity)
  # $`1`
  # [1] "a" "b" "c" "d" "e"
  #
  # $`2`
  # [1] "f" "g" "h" "i" "j"

Doing this shows you how tapply() splits the vector-like object X into
a list of subsets. If you replace the identity function with a function
that cannot be applied to these subsets, then you get an error:

  tapply(X, INDEX, FUN=sum)
  # Error in FUN(X[[i]], ...) : invalid 'type' (character) of argument

As you can see, here we get an error even though X is an atomic vector.

H.


On 02/14/2017 05:41 PM, Richard M. Heiberger wrote:

The problem with Bert's second example is that sum doesn't work on a list.
The tapply worked correctly.


unlist(l[1:5])

[1] 1 2 3 4 5


sum(l[1:5])

Error in sum(l[1:5]) : invalid 'type' (list) of argument



On Tue, Feb 14, 2017 at 8:28 PM, Bert Gunter  wrote:

Hervé:

Kindly explain this, then:


l <- as.list(1:10)
is.atomic(l) # FALSE

[1] FALSE

index <- c(rep(1,5),rep(2,5))


tapply(l,index,unlist)

$`1`
[1] 1 2 3 4 5

$`2`
[1]  6  7  8  9 10



## But

tapply(l,index, sum)

Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 5:10 PM, Hervé Pagès  wrote:

Hi,

tapply() will work on any object 'X' that has a length and supports
single-bracket subsetting. These objects are sometimes called
"vector-like" objects. Atomic vectors, lists, S4 objects with a "length"
and "[" method, etc... are examples of "vector-like" objects.

So instead of saying

  X: an atomic object, typically a vector.

I think it would be more accurate if the man page was saying something
like

  X: a vector-like object that supports subsetting with `[`, typically
 an atomic vector.

H.

On 02/04/2017 04:17 AM, Tal Galili wrote:


In the help page of ?tapply it says that the first argument (X) is "an
atomic object, typically a vector."

However, tapply seems to be able to handle list objects. For example:

###

l <- as.list(1:10)
is.atomic(l) # FALSE
index <- c(rep(1,5),rep(2,5))
tapply(l,index,unlist)


tapply(l,index,unlist)


$`1`
[1] 1 2 3 4 5

$`2`
[1]  6  7  8  9 10


###

Hence, does it mean a list an atomic object? (which I thought it wasn't)
or
is the help for tapply needs updating?
(or some third option I'm missing?)

Thanks.





Contact
Details:---
Contact me: tal.gal...@gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)

--

[[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.



--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fredhutch.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

__
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.


--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fredhutch.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

__
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.

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Richard M. Heiberger
The problem with Bert's second example is that sum doesn't work on a list.
The tapply worked correctly.

> unlist(l[1:5])
[1] 1 2 3 4 5

> sum(l[1:5])
Error in sum(l[1:5]) : invalid 'type' (list) of argument



On Tue, Feb 14, 2017 at 8:28 PM, Bert Gunter  wrote:
> Hervé:
>
> Kindly explain this, then:
>
>> l <- as.list(1:10)
>> is.atomic(l) # FALSE
> [1] FALSE
>> index <- c(rep(1,5),rep(2,5))
>>
>>
>> tapply(l,index,unlist)
> $`1`
> [1] 1 2 3 4 5
>
> $`2`
> [1]  6  7  8  9 10
>
>>
>> ## But
>>
>> tapply(l,index, sum)
> Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument
>
> Cheers,
> Bert
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Tue, Feb 14, 2017 at 5:10 PM, Hervé Pagès  wrote:
>> Hi,
>>
>> tapply() will work on any object 'X' that has a length and supports
>> single-bracket subsetting. These objects are sometimes called
>> "vector-like" objects. Atomic vectors, lists, S4 objects with a "length"
>> and "[" method, etc... are examples of "vector-like" objects.
>>
>> So instead of saying
>>
>>   X: an atomic object, typically a vector.
>>
>> I think it would be more accurate if the man page was saying something
>> like
>>
>>   X: a vector-like object that supports subsetting with `[`, typically
>>  an atomic vector.
>>
>> H.
>>
>> On 02/04/2017 04:17 AM, Tal Galili wrote:
>>>
>>> In the help page of ?tapply it says that the first argument (X) is "an
>>> atomic object, typically a vector."
>>>
>>> However, tapply seems to be able to handle list objects. For example:
>>>
>>> ###
>>>
>>> l <- as.list(1:10)
>>> is.atomic(l) # FALSE
>>> index <- c(rep(1,5),rep(2,5))
>>> tapply(l,index,unlist)
>>>
 tapply(l,index,unlist)
>>>
>>> $`1`
>>> [1] 1 2 3 4 5
>>>
>>> $`2`
>>> [1]  6  7  8  9 10
>>>
>>>
>>> ###
>>>
>>> Hence, does it mean a list an atomic object? (which I thought it wasn't)
>>> or
>>> is the help for tapply needs updating?
>>> (or some third option I'm missing?)
>>>
>>> Thanks.
>>>
>>>
>>>
>>>
>>>
>>> Contact
>>> Details:---
>>> Contact me: tal.gal...@gmail.com |
>>> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
>>> www.r-statistics.com (English)
>>>
>>> --
>>>
>>> [[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.
>>>
>>
>> --
>> Hervé Pagès
>>
>> Program in Computational Biology
>> Division of Public Health Sciences
>> Fred Hutchinson Cancer Research Center
>> 1100 Fairview Ave. N, M1-B514
>> P.O. Box 19024
>> Seattle, WA 98109-1024
>>
>> E-mail: hpa...@fredhutch.org
>> Phone:  (206) 667-5791
>> Fax:(206) 667-1319
>>
>> __
>> 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.

__
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.

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Bert Gunter
Hervé:

Kindly explain this, then:

> l <- as.list(1:10)
> is.atomic(l) # FALSE
[1] FALSE
> index <- c(rep(1,5),rep(2,5))
>
>
> tapply(l,index,unlist)
$`1`
[1] 1 2 3 4 5

$`2`
[1]  6  7  8  9 10

>
> ## But
>
> tapply(l,index, sum)
Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 5:10 PM, Hervé Pagès  wrote:
> Hi,
>
> tapply() will work on any object 'X' that has a length and supports
> single-bracket subsetting. These objects are sometimes called
> "vector-like" objects. Atomic vectors, lists, S4 objects with a "length"
> and "[" method, etc... are examples of "vector-like" objects.
>
> So instead of saying
>
>   X: an atomic object, typically a vector.
>
> I think it would be more accurate if the man page was saying something
> like
>
>   X: a vector-like object that supports subsetting with `[`, typically
>  an atomic vector.
>
> H.
>
> On 02/04/2017 04:17 AM, Tal Galili wrote:
>>
>> In the help page of ?tapply it says that the first argument (X) is "an
>> atomic object, typically a vector."
>>
>> However, tapply seems to be able to handle list objects. For example:
>>
>> ###
>>
>> l <- as.list(1:10)
>> is.atomic(l) # FALSE
>> index <- c(rep(1,5),rep(2,5))
>> tapply(l,index,unlist)
>>
>>> tapply(l,index,unlist)
>>
>> $`1`
>> [1] 1 2 3 4 5
>>
>> $`2`
>> [1]  6  7  8  9 10
>>
>>
>> ###
>>
>> Hence, does it mean a list an atomic object? (which I thought it wasn't)
>> or
>> is the help for tapply needs updating?
>> (or some third option I'm missing?)
>>
>> Thanks.
>>
>>
>>
>>
>>
>> Contact
>> Details:---
>> Contact me: tal.gal...@gmail.com |
>> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
>> www.r-statistics.com (English)
>>
>> --
>>
>> [[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.
>>
>
> --
> Hervé Pagès
>
> Program in Computational Biology
> Division of Public Health Sciences
> Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N, M1-B514
> P.O. Box 19024
> Seattle, WA 98109-1024
>
> E-mail: hpa...@fredhutch.org
> Phone:  (206) 667-5791
> Fax:(206) 667-1319
>
> __
> 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.

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Hervé Pagès

Hi,

tapply() will work on any object 'X' that has a length and supports
single-bracket subsetting. These objects are sometimes called
"vector-like" objects. Atomic vectors, lists, S4 objects with a "length"
and "[" method, etc... are examples of "vector-like" objects.

So instead of saying

  X: an atomic object, typically a vector.

I think it would be more accurate if the man page was saying something
like

  X: a vector-like object that supports subsetting with `[`, typically
 an atomic vector.

H.

On 02/04/2017 04:17 AM, Tal Galili wrote:

In the help page of ?tapply it says that the first argument (X) is "an
atomic object, typically a vector."

However, tapply seems to be able to handle list objects. For example:

###

l <- as.list(1:10)
is.atomic(l) # FALSE
index <- c(rep(1,5),rep(2,5))
tapply(l,index,unlist)


tapply(l,index,unlist)

$`1`
[1] 1 2 3 4 5

$`2`
[1]  6  7  8  9 10


###

Hence, does it mean a list an atomic object? (which I thought it wasn't) or
is the help for tapply needs updating?
(or some third option I'm missing?)

Thanks.





Contact
Details:---
Contact me: tal.gal...@gmail.com |
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
--

[[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.



--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fredhutch.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

__
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.


[ESS] Help in compiling ESS

2017-02-14 Thread Paola.Giovannini
Dear ESS experts,

I've always been using emacs as an editor and recently I started to work with 
R, therefore I would be very happy to be able to use the functionality of ESS.

I don't have my own linux computer but I use machines on a farm, so I don't 
have access to the installation of emacs or R.
The linux distribution installed is:

Distributor ID: RedHatEnterpriseServer
Description:Red Hat Enterprise Linux Server release 5.11 (Tikanga)
Release:5.11
Codename:   Tikanga


I tried to install ESS in my home and to compile it, but I get this errors:

:/home/giovannp/ess/ess-16.10$
|=> ls
COPYINGMakeconf  README.mdVERSION  ess-autoloads.el  install-sh 
rsn.txt
ChangeLog  Makefile  RPM.spec debian   etc   lisp   test
LDAOONEWSRPM.spec.in  doc  fontlock-test mkinstalldirs
:/home/giovannp/ess/ess-16.10$
|=> make
cd etc; make all
make[1]: Entering directory `/home/giovannp/ess/ess-16.10/etc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/giovannp/ess/ess-16.10/etc'
cd lisp; make all
make[1]: Entering directory `/home/giovannp/ess/ess-16.10/lisp'
emacs -batch -no-site-file -no-init-file -l ./ess-comp.el -f batch-byte-compile 
ess-custom.el
loading 'ess-compat ..
loading 'ess-custom ..
Symbol's function definition is void: defvaralias
make[1]: *** [ess-custom.elc] Error 255
make[1]: Leaving directory `/home/giovannp/ess/ess-16.10/lisp'
make: *** [all] Error 2


The functionality I mostly need is the text highlighting, is there somethink I 
can do?

Thanks
Paola.


[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R-es] problemas con rBIND con distintos número de columnas

2017-02-14 Thread Carlos Ortega
​Hola,

Recordaba que sí que se podía hacer con data.table
Efectivamente...


> library(data.table)
> x_dt <- data.table( a= rnorm(10), b = rnorm(10))
> y_dt <- data.table(  a= rnorm(10), b = rnorm(10), c = rnorm(10))
>
> l <- list(x_dt, y_dt)
> rbindlist(l, fill = TRUE)
  a   b   c
 1:  0.40654327  1.57344885  NA
 2:  0.08165417  0.15028804  NA
 3:  0.37026494 -1.18386924  NA
 4: -0.93010544  2.24961712  NA
 5:  0.10843810  0.24032676  NA
 6:  0.15378877 -0.78666170  NA
 7:  1.03502437 -0.55456852  NA
 8:  0.72717696 -0.08930502  NA
 9:  2.33360032  0.85764087  NA
10: -0.13165594  1.90335605  NA
11: -0.58854517 -0.65231258 -2.08017763
12: -0.44410190 -0.60729636  0.75419119
13: -0.12112606 -2.95377291 -0.81158886
14: -0.16889601 -0.17042251  0.08904027
15:  0.09432534 -0.91301852  0.49149478
16: -1.19009027 -3.08695232  0.80642330
17:  0.50699299  0.32040260 -0.84056240
18: -0.89214614  0.33931926 -0.20491751
19:  0.55252772  2.09847775  0.28919268
20: -1.20012169 -1.17608943 -1.55813564

​
Saludos,
Carlos Ortega
www.qualityexcellence.es


El 14 de febrero de 2017, 19:09, Javier Valdes Cantallopts (DGA) <
javier.val...@mop.gov.cl> escribió:

> Hola Carlos:
>
> Tanto *rbind(base)*  como *rbind(data.table)* generan el mismo resultado *que
> no busco*.
>
> Que solución se le podría dar específicamente a la data de 11 columnas,
> que es la que me da problema.
>
> Saludos.
>
>
>
> [image: Descripción: FIRMA2]
>
>
>
> *De:* Carlos Ortega [mailto:c...@qualityexcellence.es]
> *Enviado el:* martes, 14 de febrero de 2017 14:21
> *Para:* Javier Valdes Cantallopts (DGA)
> *CC:* r-help-es@r-project.org
> *Asunto:* Re: problemas con rBIND con distintos número de columnas
>
>
>
> Hola Javier,
>
>
>
> Mientras que el "rbind()" que proporciona el paquete "base" en este caso
> te dará un error.
>
> El "rbind" que proporciona el paquete "data.table", creo que no lo da...
>
>
>
> Siempre puedes rellenar esos huecos con NAs en el data.frame al que le
> falte antes de juntarlas... y evitarte el trastorno.
>
>
>
> Saludos,
>
> Carlos Ortega
>
> www.qualityexcellence.es
>
>
>
> El 14 de febrero de 2017, 16:15, Javier Valdes Cantallopts (DGA) <
> javier.val...@mop.gov.cl> escribió:
>
> Hola a todos:
>
> Necesito pegar 4 bases de datos de N variables y N columnas, EL PROBLEMA
> ES QUE 3 *CONSTAN DE 13 COLUMNAS*, y LA CUARTA CON *11 COLUMNAS*.
>
> He *usado rbind y smartbind*, sin embargo el resultado no es el esperado,
> ya que coloca las columnas a un costado y no hacia abajo como debería
>
> Como resultado necesito algo como LO QUE PRESENTO ABAJO, *RELLENANDO LOS
> ESPACIOS VACIOS CON “NA”*
>
>
>
> 30/03/15 7:00
>
> 38
>
> 13.28
>
> 275.4431
>
> -1.667118
>
> 638.5
>
> -1.459
>
> 3.08
>
> 175.5
>
> -130
>
> -64.52
>
> *Na*
>
> *Na*
>
> 30/03/15 8:00
>
> 39
>
> 13.27
>
> 273.3796
>
> -0.9093614
>
> 638.5
>
> -1.386
>
> 4.099
>
> 151.6
>
> -129.9
>
> -64.42
>
> *Na*
>
> *Na*
>
> 30/03/15 9:00
>
> 40
>
> 13.21
>
> 275.5319
>
> 19.8293
>
> 638.6
>
> -1.39
>
> 3.573
>
> 138.7
>
> -129.8
>
> -64.34
>
> *Na*
>
> *Na*
>
> 30/03/15 10:00
>
> 41
>
> 13.25
>
> 278.6717
>
> 69.58882
>
> 638.8
>
> -1.227
>
> 4.193
>
> 174.4
>
> -129.8
>
> -64.3
>
> *Na*
>
> *Na*
>
> 30/03/15 11:00
>
> 42
>
> 13.59
>
> 276.256
>
> 153.4836
>
> 638.9
>
> -0.888
>
> 4.291
>
> 39.6
>
> -129.8
>
> -64.35
>
> *Na*
>
> *Na*
>
> 30/03/15 12:00
>
> 43
>
> 14.71
>
> 276.9799
>
> 233.9256
>
> 639
>
> -0.587
>
> 3.561
>
> 133.1
>
> -129.9
>
> -64.44
>
> *Na*
>
> *Na*
>
> 30/03/15 13:00
>
> 44
>
> 14.56
>
> 265.1613
>
> 449.0849
>
> 639.3
>
> -0.011
>
> 3.624
>
> 180.1
>
> -130
>
> -64.53
>
> *Na*
>
> *Na*
>
> 30/03/15 14:00
>
> 45
>
> 14.51
>
> 268.376
>
> 418.3066
>
> 639.6
>
> 0.2
>
> 3.885
>
> 138.3
>
> -130.3
>
> -64.82
>
> *Na*
>
> *Na*
>
> 28/03/15 16:40
>
> 0
>
> 12.96
>
> 0
>
> 168.4
>
> -28.4
>
> 13.01
>
> 697.9466
>
> 5.268066
>
> 278.4181
>
> -111.8081
>
> 228.8923
>
> 620.3669
>
> 28/03/15 16:50
>
> 1
>
> 12.99
>
> 3.473
>
> 248.3
>
> -33.81
>
> 8.52
>
> 644.0493
>
> 5.009216
>
> 278.1592
>
> -110.2677
>
> 229.1674
>
> 590.3563
>
> 28/03/15 17:00
>
> 2
>
> 12.99
>
> 3.917
>
> 174.7
>
> -38.64
>
> 4.529
>
> 644.2397
>
> 4.819122
>
> 277.9691
>
> -111.376
>
> 227.1322
>
> 556.6758
>
>
>
> SALUDOS.
>
>
>
>
>
>
>
>
>
>
>
>
>
> [image: Descripción: FIRMA2]
>
>
>
>
> --
>
>
> CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los
> archivos adjuntos es de carácter confidencial o privilegiada y está
> destinada al uso exclusivo del emisor y/o de la persona o entidad a quien
> va dirigida. Si usted no es el destinatario, cualquier almacenamiento,
> divulgación, distribución o copia de esta información está estrictamente
> prohibido y sancionado por la ley. Si recibió este mensaje por error, por
> favor infórmenos inmediatamente respondiendo este mismo mensaje y borre
> todos los archivos adjuntos. Gracias.
>
> 

Re: [R] Is a list an atomic object? (or is there an issue with the help page of ?tapply ?)

2017-02-14 Thread Bert Gunter
Did you ever receive a reply to this?

Note that for your example:
> tapply(l,index,sum)
Error in FUN(X[[i]], ...) : invalid 'type' (list) of argument

A list is definitely not atomic (is.recursive(l) ).

So it looks like a "quirk" that FUN = unlist doesn't raise an error.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sat, Feb 4, 2017 at 4:17 AM, Tal Galili  wrote:
> In the help page of ?tapply it says that the first argument (X) is "an
> atomic object, typically a vector."
>
> However, tapply seems to be able to handle list objects. For example:
>
> ###
>
> l <- as.list(1:10)
> is.atomic(l) # FALSE
> index <- c(rep(1,5),rep(2,5))
> tapply(l,index,unlist)
>
>> tapply(l,index,unlist)
> $`1`
> [1] 1 2 3 4 5
>
> $`2`
> [1]  6  7  8  9 10
>
>
> ###
>
> Hence, does it mean a list an atomic object? (which I thought it wasn't) or
> is the help for tapply needs updating?
> (or some third option I'm missing?)
>
> Thanks.
>
>
>
>
>
> Contact
> Details:---
> Contact me: tal.gal...@gmail.com |
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> --
>
> [[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.

__
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.


Re: [R-es] problemas con rBIND con distintos número de columnas

2017-02-14 Thread Xavi tibau alberdi
Buenas,

lo que buscas se puede hacer con el paquete dplyr, con el comando
full_join(). dplyr es extremadamente recomendable para la manipulación de
datasets, y en general todos los paquetes incluidos en tidyverse..

Aquí tienes el cheatsheat:
https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf

Un saludo,

Xavier Tibau

2017-02-14 19:09 GMT+01:00 Javier Valdes Cantallopts (DGA) <
javier.val...@mop.gov.cl>:

> Hola Carlos:
>
> Tanto *rbind(base)*  como *rbind(data.table)* generan el mismo resultado *que
> no busco*.
>
> Que solución se le podría dar específicamente a la data de 11 columnas,
> que es la que me da problema.
>
> Saludos.
>
>
>
> [image: Descripción: FIRMA2]
>
>
>
> *De:* Carlos Ortega [mailto:c...@qualityexcellence.es]
> *Enviado el:* martes, 14 de febrero de 2017 14:21
> *Para:* Javier Valdes Cantallopts (DGA)
> *CC:* r-help-es@r-project.org
> *Asunto:* Re: problemas con rBIND con distintos número de columnas
>
>
>
> Hola Javier,
>
>
>
> Mientras que el "rbind()" que proporciona el paquete "base" en este caso
> te dará un error.
>
> El "rbind" que proporciona el paquete "data.table", creo que no lo da...
>
>
>
> Siempre puedes rellenar esos huecos con NAs en el data.frame al que le
> falte antes de juntarlas... y evitarte el trastorno.
>
>
>
> Saludos,
>
> Carlos Ortega
>
> www.qualityexcellence.es
>
>
>
> El 14 de febrero de 2017, 16:15, Javier Valdes Cantallopts (DGA) <
> javier.val...@mop.gov.cl> escribió:
>
> Hola a todos:
>
> Necesito pegar 4 bases de datos de N variables y N columnas, EL PROBLEMA
> ES QUE 3 *CONSTAN DE 13 COLUMNAS*, y LA CUARTA CON *11 COLUMNAS*.
>
> He *usado rbind y smartbind*, sin embargo el resultado no es el esperado,
> ya que coloca las columnas a un costado y no hacia abajo como debería
>
> Como resultado necesito algo como LO QUE PRESENTO ABAJO, *RELLENANDO LOS
> ESPACIOS VACIOS CON “NA”*
>
>
>
> 30/03/15 7:00
>
> 38
>
> 13.28
>
> 275.4431
>
> -1.667118
>
> 638.5
>
> -1.459
>
> 3.08
>
> 175.5
>
> -130
>
> -64.52
>
> *Na*
>
> *Na*
>
> 30/03/15 8:00
>
> 39
>
> 13.27
>
> 273.3796
>
> -0.9093614
>
> 638.5
>
> -1.386
>
> 4.099
>
> 151.6
>
> -129.9
>
> -64.42
>
> *Na*
>
> *Na*
>
> 30/03/15 9:00
>
> 40
>
> 13.21
>
> 275.5319
>
> 19.8293
>
> 638.6
>
> -1.39
>
> 3.573
>
> 138.7
>
> -129.8
>
> -64.34
>
> *Na*
>
> *Na*
>
> 30/03/15 10:00
>
> 41
>
> 13.25
>
> 278.6717
>
> 69.58882
>
> 638.8
>
> -1.227
>
> 4.193
>
> 174.4
>
> -129.8
>
> -64.3
>
> *Na*
>
> *Na*
>
> 30/03/15 11:00
>
> 42
>
> 13.59
>
> 276.256
>
> 153.4836
>
> 638.9
>
> -0.888
>
> 4.291
>
> 39.6
>
> -129.8
>
> -64.35
>
> *Na*
>
> *Na*
>
> 30/03/15 12:00
>
> 43
>
> 14.71
>
> 276.9799
>
> 233.9256
>
> 639
>
> -0.587
>
> 3.561
>
> 133.1
>
> -129.9
>
> -64.44
>
> *Na*
>
> *Na*
>
> 30/03/15 13:00
>
> 44
>
> 14.56
>
> 265.1613
>
> 449.0849
>
> 639.3
>
> -0.011
>
> 3.624
>
> 180.1
>
> -130
>
> -64.53
>
> *Na*
>
> *Na*
>
> 30/03/15 14:00
>
> 45
>
> 14.51
>
> 268.376
>
> 418.3066
>
> 639.6
>
> 0.2
>
> 3.885
>
> 138.3
>
> -130.3
>
> -64.82
>
> *Na*
>
> *Na*
>
> 28/03/15 16:40
>
> 0
>
> 12.96
>
> 0
>
> 168.4
>
> -28.4
>
> 13.01
>
> 697.9466
>
> 5.268066
>
> 278.4181
>
> -111.8081
>
> 228.8923
>
> 620.3669
>
> 28/03/15 16:50
>
> 1
>
> 12.99
>
> 3.473
>
> 248.3
>
> -33.81
>
> 8.52
>
> 644.0493
>
> 5.009216
>
> 278.1592
>
> -110.2677
>
> 229.1674
>
> 590.3563
>
> 28/03/15 17:00
>
> 2
>
> 12.99
>
> 3.917
>
> 174.7
>
> -38.64
>
> 4.529
>
> 644.2397
>
> 4.819122
>
> 277.9691
>
> -111.376
>
> 227.1322
>
> 556.6758
>
>
>
> SALUDOS.
>
>
>
>
>
>
>
>
>
>
>
>
>
> [image: Descripción: FIRMA2]
>
>
>
>
> --
>
>
> CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los
> archivos adjuntos es de carácter confidencial o privilegiada y está
> destinada al uso exclusivo del emisor y/o de la persona o entidad a quien
> va dirigida. Si usted no es el destinatario, cualquier almacenamiento,
> divulgación, distribución o copia de esta información está estrictamente
> prohibido y sancionado por la ley. Si recibió este mensaje por error, por
> favor infórmenos inmediatamente respondiendo este mismo mensaje y borre
> todos los archivos adjuntos. Gracias.
>
> CONFIDENTIAL NOTE: The information transmitted in this message and/or
> attachments is confidential and/or privileged and is intented only for use
> of the person or entity to whom it is addressed. If you are not the
> intended recipient, any retention, dissemination, distribution or copy of
> this information is strictly prohibited and sanctioned by law. If you
> received this message in error, please reply us this same message and
> delete this message and all attachments. Thank you.
>
>
>
>
>
> --
>
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>
> --
>
> CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los
> archivos adjuntos es de carácter confidencial o privilegiada y está
> destinada al uso exclusivo del emisor y/o de la persona o entidad a quien
> va dirigida. Si 

Re: [R] Create gif from series of png files

2017-02-14 Thread Bert Gunter
Ulrik:

Sheepishly Nitpicking (only because you are a regular and wise R-help
contibutor):

gganimate is not a library, it's a package.

No need to reply.

Best,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 3:33 AM, Ulrik Stervbo  wrote:
> Hi Shane,
>
> Wrong forum. This might be what you are looking for
>
> ffmpeg -i %03d.png output.gif
>
> Or use the library gganimate.
>
> Best
> Ulrik
>
> Shane Carey  schrieb am Di., 14. Feb. 2017, 12:08:
>
>> Hi,
>>
>> I have many png files that I would like to stitch together, in order to
>> make a gif file.
>>
>> Any ideas how I would do this?
>>
>> Thanks
>>
>> --
>> Le gach dea ghui,
>> Shane
>>
>> [[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.
>>
>
> [[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.

__
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.


Re: [R] Von Mises mixtures: mu and kappa?

2017-02-14 Thread Bert Gunter
Please search before posting!

Searching "von mises mixture distributions" on rseek.org brought up
what appeared to be several relevant hits. If none of these meet your
needs, you should probably explain why not in a follow up post.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 8:55 AM, Peter Mills  wrote:
> Hello
>
> I am trying to calculate the values of the concentration parameters (kappa) 
> and preferred direction (mu) for a Von Mises mixture model. I currently have 
> some R code that gives me optimised values for the product of kappa and mu, 
> but I'm not sure how to calculate them when both are unknown? How could I 
> calculate mu and kappa from y2 if I didn't know either in the 1st place? I 
> what to use movMF to give me values of kappa from some directional data where 
> I don't know either kappa or mu.
>
>
> ## Generate and fit a "small-mix" data set a la Banerjee et al.
> mu <- rbind(c(-0.251, -0.968),
> c(0.399, 0.917))
> kappa <- c(4, 4)
>
> theta <- kappa * mu
> theta
> alpha <- c(0.48, 0.52)
>
> ## Generate a sample of size n = 50 from the von Mises-Fisher mixture
> ## with the above parameters.
> set.seed(123)
> x <- rmovMF(50, theta, alpha)
> ## Fit a von Mises-Fisher mixture with the "right" number of components,
> ## using 10 EM runs.
> y2 <- movMF(x, 2, nruns = 10)
>
> Y2 gives
>> y2
> theta:
>[,1]  [,2]
> 1  2.443225  5.259337
> 2 -1.851384 -4.291278
> alpha:
> [1] 0.4823648 0.5176352
> L:
> [1] 24.98124
>
> How could I calculate kappa and mu if I didn't know either in the 1st place?
>
> Thanks
> Peter
>
>
> [[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.

__
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] Von Mises mixtures: mu and kappa?

2017-02-14 Thread Peter Mills
Hello

I am trying to calculate the values of the concentration parameters (kappa) and 
preferred direction (mu) for a Von Mises mixture model. I currently have some R 
code that gives me optimised values for the product of kappa and mu, but I'm 
not sure how to calculate them when both are unknown? How could I calculate mu 
and kappa from y2 if I didn't know either in the 1st place? I what to use movMF 
to give me values of kappa from some directional data where I don't know either 
kappa or mu.


## Generate and fit a "small-mix" data set a la Banerjee et al.
mu <- rbind(c(-0.251, -0.968),
c(0.399, 0.917))
kappa <- c(4, 4)

theta <- kappa * mu
theta
alpha <- c(0.48, 0.52)

## Generate a sample of size n = 50 from the von Mises-Fisher mixture
## with the above parameters.
set.seed(123)
x <- rmovMF(50, theta, alpha)
## Fit a von Mises-Fisher mixture with the "right" number of components,
## using 10 EM runs.
y2 <- movMF(x, 2, nruns = 10)

Y2 gives
> y2
theta:
   [,1]  [,2]
1  2.443225  5.259337
2 -1.851384 -4.291278
alpha:
[1] 0.4823648 0.5176352
L:
[1] 24.98124

How could I calculate kappa and mu if I didn't know either in the 1st place?

Thanks
Peter


[[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.


Re: [R] Circular plot

2017-02-14 Thread David L Carlson
This is pretty close to your original plot. To get clockwise we multiply the 
radians by -1 and then add pi/2 to move the origin to 12 o'clock. We need to 
flip the start and end values since now we are be plotting from the end to the 
start:

start<-c(1,5,600,820)
end<-c(250,75,810,1200)
score<-c(7,-1,4,-6.5)
dat<-data.frame(start=start,end=end,score=score,col="blue",stringsAsFactors=F)
dat[dat$score<0,]$col<-"red"

# Convert begin/stop to radians
dat$stop <- -(2 * pi * dat$start/1500) + pi/2
dat$begin <- -(2 * pi * dat$end/1500) + pi/2

# Open blank plot window and draw circles
Canvas(xlim = c(-5,5), xpd=TRUE)
DrawCircle (r.out = 5, r.in = 5, theta.1=pi/2+.05, theta.2=pi*5/2-.05, lwd=3)
with(dat, DrawCircle(r.out = 5 - score/5, r.in = 5 - score/5, 
 theta.1= begin, theta.2= stop, border=col, lwd=4))
text(.1, 5.5, "1", pos=4)
text(-.1, 5.5, "1500", pos=2)

David C


From: swaraj basu [mailto:projectb...@gmail.com] 
Sent: Monday, February 13, 2017 3:58 PM
To: David L Carlson ; r-help@r-project.org
Subject: Re: [R] Circular plot

Thank you David, I could get the circle at 12 and clockwise however I believe 
my solution is not the optimal one, could you help me out with the best way to 
generate the circle clockwise at 12 and then convert the begin/stop to radians

Here is what I tried

par(mar=c(2,2,2,2),xpd=TRUE);
plot(c(1,800),c(1,800),type="n",axes=FALSE,xlab="",ylab="",main="");
DrawCircle (x=400,y=400,r.out = 400, r.in = 400, theta.1=1.57, 
theta.2=-2*pi-4.67, lwd=1)

On Mon, Feb 13, 2017 at 6:52 PM, David L Carlson  wrote:
You can do this easily with the DrawCircle() function in package DescTools. It 
is easiest to use geometric coordinates (0 is at 3 o'clock and moves 
counterclockwise around the circle), but it could be converted to 12 o'clock 
and clockwise:

library(DescTools)

# Convert begin/stop to radians
dat$begin <- 0 + 2 * pi * dat$start/1500
dat$stop <- 0 + 2 * pi * dat$end/1500

# Open blank plot window and draw circles
Canvas(xlim = c(-5,5), xpd=TRUE)
DrawCircle (r.out = 5, r.in = 5, theta.1=.05, theta.2=2*pi-.05, lwd=3)
with(dat, DrawCircle(r.out = 5 - score/5, r.in = 5 - score/5,
     theta.1=begin, theta.2=stop, border=col, lwd=4))
text(5.2, .4, "1", pos=4)
text(5.2, -.4, "1500", pos=4)

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




-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of swaraj basu
Sent: Monday, February 13, 2017 10:34 AM
To: r-help@r-project.org
Subject: [R] Circular plot

I want to plot segments deleted from mitochondrial DNA of patients with
neuromuscular disorders. I generate the plot on a linear chromosome using a
code similar to as shown below

start<-c(1,5,600,820)
end<-c(250,75,810,1200)
score<-c(7,-1,4,-6.5)
dat<-data.frame(start=start,end=end,score=score,col="blue",stringsAsFactors=F)
dat[dat$score<0,]$col<-"red"

plot(1:1500,rep(0,1500),type="p",ylim=c(-10,10),col="white",xlab="position",ylab="score")
segments(dat$start, dat$score, dat$end, dat$score, col=dat$col, lwd=3)


Since the human mitochondria is a circular genome, I would like to
visualise the plot generated above as a circle where all segments with
positive score lie inside the circle and those with negative score lie
outside. Attached is a representation of my requirement, although here it
is manually drawn. Can someone help me on this?


--
Swaraj Basu




-- 
Swaraj Basu
__
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.

Re: [R] minpack package in R version 3.3.2

2017-02-14 Thread J C Nash

You probably wanted minpack.lm, not minpack.

FYI, Duncan Murdoch and I just put up nlsr on CRAN. It does ANALYTIC derivatives on expression-form nonlinear models, 
and also handles function-form problems. It does a Marquardt-stabilized solution, and allows fixed parameters by 
specifying upper and lower bounds equal.


JN


On 2017-02-14 06:56 AM, Malgorzata Wieteska via R-help wrote:

Hello,
I'm new to R. I found very useful for me code for parameter estimation. Unfortunately, 
while trying to install "minpack" I get info, that this package is not 
available for version 3.3.2.
I'm using Windows 10. Does anyone know how to overcome this and maybe a hint on 
which version of R it has been working (I would try to install a previous 
version)?
Thanks in advance for any hint.Gosia
[[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.



__
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.


Re: [R] minpack package in R version 3.3.2

2017-02-14 Thread Jeff Newmiller
The primary place for finding out about packages is the Comprehensive R Archive 
Network, or CRAN. Try entering 

R package minpack CRAN

into Google and you should be able to see what you need to do on your own. If 
you still need help, tell us what you found and why it didn't help when you 
post your next question. 
-- 
Sent from my phone. Please excuse my brevity.

On February 14, 2017 3:56:52 AM PST, Malgorzata Wieteska via R-help 
 wrote:
>Hello,
>I'm new to R. I found very useful for me code for parameter estimation.
>Unfortunately, while trying to install "minpack" I get info, that this
>package is not available for version 3.3.2.
>I'm using Windows 10. Does anyone know how to overcome this and maybe a
>hint on which version of R it has been working (I would try to install
>a previous version)?
>Thanks in advance for any hint.Gosia
>   [[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.

__
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.

Re: [R-es] pregunta

2017-02-14 Thread Mauricio Mardones Inostroza
Esta buenisimo para hacerlo con Laticce.

Saludos a todos!

El 14 de febrero de 2017, 12:49, Carlos Ortega 
escribió:

> Hola José,
>
> He visto el Excel y he encontrado la hoja oculta donde vienen los cálculos.
> El libro de Excel tiene una hoja de entrada de datos, que se actualizan en
> esa hoja oculta donde para cada semana se calcula un logaritmo, un
> intervalo de confianza, una exponencial y una media geométrica...
>
> Todo esto lo puedes hacer fácilmente con "R".
> Sobre un fichero de datos de entrada al que se irían añadiendo columnas o
> filas (como se quiera construir) ya luego con "R" construyes estos cálculos
> y los mismos (o mejores) gráficos...
>
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>
>
> El 14 de febrero de 2017, 14:51,  escribió:
>
> > Estimados
> >
> > Adjunto en excel el canal endémico de Bortman, se brindan las tasas de
> > cinco aaños anteriores de cualquier enfermedad endémica y no0s alerta si
> > nos alejamos de la media histórica (media geométrica) los intervalos de
> > confianza son con conversión logaritmica.
> >
> > ¿Es posible traducir este excel a R?
> >
> > saludos
> >
> > José
> >
> > --
> > Este mensaje le ha llegado mediante el servicio de correo electronico que
> > ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
> > Nacional de Salud. La persona que envia este correo asume el compromiso
> de
> > usar el servicio a tales fines y cumplir con las regulaciones
> establecidas
> >
> > Infomed: http://www.sld.cu/
> >
> > ___
> > R-help-es mailing list
> > R-help-es@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-help-es
> >
>
>
>
> --
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>



-- 

*Mauricio Mardones Inostroza*

Investigador Departamento Evaluación de Recursos
Instituto de Fomento Pesquero - IFOP
Valparaíso - Chile
+56-32-21514 42

www.ifop.cl

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Forecasting using VECM

2017-02-14 Thread Bert Gunter
Searching on "VECM" on rseek.org brought up:

"VECM" on the Rdocumentation site, which clearly states:

"The predict method contains a newdata argument allowing to compute
rolling forecasts."

If that is not what you want, you'll need to explain why not, I think.
If it is, please do such searching on your own in future.

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 4:18 AM, Preetam Pal  wrote:
> Hi,
>
> I have attached the historical dataset (titled data) containing numerical
> variables GDP, HPA, FX and Y - I am interested to predict Y given some
> future values of GDP, HPA and FX.
>
>- Some variables are non-statioanry as per adf.test()
>- I wanted to implement a VECM framework for modeling cointegration, so
>I have used *result = VECM(data, lag = 3, r = 1)* , and I get the output
>below showing that cointegration relationship does exist between these 4
>variables:
>- My question is: How do I get predictions of Y given
>externally-generated future values of the other variables (for say,
>upcoming 10 time points), using this result programmatically?
>
> Regards,
> Preetam
> #
> Model VECM
> #
> Full sample size: 25 End sample size: 22
> Number of variables: 4 Number of estimated slope parameters 40
> AIC 23.84198 BIC 70.75681 SSR 156.5155
> Cointegrating vector (estimated by ML):
>GDP  HPAFX   Y
> r1   1 2.171994 -6.823215 -0.07767563
>
>
>  ECT Intercept   GDP -1
> Equation GDP 0.0612(0.0436)  0.0141(0.0687)  -0.4268(0.2494)
> Equation HPA -0.6368(0.2381)*0.1858(0.3749)  3.1656(1.3609)*
> Equation FX  0.1307(0.0874)  -0.0039(0.1377) 0.1739(0.4997)
> Equation Y   -0.0852(0.4261) 0.3219(0.6711)  -5.0248(2.4359).
>  HPA -1  FX -1   Y -1
> Equation GDP -0.0910(0.0790) 0.1988(0.2261)  0.0413(0.0299)
> Equation HPA 0.4891(0.4311)  -2.2140(1.2337).-0.3206(0.1631).
> Equation FX  -0.2108(0.1583) -0.2536(0.4530) -0.0303(0.0599)
> Equation Y   -0.3686(0.7716) 0.5234(2.2083)  -0.9638(0.2920)**
>  GDP -2  HPA -2  FX -2
> Equation GDP -0.2892(0.2452) -0.0622(0.0563) 0.0598(0.1352)
> Equation HPA -0.7084(1.3379) 0.1877(0.3069)  -0.2231(0.7377)
> Equation FX  -0.1773(0.4913) -0.0170(0.1127) -0.2486(0.2709)
> Equation Y   -3.8521(2.3948) -0.4559(0.5494) 1.1239(1.3205)
>  Y -2
> Equation GDP 0.0411(0.0279)
> Equation HPA -0.2447(0.1521)
> Equation FX  -0.0102(0.0559)
> Equation Y   -0.1696(0.2723)
>
> __
> 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.


Re: [R] renameSeqlevels

2017-02-14 Thread Martin Morgan
Rsamtools and GenomicAlignments are Bioconductor packages so ask on the 
Bioconductor support site


  https://support.bioconductor.org

You cannot rename the seqlevels in the bam file; you could rename the 
seqlevels in the object(s) you have created from the bam file.


Martin

On 02/14/2017 09:17 AM, Teresa Tavella wrote:

Dear all,

I would like to ask if it is possible to change the seqnames of a bam file
giving a vector of character to the function renameSeqlevels. This is
because in order to use the fuction summarizeOverlap or count/find, the
seqnames have to match.

From the bamfile below I have extracted the locus annotations form the

seqnames (i.e ERCC2, NC_001133.9...etc) and I have created a list (same
length as the seqlevels of the bam file).


*bamfile*
GAlignments object with 6 alignments and 0 metadata columns:

seqnames


  [1]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [2]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [3]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [4]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [5]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [6]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  strand   cigarqwidth start   end width njunc
 
  [1]  + 8M2D27M35  1025  106137 0
  [2]  + 8M2D27M35  1025  106137 0
  [3]  - 36M36  1025  106036 0
  [4]  - 36M36  1026  106136 0
  [5]  + 35M35  1027  106135 0
  [6]  + 35M35  1027  106135 0
  ---
*gffile*
GRanges object with 6 ranges and 12 metadata columns:
 seqnames   ranges strand |   source type score
   |   
  [1] NC_001133.9 [ 24837,  25070]  + | s_cerevisiae exon  
  [2] NC_001133.9 [ 25048,  25394]  + | s_cerevisiae exon  
  [3] NC_001133.9 [ 27155,  27786]  + | s_cerevisiae exon  
  [4] NC_001133.9 [ 73431,  73792]  + | s_cerevisiae exon  
  [5] NC_001133.9 [165314, 165561]  + | s_cerevisiae exon  
  [6] NC_001133.9 [165388, 165781]  + | s_cerevisiae exon  
  phase gene_id  transcript_id exon_number   gene_name
 
  [1]   XLOC_40 TCONS_0191   1FLO9
  [2]   XLOC_40 TCONS_0192   1FLO9
  [3]   XLOC_41 TCONS_0193   1FLO9
  [4]   XLOC_55 TCONS_0200   1   YAL037C-A
  [5]   XLOC_75 TCONS_0100   1 YAR010C
  [6]   XLOC_75 TCONS_0219   1 YAR010C
 oId nearest_ref  class_code
   
  [1]   {TRINITY_GG_normal}16_c1_g1_i1.mrna1rna8   x
  [2]   {TRINITY_GG_normal}16_c0_g1_i1.mrna1rna8   x
  [3]   {TRINITY_GG_normal}12_c0_g1_i1.mrna1rna8   x
  [4]{TRINITY_GG_normal}3_c3_g1_i1.mrna1   rna31   x
  [5] {TRINITY_GG_normal}3479_c0_g1_i1.mrna1   rna77   x
  [6]   {TRINITY_GG_normal}24_c0_g1_i1.mrna1   rna77   x
   tss_id
  
  [1]   TSS42
  [2]   TSS43
  [3]   TSS44
  [4]   TSS71
  [5]  TSS118
  [6]  TSS118
  ---

It is possible to replace the seqlevels names with the list?
I have tried:

bamfile1 <- renameSeqlevels(seqlevels(bamfile), listx)

Thank you for any advice,

Kind regards,

Teresa



__
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.




This email message may contain legally privileged and/or...{{dropped:2}}

__
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.


Re: [R] CAR

2017-02-14 Thread Bert Gunter
Rseek.org brings up what look like relevant hits on "conditional
autoregressive models." Have you looked at these? If so and they do
not suit, perhaps you should explain why not. If they do, please do
such searching on your own in future.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Feb 14, 2017 at 6:39 AM, Siswanto Sumargo
 wrote:
> *I would like to simulate spatial data conditional **autoregressive
> (CAR) model with weighted matrix order 2**Is there any package or
> function in R to perform it ?
> **Thanks in advance*
>
> *Best Regards
> Siswanto*
>
> --
> *Siswanto*
> Department of Statistics, Faculty of Mathematics and Natural Science
> Bogor Agricultural University, Dramaga Bogor Indonesia 16680
> Telp : 0899 130 20 89
> Email   : siswantosuma...@gmail.com
>
> *“Success is getting what you want, happiness is wanting what you get” *
>
> [[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.

__
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] CAR

2017-02-14 Thread Siswanto Sumargo
*I would like to simulate spatial data conditional **autoregressive
(CAR) model with weighted matrix order 2**Is there any package or
function in R to perform it ?
**Thanks in advance*

*Best Regards
Siswanto*

-- 
*Siswanto*
Department of Statistics, Faculty of Mathematics and Natural Science
Bogor Agricultural University, Dramaga Bogor Indonesia 16680
Telp : 0899 130 20 89
Email   : siswantosuma...@gmail.com

*“Success is getting what you want, happiness is wanting what you get” *

[[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.

[R] Forecasting using VECM

2017-02-14 Thread Preetam Pal
Hi,

I have attached the historical dataset (titled data) containing numerical
variables GDP, HPA, FX and Y - I am interested to predict Y given some
future values of GDP, HPA and FX.

   - Some variables are non-statioanry as per adf.test()
   - I wanted to implement a VECM framework for modeling cointegration, so
   I have used *result = VECM(data, lag = 3, r = 1)* , and I get the output
   below showing that cointegration relationship does exist between these 4
   variables:
   - My question is: How do I get predictions of Y given
   externally-generated future values of the other variables (for say,
   upcoming 10 time points), using this result programmatically?

Regards,
Preetam
#
Model VECM
#
Full sample size: 25 End sample size: 22
Number of variables: 4 Number of estimated slope parameters 40
AIC 23.84198 BIC 70.75681 SSR 156.5155
Cointegrating vector (estimated by ML):
   GDP  HPAFX   Y
r1   1 2.171994 -6.823215 -0.07767563


 ECT Intercept   GDP -1
Equation GDP 0.0612(0.0436)  0.0141(0.0687)  -0.4268(0.2494)
Equation HPA -0.6368(0.2381)*0.1858(0.3749)  3.1656(1.3609)*
Equation FX  0.1307(0.0874)  -0.0039(0.1377) 0.1739(0.4997)
Equation Y   -0.0852(0.4261) 0.3219(0.6711)  -5.0248(2.4359).
 HPA -1  FX -1   Y -1
Equation GDP -0.0910(0.0790) 0.1988(0.2261)  0.0413(0.0299)
Equation HPA 0.4891(0.4311)  -2.2140(1.2337).-0.3206(0.1631).
Equation FX  -0.2108(0.1583) -0.2536(0.4530) -0.0303(0.0599)
Equation Y   -0.3686(0.7716) 0.5234(2.2083)  -0.9638(0.2920)**
 GDP -2  HPA -2  FX -2
Equation GDP -0.2892(0.2452) -0.0622(0.0563) 0.0598(0.1352)
Equation HPA -0.7084(1.3379) 0.1877(0.3069)  -0.2231(0.7377)
Equation FX  -0.1773(0.4913) -0.0170(0.1127) -0.2486(0.2709)
Equation Y   -3.8521(2.3948) -0.4559(0.5494) 1.1239(1.3205)
 Y -2
Equation GDP 0.0411(0.0279)
Equation HPA -0.2447(0.1521)
Equation FX  -0.0102(0.0559)
Equation Y   -0.1696(0.2723)
GDP HPA FX  Y
0.514662421 0.635997077 1.37802145  1.773342598
0.9367223.127683176 1.391916535 3.709809052
0.101482324 1.270555421 0.831157511 0.226267793
0.017548634 2.456061547 1.003945759 9.510258161
0.236462416 0.988324147 0.223682679 5.026671536
0.372005149 2.177631629 0.904226065 4.219235789
0.153915709 4.620341653 0.033410743 3.17396006
0.524887329 1.050861084 0.518201484 7.950098612
0.776616937 0.503349512 0.666089868 3.320938471
0.760074361 3.635853456 0.470220952 6.380945175
0.802986662 1.260738545 0.452674872 1.036040804
0.375145127 0.20035625  1.837306306 6.486871565
0.002568896 3.532359526 0.556752154 8.536594244
0.754309276 3.952381767 0.247402168 8.559081716
0.585966577 4.01463047  1.184382133 0.148121669
0.39767356  1.553753452 0.983129422 5.378373676
0.859898623 4.73191381  0.828795696 3.367809329
0.741376169 4.993350692 1.758051281 5.516460988
0.329240391 3.465836416 1.701655508 1.249497907
0.078661064 3.298298811 0.04575857  5.132921426
0.270971873 0.46627043  1.739487411 4.94697541
0.731072625 0.940642982 0.728747166 7.583041122
0.385038046 3.51048946  0.021866584 7.361148458
0.530760376 1.204422978 0.415530715 1.163503483
0.555323667 4.12592 1.844184811 8.596644394
__
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] renameSeqlevels

2017-02-14 Thread Teresa Tavella
Dear all,

I would like to ask if it is possible to change the seqnames of a bam file
giving a vector of character to the function renameSeqlevels. This is
because in order to use the fuction summarizeOverlap or count/find, the
seqnames have to match.
>From the bamfile below I have extracted the locus annotations form the
seqnames (i.e ERCC2, NC_001133.9...etc) and I have created a list (same
length as the seqlevels of the bam file).


*bamfile*
GAlignments object with 6 alignments and 0 metadata columns:

seqnames


  [1]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [2]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [3]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [4]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [5]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  [6]
DQ459430_gene=ERCC2_loc:ERCC2|1-1061|+_exons:1-1061_segs:1-1061
  strand   cigarqwidth start   end width njunc
 
  [1]  + 8M2D27M35  1025  106137 0
  [2]  + 8M2D27M35  1025  106137 0
  [3]  - 36M36  1025  106036 0
  [4]  - 36M36  1026  106136 0
  [5]  + 35M35  1027  106135 0
  [6]  + 35M35  1027  106135 0
  ---
*gffile*
GRanges object with 6 ranges and 12 metadata columns:
 seqnames   ranges strand |   source type score
   |   
  [1] NC_001133.9 [ 24837,  25070]  + | s_cerevisiae exon  
  [2] NC_001133.9 [ 25048,  25394]  + | s_cerevisiae exon  
  [3] NC_001133.9 [ 27155,  27786]  + | s_cerevisiae exon  
  [4] NC_001133.9 [ 73431,  73792]  + | s_cerevisiae exon  
  [5] NC_001133.9 [165314, 165561]  + | s_cerevisiae exon  
  [6] NC_001133.9 [165388, 165781]  + | s_cerevisiae exon  
  phase gene_id  transcript_id exon_number   gene_name
 
  [1]   XLOC_40 TCONS_0191   1FLO9
  [2]   XLOC_40 TCONS_0192   1FLO9
  [3]   XLOC_41 TCONS_0193   1FLO9
  [4]   XLOC_55 TCONS_0200   1   YAL037C-A
  [5]   XLOC_75 TCONS_0100   1 YAR010C
  [6]   XLOC_75 TCONS_0219   1 YAR010C
 oId nearest_ref  class_code
   
  [1]   {TRINITY_GG_normal}16_c1_g1_i1.mrna1rna8   x
  [2]   {TRINITY_GG_normal}16_c0_g1_i1.mrna1rna8   x
  [3]   {TRINITY_GG_normal}12_c0_g1_i1.mrna1rna8   x
  [4]{TRINITY_GG_normal}3_c3_g1_i1.mrna1   rna31   x
  [5] {TRINITY_GG_normal}3479_c0_g1_i1.mrna1   rna77   x
  [6]   {TRINITY_GG_normal}24_c0_g1_i1.mrna1   rna77   x
   tss_id
  
  [1]   TSS42
  [2]   TSS43
  [3]   TSS44
  [4]   TSS71
  [5]  TSS118
  [6]  TSS118
  ---

It is possible to replace the seqlevels names with the list?
I have tried:

bamfile1 <- renameSeqlevels(seqlevels(bamfile), listx)

Thank you for any advice,

Kind regards,

Teresa
__
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] minpack package in R version 3.3.2

2017-02-14 Thread Malgorzata Wieteska via R-help
Hello,
I'm new to R. I found very useful for me code for parameter estimation. 
Unfortunately, while trying to install "minpack" I get info, that this package 
is not available for version 3.3.2.
I'm using Windows 10. Does anyone know how to overcome this and maybe a hint on 
which version of R it has been working (I would try to install a previous 
version)?
Thanks in advance for any hint.Gosia
[[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.

[R-es] problemas con rBIND con distintos número de columnas

2017-02-14 Thread Javier Valdes Cantallopts (DGA)
Hola a todos:
Necesito pegar 4 bases de datos de N variables y N columnas, EL PROBLEMA ES QUE 
3 CONSTAN DE 13 COLUMNAS, y LA CUARTA CON 11 COLUMNAS.
He usado rbind y smartbind, sin embargo el resultado no es el esperado, ya que 
coloca las columnas a un costado y no hacia abajo como debería
Como resultado necesito algo como LO QUE PRESENTO ABAJO, RELLENANDO LOS 
ESPACIOS VACIOS CON "NA"

30/03/15 7:00

38

13.28

275.4431

-1.667118

638.5

-1.459

3.08

175.5

-130

-64.52

Na

Na

30/03/15 8:00

39

13.27

273.3796

-0.9093614

638.5

-1.386

4.099

151.6

-129.9

-64.42

Na

Na

30/03/15 9:00

40

13.21

275.5319

19.8293

638.6

-1.39

3.573

138.7

-129.8

-64.34

Na

Na

30/03/15 10:00

41

13.25

278.6717

69.58882

638.8

-1.227

4.193

174.4

-129.8

-64.3

Na

Na

30/03/15 11:00

42

13.59

276.256

153.4836

638.9

-0.888

4.291

39.6

-129.8

-64.35

Na

Na

30/03/15 12:00

43

14.71

276.9799

233.9256

639

-0.587

3.561

133.1

-129.9

-64.44

Na

Na

30/03/15 13:00

44

14.56

265.1613

449.0849

639.3

-0.011

3.624

180.1

-130

-64.53

Na

Na

30/03/15 14:00

45

14.51

268.376

418.3066

639.6

0.2

3.885

138.3

-130.3

-64.82

Na

Na

28/03/15 16:40

0

12.96

0

168.4

-28.4

13.01

697.9466

5.268066

278.4181

-111.8081

228.8923

620.3669

28/03/15 16:50

1

12.99

3.473

248.3

-33.81

8.52

644.0493

5.009216

278.1592

-110.2677

229.1674

590.3563

28/03/15 17:00

2

12.99

3.917

174.7

-38.64

4.529

644.2397

4.819122

277.9691

-111.376

227.1322

556.6758


SALUDOS.






[Descripción: FIRMA2]




CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los archivos 
adjuntos es de carácter confidencial o privilegiada y está destinada al uso 
exclusivo del emisor y/o de la persona o entidad a quien va dirigida. Si usted 
no es el destinatario, cualquier almacenamiento, divulgación, distribución o 
copia de esta información está estrictamente prohibido y sancionado por la ley. 
Si recibió este mensaje por error, por favor infórmenos inmediatamente 
respondiendo este mismo mensaje y borre todos los archivos adjuntos. Gracias.

CONFIDENTIAL NOTE: The information transmitted in this message and/or 
attachments is confidential and/or privileged and is intented only for use of 
the person or entity to whom it is addressed. If you are not the intended 
recipient, any retention, dissemination, distribution or copy of this 
information is strictly prohibited and sanctioned by law. If you received this 
message in error, please reply us this same message and delete this message and 
all attachments. Thank you.
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] Create gif from series of png files

2017-02-14 Thread Duncan Murdoch

On 14/02/2017 5:53 AM, Shane Carey wrote:

Hi,

I have many png files that I would like to stitch together, in order to
make a gif file.

Any ideas how I would do this?


ImageMagick is good for this.  The magick package in R makes most (all?) 
of its features available.  The image_animate() function can produce an 
animation; see either the ImageMagick docs online, or the "intro" 
vignette in the magick package for examples and instructions.


Duncan Murdoch

__
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] VAR for Non Stationary series using R

2017-02-14 Thread Lal Prasad
Hi All,


Is there any suggested approaches for using non-stationary series in VAR
model? As per otexts.org
,
there is something like "VAR in differences which could be used for such
series.

Are there any other approaches for creating a forecasting mode non
stationary series in a multi variate series?

Any leads on this would be helpful. I'm looking for implementing this model
in R.

Regards
Lal

[[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.


[R-es] pregunta

2017-02-14 Thread jbetancourt
Estimados

Adjunto en excel el canal endémico de Bortman, se brindan las tasas de
cinco aaños anteriores de cualquier enfermedad endémica y no0s alerta si
nos alejamos de la media histórica (media geométrica) los intervalos de
confianza son con conversión logaritmica.

¿Es posible traducir este excel a R?

saludos

José

--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/


canal endémico.xlsx
Description: MS-Excel 2007 spreadsheet
___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] [FORGED] Re: get() return nothing

2017-02-14 Thread Ben Tupper
Hi,

When you want to get 'something' out of a loop you need to assign that 
'something' to a variable that persists outside of the loop. I think it is a 
scoping thing. In your situation you could create a list with as many elements 
as there are objects with 'txt' in their names.  I can't quite follow what is 
is you are after, but perhaps something like this (untested and I'm still on my 
first cup of coffee) ...

obj_names <- ls(pattern="txt")
obj_dims <- vector(mode = 'list', length = length(obj_names))
names(obj_dims) <- obj_names
for (nm in obj_names)){
obj_dims[[nm]] <- dim(get(nm)) 
}

Does that do what you want?  If so, you could probably use lapply() for the 
purpose instead of the for loop, but even better is to store each of your 
objects in a list as you create them rather than letting them get loose in the 
global environment.  That way you don't have to do this get-by-name rodeo to 
get info on them.

Cheers,
Ben



> On Feb 14, 2017, at 2:57 AM, Rolf Turner  wrote:
> 
> 
> On 14/02/17 05:50, Fix Ace via R-help wrote:
> 
>> Well, I am not trying to print anything. I just would like to get the 
>> dimension information for all the dataframes I created. Could you please 
>> help me to develop the script?
>> Thanks.
>> Ace
> 
> Yes you *are* trying to print something.  You are trying to print the 
> dimension information, i.e. dim(get(i))!!! For Pete's sake (a) *think* about 
> what you are doing and (b) *try* example that Duncan suggested to you.
> 
> cheers,
> 
> Rolf Turner
>> 
>>On Saturday, February 11, 2017 7:53 PM, Duncan Murdoch 
>>  wrote:
>> 
>> 
>> On 11/02/2017 1:33 PM, Fix Ace via R-help wrote:
>>> Hello, there,
>>> I wrote a loop to check the dimension of all the .txt dataframes:> ls()
>>>  [1] "actualpca.table" "b4galnt2""b4galnt2.txt""data"
>>>  [5] "galnt4"  "galnt4.txt"  "galnt5"  "galnt5.txt"
>>>  [9] "galnt6"  "galnt6.txt"  "glyco"  "glyco.txt"
>>> [13] "i"  "mtscaled""newsig.table""nicepca"
>>> [17] "pca""sig.txt""st3gal3""st3gal3.txt"
>>> [21] "st3gal5""st3gal5.txt""st6gal1""st6gal1.txt"
 for(i in ls(pattern="txt")){dim(get(i))}
 
>>> If I check individual ones, they are ok:
 dim(get("galnt4.txt"))
>>> [1] 8 3
 
>>> could anyone help me to figure out why it did not work with a loop?
>>> Thanks a lot!
>> 
>> It's the difference between
>> 
>> for (i in 1:10) i
>> 
>> (which prints nothing) and
>> 
>> for (i in 1:10) print(i)
>> 
>> Duncan Murdoch
>> 
>> 
>> 
>> 
>>  [[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.
>> 
> 
> 
> -- 
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
> 
> __
> 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.

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

__
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.


Re: [R-es] Cruce de no Coincidente

2017-02-14 Thread Carlos Ortega
Hola,

Sí, mira la función "merge()" que hace justamente lo que buscas.
Y en particular el significado de los parámetros que incluye la función del
tipo "all.x", "all.y", "all" que te permitirán mostrar los comunes y los no
comunes.

Gracias,
Carlos Ortega
www.qualityexcellence.es

El 14 de febrero de 2017, 14:12, Rafael Saturno 
escribió:

> Hola Comunidad, se me presenta el siguiente problema
>
>
> Tengo dos Tablas, la TablaA y la TablaB y en ambas tablas tengo un campo
> en particular por el cual haría el cruce, algo tipo un Numero de Pasaporte
> o una Placa de un carro, valores que son únicos por registro.
>
>
> Entonces necesito hacer un cruce de las 2 tablas pero que en vez de que me
> queden los comunes en ambas tablas, necesito que me queden los distintos en
> ambas tablas.
>
>
> Yo lo hice así,
>
>
> TablaA <- data.frame(x=1:10)
> TablaB <- data.frame(x=3:7)
> valor <- data.frame(x=rep(0,10))
> for (i in 1:10) {
>   valor[i,1] <-  sum(ifelse(TablaA$x[i]== TablaB,1,0))
> }
> Resultado <- data.frame(v=TablaA$x, valor=valor$x)
> Resultado[Resultado$valor == 0, ]
>
> Pero espero tener una opciones mas sencilla y rápida ya que las tablas
> tiene mas de 100mil datos xD
>
> Muchas Gracias
>
>
>
> [[alternative HTML version deleted]]
>
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>



-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] Reintentos de una query en R

2017-02-14 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal?

En

https://www.datanalytics.com/2015/10/09/madrid-decide-propone-vota-etc/

tienes un ejemplo de una expresión try-catch para controlar ese tipo
de problemas.

Un saludo,

Carlos J. Gil Bellosta
http://www.datanalytics.com

El día 14 de febrero de 2017, 11:30, Sergio Castro
 escribió:
> Buenos días,
>
> Estoy haciendo un script que se conecta a una base de datos externa y
> en la que crea diferentes tablas. Me estoy encontrando con que la
> conexion es bastante mala y muchas veces me falla a mitad de script
> por este motivo.
> Me gustaría meter esta sentencia de crear la tabla en algún tipo de
> try/catch o algo similar para que si falla, se reintente
> automaticamente un número configurable de veces.
> ¿Alguna idea? ¿Podrían ayudarme?
>
> Muchas gracias.
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Create gif from series of png files

2017-02-14 Thread Shane Carey
Hi Ulrick,

I created the png's in R and was hoping there would be a way of stitching
them together in R. Is there a different forum I should be  posting to?

Thanks

On Tue, Feb 14, 2017 at 11:33 AM, Ulrik Stervbo 
wrote:

> Hi Shane,
>
> Wrong forum. This might be what you are looking for
>
> ffmpeg -i %03d.png output.gif
>
> Or use the library gganimate.
>
> Best
> Ulrik
>
> Shane Carey  schrieb am Di., 14. Feb. 2017, 12:08:
>
>> Hi,
>>
>> I have many png files that I would like to stitch together, in order to
>> make a gif file.
>>
>> Any ideas how I would do this?
>>
>> Thanks
>>
>> --
>> Le gach dea ghui,
>> Shane
>>
>> [[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.
>>
>


-- 
Le gach dea ghui,
Shane

[[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.


Re: [R] Create gif from series of png files

2017-02-14 Thread Ulrik Stervbo
Hi Shane,

Wrong forum. This might be what you are looking for

ffmpeg -i %03d.png output.gif

Or use the library gganimate.

Best
Ulrik

Shane Carey  schrieb am Di., 14. Feb. 2017, 12:08:

> Hi,
>
> I have many png files that I would like to stitch together, in order to
> make a gif file.
>
> Any ideas how I would do this?
>
> Thanks
>
> --
> Le gach dea ghui,
> Shane
>
> [[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.
>

[[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.


[R-es] Reintentos de una query en R

2017-02-14 Thread Sergio Castro
Buenos días,

Estoy haciendo un script que se conecta a una base de datos externa y
en la que crea diferentes tablas. Me estoy encontrando con que la
conexion es bastante mala y muchas veces me falla a mitad de script
por este motivo.
Me gustaría meter esta sentencia de crear la tabla en algún tipo de
try/catch o algo similar para que si falla, se reintente
automaticamente un número configurable de veces.
¿Alguna idea? ¿Podrían ayudarme?

Muchas gracias.

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R] Create gif from series of png files

2017-02-14 Thread Shane Carey
Hi,

I have many png files that I would like to stitch together, in order to
make a gif file.

Any ideas how I would do this?

Thanks

-- 
Le gach dea ghui,
Shane

[[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.


Re: [R] [FORGED] Re: get() return nothing

2017-02-14 Thread Rolf Turner


On 14/02/17 05:50, Fix Ace via R-help wrote:


Well, I am not trying to print anything. I just would like to get the dimension 
information for all the dataframes I created. Could you please help me to 
develop the script?
Thanks.
Ace


Yes you *are* trying to print something.  You are trying to print the 
dimension information, i.e. dim(get(i))!!! For Pete's sake (a) *think* 
about what you are doing and (b) *try* example that Duncan suggested to you.


cheers,

Rolf Turner


On Saturday, February 11, 2017 7:53 PM, Duncan Murdoch 
 wrote:


 On 11/02/2017 1:33 PM, Fix Ace via R-help wrote:

Hello, there,
I wrote a loop to check the dimension of all the .txt dataframes:> ls()
  [1] "actualpca.table" "b4galnt2""b4galnt2.txt""data"
  [5] "galnt4"  "galnt4.txt"  "galnt5"  "galnt5.txt"
  [9] "galnt6"  "galnt6.txt"  "glyco"  "glyco.txt"
[13] "i"  "mtscaled""newsig.table""nicepca"
[17] "pca""sig.txt""st3gal3""st3gal3.txt"
[21] "st3gal5""st3gal5.txt""st6gal1""st6gal1.txt"

for(i in ls(pattern="txt")){dim(get(i))}


If I check individual ones, they are ok:

dim(get("galnt4.txt"))

[1] 8 3



could anyone help me to figure out why it did not work with a loop?
Thanks a lot!


It's the difference between

for (i in 1:10) i

(which prints nothing) and

for (i in 1:10) print(i)

Duncan Murdoch




[[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.




--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
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.