I disagree with you Jeff. I can reproduce it without any problem. I see no other option than to remove the offending missing data prior to plotting. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey 2015-07-07 14:56 GMT+02:00 Jeff Newmiller <jdnewmil at dcn.davis.ca.us>:> Not reproducible. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live > Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > On July 7, 2015 12:44:20 AM PDT, PIKAL Petr <petr.pikal at precheza.cz> > wrote: > >Dear all. > > > >I want to drop unused (NA) level from geom_segment plot. I tried > >different combination of drop = TRUE argument in several places of > >following code but NA level of prace is still present. > > > >p<-ggplot(snimek, aes(x=cas, y=prace, xend=endtime, yend=prace, > >colour=typ, size=osoba)) > >p+geom_segment(alpha=.4)+scale_size_discrete(range=c(3,6))+ > >guides(colour = guide_legend(override.aes = list(size=4))) > > > >Is it possible to remove NA level directly from ggplot call or do I > >need to discard rows with NA before plotting? > > > >Below are data > > > >Best regards. > >Petr > > > >> dput(snimek) > >snimek <- structure(list(start = c(7.5, 8, 8.1, 8.4, 9.3, 10.45, 11, > >11.35, > >11.5, 12.25, 12.4, 13.2, 14.05, 14.2, 14.3, 7.55, 8, 8.1, 8.15, > >8.35, 9.1, 9.4, 10, 12.05, 12.25, 12.4, 13.35, 14.05, 14.2, 14.3 > >), akce = structure(c(9L, 7L, 11L, 4L, 14L, 8L, 6L, 16L, 14L, > >2L, 15L, 10L, 2L, 8L, 5L, 12L, 7L, 13L, 7L, 18L, 7L, 3L, 7L, > >6L, 2L, 1L, 17L, 2L, 8L, 5L), .Label = c("Administrativa", "Cigareta", > >"CL vzorky", "?i?t?n? MM", "Konec", "Ob?d", "Po??ta?", "P?est?vka", > >"Satna", "Sklad", "Sva?ina", "?atna", "Tisk dokumentace", "?klid", > >"?klid v?robny", "Vymyt? sud?", "V?stra?n? cedule", "Vzorkov?n?" > >), class = "factor"), zarizeni = c(NA, NA, NA, NA, NA, NA, NA, > >NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, > >NA, NA, NA, NA, NA, NA, NA), typ = structure(c(4L, 5L, 4L, 5L, > >5L, 4L, 2L, 5L, 5L, 1L, 5L, 5L, 1L, 4L, NA, 4L, 3L, 5L, 5L, 5L, > >5L, 5L, 5L, 2L, 1L, 5L, 5L, 1L, 4L, NA), .Label = c("Kou?en?", > >"Ob?d", "Po??ta?", "Prostoj", "Re?ie"), class = "factor"), prace > >structure(c(1L, > >2L, 1L, 4L, 2L, 1L, 1L, 2L, 2L, 1L, 3L, 2L, 1L, 1L, NA, 1L, 2L, > >3L, 2L, 3L, 2L, 3L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, NA), .Label = c("Ne", > >"Re?ie", "V?roba", "V?zkum"), class = "factor"), osoba > >structure(c(1L, > >1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, > >2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label > >c("Bern?t", > >"?ervenka"), class = "factor"), cas = structure(list(sec = c(0, > >0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > >0, 0, 0, 0, 0, 0, 0, 0), min = c(50L, 0L, 10L, 40L, 30L, 45L, > >0L, 35L, 50L, 25L, 40L, 20L, 5L, 20L, 30L, 55L, 0L, 10L, 15L, > >35L, 10L, 40L, 0L, 5L, 25L, 40L, 35L, 5L, 20L, 30L), hour = c(7L, > >8L, 8L, 8L, 9L, 10L, 11L, 11L, 11L, 12L, 12L, 13L, 14L, 14L, > >14L, 7L, 8L, 8L, 8L, 8L, 9L, 9L, 10L, 12L, 12L, 12L, 13L, 14L, > >14L, 14L), mday = c(7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, > >7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, > >7L, 7L, 7L), mon = c(6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, > >6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, > >6L, 6L, 6L, 6L), year = c(115L, 115L, 115L, 115L, 115L, 115L, > >115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, > >115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, > >115L, 115L), wday = c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, > >2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, > >2L, 2L, 2L, 2L), yday = c(187L, 187L, 187L, 187L, 187L, 187L, > >187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, > >187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, > >187L, 187L), isdst = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > >1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > >1L, 1L, 1L, 1L), zone = c("CEST", "CEST", "CEST", "CEST", "CEST", > >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", > >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", > >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", > >"CEST"), gmtoff = c(NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >NA_integer_)), .Names = c("sec", "min", "hour", "mday", "mon", > >"year", "wday", "yday", "isdst", "zone", "gmtoff"), class > >c("POSIXlt", > >"POSIXt")), doba = c(10, 10, 30, 50, 75, 15, 35, 15, 35, 15, > >40, 45, 15, 10, NA, 5, 10, 5, 20, 35, 30, 20, 125, 20, 15, 55, > >30, 15, 10, NA), endtime = structure(c(1436248800, 1436249400, > >1436251200, 1436254200, 1436258700, 1436259600, 1436261700, 1436262600, > >1436264700, 1436265600, 1436268000, 1436270700, 1436271600, 1436272200, > >NA, 1436248800, 1436249400, 1436249700, 1436250900, 1436253000, > >1436254800, 1436256000, 1436263500, 1436264700, 1436265600, 1436268900, > >1436270700, 1436271600, 1436272200, NA), class = c("POSIXct", > >"POSIXt"))), .Names = c("start", "akce", "zarizeni", "typ", "prace", > >"osoba", "cas", "doba", "endtime"), row.names = c(NA, -30L), class > >"data.frame") > > > > > > > >________________________________ > >Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a jsou > >ur?eny pouze jeho adres?t?m. > >Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? > >neprodlen? jeho odes?latele. Obsah tohoto emailu i s p??lohami a jeho > >kopie vyma?te ze sv?ho syst?mu. > >Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni tento > >email jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat. > >Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou > >modifikacemi ?i zpo?d?n?m p?enosu e-mailu. > > > >V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?: > >- vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? > >smlouvy, a to z jak?hokoliv d?vodu i bez uveden? d?vodu. > >- a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? > >p?ijmout; Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? nab?dky > >ze strany p??jemce s dodatkem ?i odchylkou. > >- trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve > >v?slovn?m dosa?en?m shody na v?ech jej?ch n?le?itostech. > >- odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za > >spole?nost ??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? > >zmocn?n nebo p?semn? pov??en a takov? pov??en? nebo pln? moc byly > >adres?tovi tohoto emailu p??padn? osob?, kterou adres?t zastupuje, > >p?edlo?eny nebo jejich existence je adres?tovi ?i osob? j?m zastoupen? > >zn?m?. > > > >This e-mail and any documents attached to it may be confidential and > >are intended only for its intended recipients. > >If you received this e-mail by mistake, please immediately inform its > >sender. Delete the contents of this e-mail with all attachments and its > >copies from your system. > >If you are not the intended recipient of this e-mail, you are not > >authorized to use, disseminate, copy or disclose this e-mail in any > >manner. > >The sender of this e-mail shall not be liable for any possible damage > >caused by modifications of the e-mail or by delay with transfer of the > >email. > > > >In case that this e-mail forms part of business dealings: > >- the sender reserves the right to end negotiations about entering into > >a contract in any time, for any reason, and without stating any > >reasoning. > >- if the e-mail contains an offer, the recipient is entitled to > >immediately accept such offer; The sender of this e-mail (offer) > >excludes any acceptance of the offer on the part of the recipient > >containing any amendment or variation. > >- the sender insists on that the respective contract is concluded only > >upon an express mutual agreement on all its aspects. > >- the sender of this e-mail informs that he/she is not authorized to > >enter into any contracts on behalf of the company except for cases in > >which he/she is expressly authorized to do so in writing, and such > >authorization or power of attorney is submitted to the recipient or the > >person represented by the recipient, or the existence of such > >authorization is known to the recipient of the person represented by > >the recipient. > > > >______________________________________________ > >R-help at 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 at 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]]
Sorry, now it works for me as well. And yes, must drop rows with is.na( prace ) prior to calling ggplot. Note that the levels of prace do not contain NA so your subject line is not correct. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On July 7, 2015 6:09:01 AM PDT, Thierry Onkelinx <thierry.onkelinx at inbo.be> wrote:>I disagree with you Jeff. I can reproduce it without any problem. > >I see no other option than to remove the offending missing data prior >to >plotting. > >Best regards, > >ir. Thierry Onkelinx >Instituut voor natuur- en bosonderzoek / Research Institute for Nature >and >Forest >team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance >Kliniekstraat 25 >1070 Anderlecht >Belgium > >To call in the statistician after the experiment is done may be no more >than asking him to perform a post-mortem examination: he may be able to >say >what the experiment died of. ~ Sir Ronald Aylmer Fisher >The plural of anecdote is not data. ~ Roger Brinner >The combination of some data and an aching desire for an answer does >not >ensure that a reasonable answer can be extracted from a given body of >data. >~ John Tukey > >2015-07-07 14:56 GMT+02:00 Jeff Newmiller <jdnewmil at dcn.davis.ca.us>: > >> Not reproducible. >> >--------------------------------------------------------------------------- >> Jeff Newmiller The ..... ..... Go >Live... >> DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live >> Go... >> Live: OO#.. Dead: OO#.. >Playing >> Research Engineer (Solar/Batteries O.O#. #.O#. with >> /Software/Embedded Controllers) .OO#. .OO#. >rocks...1k >> >--------------------------------------------------------------------------- >> Sent from my phone. Please excuse my brevity. >> >> On July 7, 2015 12:44:20 AM PDT, PIKAL Petr <petr.pikal at precheza.cz> >> wrote: >> >Dear all. >> > >> >I want to drop unused (NA) level from geom_segment plot. I tried >> >different combination of drop = TRUE argument in several places of >> >following code but NA level of prace is still present. >> > >> >p<-ggplot(snimek, aes(x=cas, y=prace, xend=endtime, yend=prace, >> >colour=typ, size=osoba)) >> >p+geom_segment(alpha=.4)+scale_size_discrete(range=c(3,6))+ >> >guides(colour = guide_legend(override.aes = list(size=4))) >> > >> >Is it possible to remove NA level directly from ggplot call or do I >> >need to discard rows with NA before plotting? >> > >> >Below are data >> > >> >Best regards. >> >Petr >> > >> >> dput(snimek) >> >snimek <- structure(list(start = c(7.5, 8, 8.1, 8.4, 9.3, 10.45, 11, >> >11.35, >> >11.5, 12.25, 12.4, 13.2, 14.05, 14.2, 14.3, 7.55, 8, 8.1, 8.15, >> >8.35, 9.1, 9.4, 10, 12.05, 12.25, 12.4, 13.35, 14.05, 14.2, 14.3 >> >), akce = structure(c(9L, 7L, 11L, 4L, 14L, 8L, 6L, 16L, 14L, >> >2L, 15L, 10L, 2L, 8L, 5L, 12L, 7L, 13L, 7L, 18L, 7L, 3L, 7L, >> >6L, 2L, 1L, 17L, 2L, 8L, 5L), .Label = c("Administrativa", >"Cigareta", >> >"CL vzorky", "?i?t?n? MM", "Konec", "Ob?d", "Po??ta?", "P?est?vka", >> >"Satna", "Sklad", "Sva?ina", "?atna", "Tisk dokumentace", "?klid", >> >"?klid v?robny", "Vymyt? sud?", "V?stra?n? cedule", "Vzorkov?n?" >> >), class = "factor"), zarizeni = c(NA, NA, NA, NA, NA, NA, NA, >> >NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, >> >NA, NA, NA, NA, NA, NA, NA), typ = structure(c(4L, 5L, 4L, 5L, >> >5L, 4L, 2L, 5L, 5L, 1L, 5L, 5L, 1L, 4L, NA, 4L, 3L, 5L, 5L, 5L, >> >5L, 5L, 5L, 2L, 1L, 5L, 5L, 1L, 4L, NA), .Label = c("Kou?en?", >> >"Ob?d", "Po??ta?", "Prostoj", "Re?ie"), class = "factor"), prace >> >structure(c(1L, >> >2L, 1L, 4L, 2L, 1L, 1L, 2L, 2L, 1L, 3L, 2L, 1L, 1L, NA, 1L, 2L, >> >3L, 2L, 3L, 2L, 3L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, NA), .Label >c("Ne", >> >"Re?ie", "V?roba", "V?zkum"), class = "factor"), osoba >> >structure(c(1L, >> >1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, >> >2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label >> >c("Bern?t", >> >"?ervenka"), class = "factor"), cas = structure(list(sec = c(0, >> >0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, >> >0, 0, 0, 0, 0, 0, 0, 0), min = c(50L, 0L, 10L, 40L, 30L, 45L, >> >0L, 35L, 50L, 25L, 40L, 20L, 5L, 20L, 30L, 55L, 0L, 10L, 15L, >> >35L, 10L, 40L, 0L, 5L, 25L, 40L, 35L, 5L, 20L, 30L), hour = c(7L, >> >8L, 8L, 8L, 9L, 10L, 11L, 11L, 11L, 12L, 12L, 13L, 14L, 14L, >> >14L, 7L, 8L, 8L, 8L, 8L, 9L, 9L, 10L, 12L, 12L, 12L, 13L, 14L, >> >14L, 14L), mday = c(7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, >> >7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, >> >7L, 7L, 7L), mon = c(6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, >> >6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, >> >6L, 6L, 6L, 6L), year = c(115L, 115L, 115L, 115L, 115L, 115L, >> >115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, >> >115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, >> >115L, 115L), wday = c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, >> >2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, >> >2L, 2L, 2L, 2L), yday = c(187L, 187L, 187L, 187L, 187L, 187L, >> >187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, >> >187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, >> >187L, 187L), isdst = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, >> >1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, >> >1L, 1L, 1L, 1L), zone = c("CEST", "CEST", "CEST", "CEST", "CEST", >> >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", >> >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", >> >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", >> >"CEST"), gmtoff = c(NA_integer_, NA_integer_, NA_integer_, >NA_integer_, >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, >> >NA_integer_)), .Names = c("sec", "min", "hour", "mday", "mon", >> >"year", "wday", "yday", "isdst", "zone", "gmtoff"), class >> >c("POSIXlt", >> >"POSIXt")), doba = c(10, 10, 30, 50, 75, 15, 35, 15, 35, 15, >> >40, 45, 15, 10, NA, 5, 10, 5, 20, 35, 30, 20, 125, 20, 15, 55, >> >30, 15, 10, NA), endtime = structure(c(1436248800, 1436249400, >> >1436251200, 1436254200, 1436258700, 1436259600, 1436261700, >1436262600, >> >1436264700, 1436265600, 1436268000, 1436270700, 1436271600, >1436272200, >> >NA, 1436248800, 1436249400, 1436249700, 1436250900, 1436253000, >> >1436254800, 1436256000, 1436263500, 1436264700, 1436265600, >1436268900, >> >1436270700, 1436271600, 1436272200, NA), class = c("POSIXct", >> >"POSIXt"))), .Names = c("start", "akce", "zarizeni", "typ", "prace", >> >"osoba", "cas", "doba", "endtime"), row.names = c(NA, -30L), class >> >"data.frame") >> > >> > >> > >> >________________________________ >> >Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a >jsou >> >ur?eny pouze jeho adres?t?m. >> >Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? >> >neprodlen? jeho odes?latele. Obsah tohoto emailu i s p??lohami a >jeho >> >kopie vyma?te ze sv?ho syst?mu. >> >Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni tento >> >email jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat. >> >Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou >> >modifikacemi ?i zpo?d?n?m p?enosu e-mailu. >> > >> >V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?: >> >- vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? >> >smlouvy, a to z jak?hokoliv d?vodu i bez uveden? d?vodu. >> >- a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? >> >p?ijmout; Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? >nab?dky >> >ze strany p??jemce s dodatkem ?i odchylkou. >> >- trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve >> >v?slovn?m dosa?en?m shody na v?ech jej?ch n?le?itostech. >> >- odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za >> >spole?nost ??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? >> >zmocn?n nebo p?semn? pov??en a takov? pov??en? nebo pln? moc byly >> >adres?tovi tohoto emailu p??padn? osob?, kterou adres?t zastupuje, >> >p?edlo?eny nebo jejich existence je adres?tovi ?i osob? j?m >zastoupen? >> >zn?m?. >> > >> >This e-mail and any documents attached to it may be confidential and >> >are intended only for its intended recipients. >> >If you received this e-mail by mistake, please immediately inform >its >> >sender. Delete the contents of this e-mail with all attachments and >its >> >copies from your system. >> >If you are not the intended recipient of this e-mail, you are not >> >authorized to use, disseminate, copy or disclose this e-mail in any >> >manner. >> >The sender of this e-mail shall not be liable for any possible >damage >> >caused by modifications of the e-mail or by delay with transfer of >the >> >email. >> > >> >In case that this e-mail forms part of business dealings: >> >- the sender reserves the right to end negotiations about entering >into >> >a contract in any time, for any reason, and without stating any >> >reasoning. >> >- if the e-mail contains an offer, the recipient is entitled to >> >immediately accept such offer; The sender of this e-mail (offer) >> >excludes any acceptance of the offer on the part of the recipient >> >containing any amendment or variation. >> >- the sender insists on that the respective contract is concluded >only >> >upon an express mutual agreement on all its aspects. >> >- the sender of this e-mail informs that he/she is not authorized to >> >enter into any contracts on behalf of the company except for cases >in >> >which he/she is expressly authorized to do so in writing, and such >> >authorization or power of attorney is submitted to the recipient or >the >> >person represented by the recipient, or the existence of such >> >authorization is known to the recipient of the person represented by >> >the recipient. >> > >> >______________________________________________ >> >R-help at 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 at 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. >>
Thanks to all who responded. It is easy to remove NA from factor so I will go this way. I just wanted to know that I did not miss some simple canned solution. Best regards Petr> -----Original Message----- > From: Jeff Newmiller [mailto:jdnewmil at dcn.davis.CA.us] > Sent: Tuesday, July 07, 2015 3:45 PM > To: Thierry Onkelinx > Cc: PIKAL Petr; R-help > Subject: Re: [R] geom_segment drop unused levels > > Sorry, now it works for me as well. And yes, must drop rows with is.na( > prace ) prior to calling ggplot. Note that the levels of prace do not > contain NA so your subject line is not correct. > ----------------------------------------------------------------------- > ---- > Jeff Newmiller The ..... ..... Go > Live... > DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live > Go... > Live: OO#.. Dead: OO#.. > Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. > rocks...1k > ----------------------------------------------------------------------- > ---- > Sent from my phone. Please excuse my brevity. > > On July 7, 2015 6:09:01 AM PDT, Thierry Onkelinx > <thierry.onkelinx at inbo.be> wrote: > >I disagree with you Jeff. I can reproduce it without any problem. > > > >I see no other option than to remove the offending missing data prior > >to plotting. > > > >Best regards, > > > >ir. Thierry Onkelinx > >Instituut voor natuur- en bosonderzoek / Research Institute for Nature > >and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality > >Assurance Kliniekstraat 25 1070 Anderlecht Belgium > > > >To call in the statistician after the experiment is done may be no > more > >than asking him to perform a post-mortem examination: he may be able > to > >say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural > >of anecdote is not data. ~ Roger Brinner The combination of some data > >and an aching desire for an answer does not ensure that a reasonable > >answer can be extracted from a given body of data. > >~ John Tukey > > > >2015-07-07 14:56 GMT+02:00 Jeff Newmiller <jdnewmil at dcn.davis.ca.us>: > > > >> Not reproducible. > >> > >---------------------------------------------------------------------- > - > >---- > >> Jeff Newmiller The ..... ..... Go > >Live... > >> DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. > Live > >> Go... > >> Live: OO#.. Dead: OO#.. > >Playing > >> Research Engineer (Solar/Batteries O.O#. #.O#. > with > >> /Software/Embedded Controllers) .OO#. .OO#. > >rocks...1k > >> > >---------------------------------------------------------------------- > - > >---- > >> Sent from my phone. Please excuse my brevity. > >> > >> On July 7, 2015 12:44:20 AM PDT, PIKAL Petr <petr.pikal at precheza.cz> > >> wrote: > >> >Dear all. > >> > > >> >I want to drop unused (NA) level from geom_segment plot. I tried > >> >different combination of drop = TRUE argument in several places of > >> >following code but NA level of prace is still present. > >> > > >> >p<-ggplot(snimek, aes(x=cas, y=prace, xend=endtime, yend=prace, > >> >colour=typ, size=osoba)) > >> >p+geom_segment(alpha=.4)+scale_size_discrete(range=c(3,6))+ > >> >guides(colour = guide_legend(override.aes = list(size=4))) > >> > > >> >Is it possible to remove NA level directly from ggplot call or do I > >> >need to discard rows with NA before plotting? > >> > > >> >Below are data > >> > > >> >Best regards. > >> >Petr > >> > > >> >> dput(snimek) > >> >snimek <- structure(list(start = c(7.5, 8, 8.1, 8.4, 9.3, 10.45, > 11, > >> >11.35, 11.5, 12.25, 12.4, 13.2, 14.05, 14.2, 14.3, 7.55, 8, 8.1, > >> >8.15, 8.35, 9.1, 9.4, 10, 12.05, 12.25, 12.4, 13.35, 14.05, 14.2, > >> >14.3 ), akce = structure(c(9L, 7L, 11L, 4L, 14L, 8L, 6L, 16L, 14L, > >> >2L, 15L, 10L, 2L, 8L, 5L, 12L, 7L, 13L, 7L, 18L, 7L, 3L, 7L, 6L, > 2L, > >> >1L, 17L, 2L, 8L, 5L), .Label = c("Administrativa", > >"Cigareta", > >> >"CL vzorky", "?i?t?n? MM", "Konec", "Ob?d", "Po??ta?", "P?est?vka", > >> >"Satna", "Sklad", "Sva?ina", "?atna", "Tisk dokumentace", "?klid", > >> >"?klid v?robny", "Vymyt? sud?", "V?stra?n? cedule", "Vzorkov?n?" > >> >), class = "factor"), zarizeni = c(NA, NA, NA, NA, NA, NA, NA, NA, > >> >NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, > >> >NA, NA, NA, NA, NA), typ = structure(c(4L, 5L, 4L, 5L, 5L, 4L, 2L, > >> >5L, 5L, 1L, 5L, 5L, 1L, 4L, NA, 4L, 3L, 5L, 5L, 5L, 5L, 5L, 5L, 2L, > >> >1L, 5L, 5L, 1L, 4L, NA), .Label = c("Kou?en?", "Ob?d", "Po??ta?", > >> >"Prostoj", "Re?ie"), class = "factor"), prace = structure(c(1L, 2L, > >> >1L, 4L, 2L, 1L, 1L, 2L, 2L, 1L, 3L, 2L, 1L, 1L, NA, 1L, 2L, 3L, 2L, > >> >3L, 2L, 3L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, NA), .Label > >c("Ne", > >> >"Re?ie", "V?roba", "V?zkum"), class = "factor"), osoba > >> >structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > >> >1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), > >> >.Label = c("Bern?t", "?ervenka"), class = "factor"), cas > >> >structure(list(sec = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > >> >0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), min = c(50L, 0L, 10L, > >> >40L, 30L, 45L, 0L, 35L, 50L, 25L, 40L, 20L, 5L, 20L, 30L, 55L, 0L, > >> >10L, 15L, 35L, 10L, 40L, 0L, 5L, 25L, 40L, 35L, 5L, 20L, 30L), hour > >> >= c(7L, 8L, 8L, 8L, 9L, 10L, 11L, 11L, 11L, 12L, 12L, 13L, 14L, > 14L, > >> >14L, 7L, 8L, 8L, 8L, 8L, 9L, 9L, 10L, 12L, 12L, 12L, 13L, 14L, 14L, > >> >14L), mday = c(7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, > >> >7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, > 7L), > >> >mon = c(6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, > >> >6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L), year > >> >c(115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, > >> >115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L, > >> >115L, 115L, 115L, 115L, 115L, 115L, 115L, 115L), wday = c(2L, 2L, > >> >2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, > >> >2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), yday = c(187L, 187L, > >> >187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, > >> >187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, 187L, > >> >187L, 187L, 187L, 187L, 187L, 187L), isdst = c(1L, 1L, 1L, 1L, 1L, > >> >1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, > >> >1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), zone = c("CEST", "CEST", "CEST", > >> >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", > >> >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", > >> >"CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", "CEST", > >> >"CEST", "CEST", "CEST"), gmtoff = c(NA_integer_, NA_integer_, > >> >NA_integer_, > >NA_integer_, > >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >> >NA_integer_, NA_integer_, NA_integer_, NA_integer_, NA_integer_, > >> >NA_integer_)), .Names = c("sec", "min", "hour", "mday", "mon", > >> >"year", "wday", "yday", "isdst", "zone", "gmtoff"), class > >> >c("POSIXlt", "POSIXt")), doba = c(10, 10, 30, 50, 75, 15, 35, 15, > >> >35, 15, 40, 45, 15, 10, NA, 5, 10, 5, 20, 35, 30, 20, 125, 20, 15, > >> >55, 30, 15, 10, NA), endtime = structure(c(1436248800, 1436249400, > >> >1436251200, 1436254200, 1436258700, 1436259600, 1436261700, > >1436262600, > >> >1436264700, 1436265600, 1436268000, 1436270700, 1436271600, > >1436272200, > >> >NA, 1436248800, 1436249400, 1436249700, 1436250900, 1436253000, > >> >1436254800, 1436256000, 1436263500, 1436264700, 1436265600, > >1436268900, > >> >1436270700, 1436271600, 1436272200, NA), class = c("POSIXct", > >> >"POSIXt"))), .Names = c("start", "akce", "zarizeni", "typ", > "prace", > >> >"osoba", "cas", "doba", "endtime"), row.names = c(NA, -30L), class > > >> >"data.frame") > >> > > >> > > >> > > >> >________________________________ > >> >Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a > >jsou > >> >ur?eny pouze jeho adres?t?m. > >> >Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? > >> >neprodlen? jeho odes?latele. Obsah tohoto emailu i s p??lohami a > >jeho > >> >kopie vyma?te ze sv?ho syst?mu. > >> >Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni > tento > >> >email jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat. > >> >Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou > >> >modifikacemi ?i zpo?d?n?m p?enosu e-mailu. > >> > > >> >V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?: > >> >- vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? > >> >smlouvy, a to z jak?hokoliv d?vodu i bez uveden? d?vodu. > >> >- a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? > >> >p?ijmout; Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? > >nab?dky > >> >ze strany p??jemce s dodatkem ?i odchylkou. > >> >- trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve > >> >v?slovn?m dosa?en?m shody na v?ech jej?ch n?le?itostech. > >> >- odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za > >> >spole?nost ??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? > >> >zmocn?n nebo p?semn? pov??en a takov? pov??en? nebo pln? moc byly > >> >adres?tovi tohoto emailu p??padn? osob?, kterou adres?t zastupuje, > >> >p?edlo?eny nebo jejich existence je adres?tovi ?i osob? j?m > >zastoupen? > >> >zn?m?. > >> > > >> >This e-mail and any documents attached to it may be confidential > and > >> >are intended only for its intended recipients. > >> >If you received this e-mail by mistake, please immediately inform > >its > >> >sender. Delete the contents of this e-mail with all attachments and > >its > >> >copies from your system. > >> >If you are not the intended recipient of this e-mail, you are not > >> >authorized to use, disseminate, copy or disclose this e-mail in any > >> >manner. > >> >The sender of this e-mail shall not be liable for any possible > >damage > >> >caused by modifications of the e-mail or by delay with transfer of > >the > >> >email. > >> > > >> >In case that this e-mail forms part of business dealings: > >> >- the sender reserves the right to end negotiations about entering > >into > >> >a contract in any time, for any reason, and without stating any > >> >reasoning. > >> >- if the e-mail contains an offer, the recipient is entitled to > >> >immediately accept such offer; The sender of this e-mail (offer) > >> >excludes any acceptance of the offer on the part of the recipient > >> >containing any amendment or variation. > >> >- the sender insists on that the respective contract is concluded > >only > >> >upon an express mutual agreement on all its aspects. > >> >- the sender of this e-mail informs that he/she is not authorized > to > >> >enter into any contracts on behalf of the company except for cases > >in > >> >which he/she is expressly authorized to do so in writing, and such > >> >authorization or power of attorney is submitted to the recipient or > >the > >> >person represented by the recipient, or the existence of such > >> >authorization is known to the recipient of the person represented > by > >> >the recipient. > >> > > >> >______________________________________________ > >> >R-help at 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 at 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. > >>________________________________ Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a jsou ur?eny pouze jeho adres?t?m. Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? neprodlen? jeho odes?latele. Obsah tohoto emailu i s p??lohami a jeho kopie vyma?te ze sv?ho syst?mu. Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni tento email jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat. Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou modifikacemi ?i zpo?d?n?m p?enosu e-mailu. V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?: - vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? smlouvy, a to z jak?hokoliv d?vodu i bez uveden? d?vodu. - a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? p?ijmout; Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? nab?dky ze strany p??jemce s dodatkem ?i odchylkou. - trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve v?slovn?m dosa?en?m shody na v?ech jej?ch n?le?itostech. - odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za spole?nost ??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? zmocn?n nebo p?semn? pov??en a takov? pov??en? nebo pln? moc byly adres?tovi tohoto emailu p??padn? osob?, kterou adres?t zastupuje, p?edlo?eny nebo jejich existence je adres?tovi ?i osob? j?m zastoupen? zn?m?. This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients. If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system. If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner. The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email. In case that this e-mail forms part of business dealings: - the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning. - if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation. - the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects. - the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient.