kassambara / easyGgplot2

34 stars 10 forks source link

Error after upgrading ggplot2 to ver 2.0.0 #2

Closed ghost closed 7 years ago

ghost commented 8 years ago

ggplot2.boxplot generated the following error after updating ggplot2. Are you going to update your package in order to be compatible with ggplot2 ver 2.0.0 ?

Error: Unknown parameters: mainTitle, xtitle, ytitle, legendTitle In addition: Warning messages: 1: replacing previous import by 'grid::unit' when loading 'ggthemes' 2: replacing previous import by 'grid::arrow' when loading 'ggthemes' 3: replacing previous import by 'scales::alpha' when loading 'ggthemes' 4: replacing previous import by 'grid::unit' when loading 'sjPlot' 5: In crs$dataset <- my.data : Coercing LHS to a list 6: replacing previous import by 'ggplot2::arrow' when loading 'Hmisc' 7: replacing previous import by 'ggplot2::unit' when loading 'Hmisc' 8: replacing previous import by 'scales::alpha' when loading 'Hmisc'

kassambara commented 8 years ago

Hi, I'll upgrade the package and let you know as soon as possible. Thank you for reporting this error.

Best Regards, A. Kassambara

kassambara commented 8 years ago

Hi,

easyGgplot2 has been updated know.

Install the latest version as follow:

if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/easyGgplot2")

Please, let me know if your code works...

Best Regards, A. KASSAMBARA

ghost commented 8 years ago

Thank you.

