ccomp Composition and ggtern plot...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ccomp Composition and ggtern plot...

R help mailing list-2
Dear Users,

I would like to use compositions package with ggplot/ggtern, other composition classes of compositional package can be used with ggtern by converting to data frame but I could do anything with c(ount)comp class. Ggplot/ggtern can not recognise comp and also can not be converted to data frame. Is there any other way to do this?

Thank you in advance,

Levent TERLEMEZ.



________________________________

Bu elektronik posta ve onunla iletilen bütün dosyalar sadece yukarıda isimleri belirtilen kişiler arasında özel haberleşme amacını taşımakta olup gönderici tarafından alınması amaçlanan yetkili gerçek ya da tüzel kişinin kullanımına aittir. Eğer bu elektronik posta size yanlışlıkla ulaşmışsa, elektronik postanın içeriğini açıklamanız, kopyalamanız, yönlendirmeniz ve kullanmanız kesinlikle yasaktır. Bu durumda, lütfen mesajı geri gönderiniz ve sisteminizden siliniz. Anadolu Üniversitesi bu mesajın içerdiği bilgilerin doğruluğu veya eksiksiz olduğu konusunda herhangi bir garanti vermemektedir. Bu nedenle bu bilgilerin ne şekilde olursa olsun içeriğinden, iletilmesinden, alınmasından ve saklanmasından sorumlu değildir. Bu mesajdaki görüşler yalnızca gönderen kişiye aittir ve Anadolu Üniversitesinin görüşlerini yansıtmayabilir.

This electronic mail and any files transmitted with it are intended for the private use of the people named above. If you are not the intended recipient and received this message in error, forwarding, copying or use of any of the information is strictly prohibited. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. In this case, please immediately notify the sender and delete it from your system. Anadolu University does not guarantee the accuracy or completeness of any information included in this message. Therefore, by any means Anadolu University is not responsible for the content of the message, and the transmission, reception, storage, and use of the information. The opinions expressed in this message only belong to the sender of it and may not reflect the opinions of Anadolu University.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: ccomp Composition and ggtern plot...

Jeff Newmiller
I have no clue what this package is for, but reading the help page for the ccomp function tells you that it returns a numeric vector or matrix. How do YOU want to display information from this numeric vector? That will determine how you would put it into a data frame.
--
Sent from my phone. Please excuse my brevity.

On November 22, 2017 3:13:01 AM PST, Levent TERLEMEZ via R-help <[hidden email]> wrote:

>Dear Users,
>
>I would like to use compositions package with ggplot/ggtern, other
>composition classes of compositional package can be used with ggtern by
>converting to data frame but I could do anything with c(ount)comp
>class. Ggplot/ggtern can not recognise comp and also can not be
>converted to data frame. Is there any other way to do this?
>
>Thank you in advance,
>
>Levent TERLEMEZ.
>
>
>
>________________________________
>
>Bu elektronik posta ve onunla iletilen bütün dosyalar sadece yukarıda
>isimleri belirtilen kişiler arasında özel haberleşme amacını taşımakta
>olup gönderici tarafından alınması amaçlanan yetkili gerçek ya da tüzel
>kişinin kullanımına aittir. Eğer bu elektronik posta size yanlışlıkla
>ulaşmışsa, elektronik postanın içeriğini açıklamanız, kopyalamanız,
>yönlendirmeniz ve kullanmanız kesinlikle yasaktır. Bu durumda, lütfen
>mesajı geri gönderiniz ve sisteminizden siliniz. Anadolu Üniversitesi
>bu mesajın içerdiği bilgilerin doğruluğu veya eksiksiz olduğu konusunda
>herhangi bir garanti vermemektedir. Bu nedenle bu bilgilerin ne şekilde
>olursa olsun içeriğinden, iletilmesinden, alınmasından ve
>saklanmasından sorumlu değildir. Bu mesajdaki görüşler yalnızca
>gönderen kişiye aittir ve Anadolu Üniversitesinin görüşlerini
>yansıtmayabilir.
>
>This electronic mail and any files transmitted with it are intended for
>the private use of the people named above. If you are not the intended
>recipient and received this message in error, forwarding, copying or
>use of any of the information is strictly prohibited. Any dissemination
>or use of this information by a person other than the intended
>recipient is unauthorized and may be illegal. In this case, please
>immediately notify the sender and delete it from your system. Anadolu
>University does not guarantee the accuracy or completeness of any
>information included in this message. Therefore, by any means Anadolu
>University is not responsible for the content of the message, and the
>transmission, reception, storage, and use of the information. The
>opinions expressed in this message only belong to the sender of it and
>may not reflect the opinions of Anadolu University.
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: ccomp Composition and ggtern plot...

Ron Crump-2
In reply to this post by R help mailing list-2
> I would like to use compositions package with ggplot/ggtern, other
> composition classes of compositional package can be used with ggtern
> by converting to data frame but I could do anything with c(ount)comp
> class. Ggplot/ggtern can not recognise comp and also can not be converted > to data frame. Is there any other way to do this?