I only faced a problem (that didn't occur before) when there is a group in the dataframe with only one observation. An example follows (sorry for the greek words in the dataset)

PROBLEM (no desnities - only MeanLines)

ggplot2.density(data=dt, xName='mon_kost', groupName='methodos_kataskevis', xtitle = 'Κόστος (€) / μ.μ.', yTickLabelFont=c(9, "bold", "black"), mainTitle="Εξομαλυμένες πυκνότητες μον. κόστους, ανά Μέθοδο Κατασκευής", brewerPalette='Dark2', legendTitle="Μέθοδος Κατασκευής: ", ytitle="Πυκνότητα", alpha=0.5, fillGroupDensity=TRUE, addMeanLine=TRUE, meanLineSize=1) + theme_bw() + theme(legend.position = "bottom")

NO PROBLEM

ggplot2.density(data=dt[dt$methodos_kataskevis != "Προβολοδόμηση",], xName='mon_kost', groupName='methodos_kataskevis', xtitle = 'Κόστος (€) / μ.μ.', yTickLabelFont=c(9, "bold", "black"), mainTitle="Εξομαλυμένες πυκνότητες μον. κόστους, ανά Μέθοδο Κατασκευής", brewerPalette='Dark2', legendTitle="Μέθοδος Κατασκευής: ", ytitle="Πυκνότητα", alpha=0.5, fillGroupDensity=TRUE, addMeanLine=TRUE, meanLineSize=1) + theme_bw() + theme(legend.position = "bottom")

DATA

dt <- structure( list( gr_aa = c( 768L, 1042L, 1065L, 1068L, 1099L, 1100L, 673L, 676L, 679L, 681L, 683L, 685L, 686L, 1710L, 687L, 689L, 1713L, 692L, 1719L, 698L, 702L, 703L, 704L, 705L, 1729L, 707L, 1734L, 477L, 481L, 485L, 493L, 495L, 497L, 766L ), ta_type = c( "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα", "Σιδ. Γέφυρα" ), perigrafh = c( "ΣΓ25", "ΛΑΔΟΠΟΤΑΜΟΥ", "ΣΓ03 ΡΕΜΑ ΣΕΛΙΑΝΔΡΟΥ", "ΣΓ06 ΡΕΜΑ ΑΓΙΩΡΓΙΤΙΚΟ", "ΣΓ24", "ΣΓ27", "ΣΓ1 ΜΠΕΚΙΟΡΡΕΜΑΤΟΣ", "ΣΓ3 ΡΕΜΑΤΟΣ ΠΑΠΑΚΥΡΤΣΟΠΟΥΛΟΥ", "ΣΓ5 2Η ΡΕΜΑΤΟΣ ΠΑΠΑΚΥΡΤΣΟΠΟΥΛΟΥ", "ΣΓ7 ΡΕΜΑΤΟΣ ΠΛΑΤΑΝΑ", "ΣΓ8 ΔΡΙΜΑΡΙΟΡΡΕΜΑΤΟΣ", "ΣΓ9 ΠΡΟΣΩΡΙΝΗ ΣΤΗΝ ΥΦΙΣΤΑΜΕΝΗ ΓΡΑΜΜΗ", "ΣΓ10 ΑΜΠΕΛΟΡΡΕΜΑΤΟΣ", "ΣΓ19 (ΓΕΦΥΡΑ Γ1) ΘΟΛΟΠΟΤΑΜΟΣ", "ΣΓ11 ΒΟΪΔΟΡΡΕΜΑΤΟΣ", "ΣΓ28", "ΣΓ 20 ΒΡΩΜΟΛΑΓΓΑΔΟ", "ΣΓ32", "ΣΓ 21 (ΓΕΦΥΡΑ Γ4) ΦΟΙΝΙΚΑΣ", "ΣΓ19", "ΣΓ12 ΒΟΪΔΟΡΡΕΜΑΤΟΣ (1Η)", "ΣΓ13 ΒΟΪΔΟΡΡΕΜΑΤΟΣ (2Η)", "ΣΓ14 ΒΟΪΔΟΡΡΕΜΑΤΟΣ (3Η)", "ΣΓ15 ΒΟΪΔΟΡΡΕΜΑΤΟΣ (4Η)", "ΣΓ 22", "ΣΓ16 ΒΟΪΔΟΡΡΕΜΑΤΟΣ (5Η)", "ΣΓ 24", "ΡΕΜΜΑ ΡΑΧΙΑΝΗΣ (Τ-06)", "ΡΕΜΜΑ ΖΑΠΑΝΤΗ (Τ-11)", "ΡΕΜΜΑ ΒΑΡΕΛΑ (Τ-14)", "ΑΣΩΠΟΣ ΠΟΤΑΜΟΣ (T-20)", "ΧΕΙΜΑΡΟΣ ΕΛΙΣΣΩΝΑ (Τ-23)", "ΡΕΜΜΑ ΚΥΡΙΛΛΟΥ (Τ-25)", "ΣΓ23Ν" ), route_descr = c( "ΛΙΑΝΟΚΛΑΔΙ - ΔΟΜΟΚΟΣ", "ΚΙΑΤΟ - ΠΑΤΡΑ 59-75", "ΚΙΑΤΟ - ΠΑΤΡΑ 21-40", "ΚΙΑΤΟ - ΠΑΤΡΑ 21-40", "ΛΙΑΝΟΚΛΑΔΙ - ΔΟΜΟΚΟΣ", "ΛΙΑΝΟΚΛΑΔΙ - ΔΟΜΟΚΟΣ", "ΛΙΑΝΟΚΛΑΔΙ - ΔΟΜΟΚΟΣ", "ΛΙΑΝΟΚΛΑΔΙ

On Thu, Jan 14, 2016 at 12:36 PM, Alboukadel KASSAMBARA < notifications@github.com> wrote:

Hi,

easyGgplot2 has been updated know.

Install the latest version as follow:

if(!require(devtools)) install.packages("devtools")devtools::install_github("kassambara/easyGgplot2")

Please, let me know if your code works...

Best Regards, A. KASSAMBARA

— Reply to this email directly or view it on GitHub https://github.com/kassambara/easyGgplot2/issues/2#issuecomment-171603694 .

kassambara commented 8 years ago

Thank you again for your feedback.

This problem is not from easyGgplot2. It's from ggplot2 v2..

I have the same problem when I use ggplot2 v2 original syntax as follow:

# problem
ggplot(dt, aes(x = mon_kost)) +
  geom_density(aes(fill = methodos_kataskevis))

# no problem
ggplot(dt[dt$methodos_kataskevis != "Προβολοδόμηση",], aes(x = mon_kost)) +
  geom_density(aes(fill = methodos_kataskevis), alpha = 0.5)

I think that, it makes sens to remove a group with only one observation, before plotting.

Best Regards, AK

ghost commented 8 years ago

Ah, ok Thank you very much, for your immediate response.

Best Regards, George

On Thu, Jan 14, 2016 at 1:35 PM, Alboukadel KASSAMBARA < notifications@github.com> wrote:

Thank you again for your feedback.

This problem is not from easyGgplot2. It's from ggplot2 v2..

I have the same problem when use ggplot2 v2 original syntax as follow:

problem

ggplot(dt, aes(x = mon_kost)) + geom_density(aes(fill = methodos_kataskevis))

no problem

ggplot(dt[dt$methodos_kataskevis != "Προβολοδόμηση",], aes(x = mon_kost)) + geom_density(aes(fill = methodos_kataskevis), alpha = 0.5)

I think that, it makes sens to remove a group with only one observation, before plotting.

Best Regards, AK

— Reply to this email directly or view it on GitHub https://github.com/kassambara/easyGgplot2/issues/2#issuecomment-171619081 .

eghorani commented 7 years ago

Hi, thanks for the great work you're doing.

I'm having a problem dodging bars using ggplot2.barplot.

Using the example code you've provided:

df<-restaurant ggplot2.barplot(data=df, xName='time', yName="total_bill", groupName='sex', position=position_dodge())

This produces stacked bars only.

this code works:

ggplot(df, aes(x=time, y=total_bill, fill=sex)) + geom_bar(stat="identity", position="dodge")

kassambara commented 7 years ago

Hi,

This issue has been fixed now. Please install the latest version.

I would highly suggest to use ggpubr package (read this: http://www.sthda.com/english/wiki/ggpubr-r-package-ggplot2-based-publication-ready-plots), which will be a replacement of easyGgplot2.

For ggpubr::ggbarplot, read this: http://www.sthda.com/english/rpkgs/ggpubr/reference/ggbarplot.html

Best, /A

eghorani commented 7 years ago

Hi,

Thanks again, your contribution really has been outstanding.

Ggpubr looks great and I’ll give that a go.

Best wishes

Ehsan

From: Alboukadel KASSAMBARA [mailto:notifications@github.com] Sent: 30 December 2016 08:27 To: kassambara/easyGgplot2 easyGgplot2@noreply.github.com Cc: GHORANI, Ehsan (IMPERIAL COLLEGE HEALTHCARE NHS TRUST) eghorani@nhs.net; Comment comment@noreply.github.com Subject: Re: [kassambara/easyGgplot2] Error after upgrading ggplot2 to ver 2.0.0 (#2)

Hi,

This issue has been fixed now. Please install the latest version.

I would highly suggest to use ggpubr package (read this: http://www.sthda.com/english/wiki/ggpubr-r-package-ggplot2-based-publication-ready-plots), which will be a replacement of easyGgplot2.

For ggpubr::ggbarplot, read this: http://www.sthda.com/english/rpkgs/ggpubr/reference/ggbarplot.html

Best, /A

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/kassambara/easyGgplot2/issues/2#issuecomment-269745340, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AWbuBt73x4Hp9pIN3-K8WKUtI8qdWeREks5rNMBegaJpZM4HDzCm.


This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSi recipients NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit www.nhsdigital.nhs.uk/nhsmail


kassambara commented 7 years ago

So, we can close this issue. I really appreciate your comment!!