As Jeff pointed out, the help page says ccomp creates a vector
or matrix. But it assigns a class of 'ccomp', and there is no
obvious way to coerce this directly to a data.frame for use with
ggplot (but I'm not very good with classes so I may be wrong).

However, it does appear to be just a matrix(or vector) with a
class added (I presume to facilitate the provision of class
specific functions), so you can convert it to a matrix (vector)
with attr( my_ccomp, 'class' ) <- NULL and go from there.

eg

library(compositions)
data(SimulatedAmounts)
my_ccomp <- ccomp(sa.lognormals)
print(class(my_ccomp))
attr(my_ccomp,'class')<-NULL
print(class(my_ccomp))
my_ccomp_df <- as.data.frame(my_ccomp)
# or, as I've just seen in the code of plot.ccomp,
# my_ccomp_df <- as.data.frame(unclass(my_ccomp))

Regards,
Ron.
______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: ccomp Composition and ggtern plot...

R help mailing list-2
In reply to this post by Jeff Newmiller
Thank you for your kind and quick answers, Jeff Newmiller and Ron Crump. I
looked at the help pages, but I missed the point you underlined.. Solved
the problem.

Levent TERLEMEZ.



On 22.11.2017 23:23, "Jeff Newmiller" <[hidden email]> wrote:

>I have no clue what this package is for, but reading the help page for
>the ccomp function tells you that it returns a numeric vector or matrix.
>How do YOU want to display information from this numeric vector? That
>will determine how you would put it into a data frame.
>--
>Sent from my phone. Please excuse my brevity.
>
>On November 22, 2017 3:13:01 AM PST, Levent TERLEMEZ via R-help
><[hidden email]> wrote:
>>Dear Users,
>>
>>I would like to use compositions package with ggplot/ggtern, other
>>composition classes of compositional package can be used with ggtern by
>>converting to data frame but I could do anything with c(ount)comp
>>class. Ggplot/ggtern can not recognise comp and also can not be
>>converted to data frame. Is there any other way to do this?
>>
>>Thank you in advance,
>>
>>Levent TERLEMEZ.
>>
>>
>>
>>________________________________
>>
>>Bu elektronik posta ve onunla iletilen bütün dosyalar sadece yukarıda
>>isimleri belirtilen kişiler arasında özel haberleşme amacını taşımakta
>>olup gönderici tarafından alınması amaçlanan yetkili gerçek ya da tüzel
>>kişinin kullanımına aittir. Eğer bu elektronik posta size yanlışlıkla
>>ulaşmışsa, elektronik postanın içeriğini açıklamanız, kopyalamanız,
>>yönlendirmeniz ve kullanmanız kesinlikle yasaktır. Bu durumda, lütfen
>>mesajı geri gönderiniz ve sisteminizden siliniz. Anadolu Üniversitesi
>>bu mesajın içerdiği bilgilerin doğruluğu veya eksiksiz olduğu konusunda
>>herhangi bir garanti vermemektedir. Bu nedenle bu bilgilerin ne şekilde
>>olursa olsun içeriğinden, iletilmesinden, alınmasından ve
>>saklanmasından sorumlu değildir. Bu mesajdaki görüşler yalnızca
>>gönderen kişiye aittir ve Anadolu Üniversitesinin görüşlerini
>>yansıtmayabilir.
>>
>>This electronic mail and any files transmitted with it are intended for
>>the private use of the people named above. If you are not the intended
>>recipient and received this message in error, forwarding, copying or
>>use of any of the information is strictly prohibited. Any dissemination
>>or use of this information by a person other than the intended
>>recipient is unauthorized and may be illegal. In this case, please
>>immediately notify the sender and delete it from your system. Anadolu
>>University does not guarantee the accuracy or completeness of any
>>information included in this message. Therefore, by any means Anadolu
>>University is not responsible for the content of the message, and the
>>transmission, reception, storage, and use of the information. The
>>opinions expressed in this message only belong to the sender of it and
>>may not reflect the opinions of Anadolu University.
>>
>>      [[alternative HTML version deleted]]
>>
>>______________________________________________
>>[hidden email] 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.



________________________________

Bu elektronik posta ve onunla iletilen bütün dosyalar sadece yukarıda isimleri belirtilen kişiler arasında özel haberleşme amacını taşımakta olup gönderici tarafından alınması amaçlanan yetkili gerçek ya da tüzel kişinin kullanımına aittir. Eğer bu elektronik posta size yanlışlıkla ulaşmışsa, elektronik postanın içeriğini açıklamanız, kopyalamanız, yönlendirmeniz ve kullanmanız kesinlikle yasaktır. Bu durumda, lütfen mesajı geri gönderiniz ve sisteminizden siliniz. Anadolu Üniversitesi bu mesajın içerdiği bilgilerin doğruluğu veya eksiksiz olduğu konusunda herhangi bir garanti vermemektedir. Bu nedenle bu bilgilerin ne şekilde olursa olsun içeriğinden, iletilmesinden, alınmasından ve saklanmasından sorumlu değildir. Bu mesajdaki görüşler yalnızca gönderen kişiye aittir ve Anadolu Üniversitesinin görüşlerini yansıtmayabilir.

This electronic mail and any files transmitted with it are intended for the private use of the people named above. If you are not the intended recipient and received this message in error, forwarding, copying or use of any of the information is strictly prohibited. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. In this case, please immediately notify the sender and delete it from your system. Anadolu University does not guarantee the accuracy or completeness of any information included in this message. Therefore, by any means Anadolu University is not responsible for the content of the message, and the transmission, reception, storage, and use of the information. The opinions expressed in this message only belong to the sender of it and may not reflect the opinions of Anadolu University.
______________________________________________
[hidden email] 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.