您好我是r的新手,并且遇到ggplot2和sime boxplot的问题。 基本上,我有三列数据框:Station,Entries和Dummy。车站在德国识别火车站。参赛作品是每天的乘客数量,假人只需设置为1。
我尝试使用以下代码创建一个boxplot:
setwd("DataDir")
data <- read.csv2("playground.csv")
data$Dummy<-factor(1)
bplot <- ggplot(data,aes(Dummy,Entries))
bplot + geom_boxplot() + labs(x="Dummy", y = "Entries per Hour")
不幸的是,这只会返回一个完全奇怪的“boxplot”,从左下角到右下角有一条对角线,还有很多不可读的垃圾和最左边的垃圾。 任何人都可以告诉我什么是错误的吗? “条目”列的类型为整数,范围为0到100.000
这里编辑是df的转储:
structure(list(Station = structure(c(1L, 2L, 3L, 4L, 5L, 6L,
7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L,
20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L,
33L, 35L, 34L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L,
46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L,
59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L,
72L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 80L, 81L, 82L, 83L, 84L,
85L, 86L, 87L, 88L, 89L, 90L, 91L, 92L, 93L, 94L, 95L, 96L, 97L,
98L, 99L, 100L, 101L, 102L, 103L, 104L, 105L, 106L, 107L, 108L,
109L, 110L, 111L, 112L, 113L, 114L, 115L, 116L, 117L, 118L, 120L,
119L, 121L, 122L, 123L, 124L, 125L, 126L, 127L, 128L, 129L, 130L,
131L, 132L, 133L, 135L, 134L, 136L, 137L, 138L, 139L, 140L, 141L,
142L, 143L, 144L, 145L, 146L, 147L, 148L, 149L, 150L, 151L, 152L,
153L, 154L, 155L, 156L, 157L, 158L, 159L, 160L, 161L, 162L, 163L,
164L, 165L, 166L, 167L, 168L, 169L, 170L, 171L, 172L, 173L, 174L,
175L, 176L, 177L, 178L, 179L, 180L, 181L, 182L, 183L, 184L, 185L,
186L, 187L, 188L, 189L, 190L, 191L, 192L, 193L, 194L, 195L, 196L,
198L, 197L, 199L, 201L, 202L, 203L, 204L, 205L, 206L, 207L, 208L,
209L, 210L, 211L, 212L, 213L, 214L, 215L, 216L, 217L, 218L, 219L,
220L, 221L, 222L, 223L, 224L, 225L, 226L, 227L, 229L, 230L, 231L,
228L, 232L, 233L, 234L, 235L, 236L, 237L, 238L, 239L, 240L, 241L,
242L, 243L, 244L, 245L, 246L, 247L, 248L, 249L, 250L, 251L, 254L,
252L, 253L, 255L, 256L, 257L, 258L, 259L, 260L, 261L, 262L, 263L,
265L, 264L, 266L, 267L, 268L, 269L, 271L, 270L, 272L, 273L, 274L,
275L, 276L, 277L, 278L, 279L, 280L, 281L, 282L, 283L, 284L, 285L,
286L, 287L, 288L, 290L, 289L, 291L, 292L, 293L, 294L, 295L, 296L,
297L, 298L, 299L, 302L, 301L, 303L, 304L, 305L, 306L, 307L, 308L,
309L, 310L, 311L, 312L, 313L, 314L, 315L, 316L, 317L, 318L, 319L,
320L, 321L, 322L, 323L, 324L, 325L, 326L, 327L, 328L, 329L, 330L,
331L, 332L, 333L, 334L, 335L, 336L, 337L, 338L, 339L, 340L, 341L,
342L, 343L, 344L, 345L, 346L, 347L, 348L, 349L, 350L, 351L, 352L,
353L, 354L, 355L, 356L, 357L, 358L, 359L, 360L, 361L, 362L, 363L,
364L, 365L, 366L, 367L, 368L), .Label = c("1 AVE", "103 ST",
"103 ST-CORONA", "104 ST", "110 ST", "110 ST-CATHEDRL", "110 ST-CPN",
"111 ST", "116 ST", "116 ST-COLUMBIA", "121 ST", "125 ST", "135 ST",
"137 ST-CITY COL", "138 ST-3 AVE", "138 ST-GR CONC", "14 ST",
"14 ST-6 AVE", "14 ST-UNION SQ", "145 ST", "148 ST-LENOX", "149 ST-3 AVE",
"149 ST-GR CONC", "14TH STREET", "15 ST-PROSPECT", "155 ST",
"157 ST", "161 ST-YANKEE", "163 ST-AMSTERDM", "167 ST", "168 ST-BROADWAY",
"169 ST", "170 ST", "174-175 ST", "174 ST", "175 ST", "176 ST",
"18 AVE", "18 ST", "181 ST", "182-183 ST", "183 ST", "190 ST",
"191 ST", "2 AVE", "20 AVE", "207 ST", "21 ST", "215 ST", "219 ST",
"22 AVE-BAY PKY", "225 ST", "23 ST", "23 ST-5 AVE", "23 ST-6 AVE",
"231 ST", "233 ST", "238 ST", "242 ST", "25 AVE", "25 ST", "28 ST",
"28 ST-BROADWAY", "3 AVE", "33 ST", "33 ST/RAWSON ST", "34 ST-HERALD SQ",
"34 ST-PENN STA", "36 ST", "4 AVE", "40 ST-LOWERY ST", "42 ST-BRYANT PK",
"42 ST-GRD CNTRL", "42 ST-PA BUS TE", "42 ST-TIMES SQ", "45 ST",
"46 ST", "46 ST-BLISS ST", "47-50 ST-ROCK", "49 ST-7 AVE", "5 AVE-53 ST",
"5 AVE-59 ST", "5 AVE-BRYANT PK", "50 ST", "51 ST", "52 ST-LINCOLN",
"53 ST", "55 ST", "57 ST", "57 ST-7 AVE", "59 ST", "59 ST-COLUMBUS",
"61 ST/WOODSIDE", "63 DR-REGO PARK", "65 ST", "66 ST-LINCOLN",
"67 AVE", "68ST-HUNTER COL", "69 ST-FISK AVE", "7 AV-PARK SLOPE",
"7 AVE", "7 AVE-53 ST", "71 ST", "72 ST", "75 AVE", "77 ST",
"79 ST", "8 AVE", "8 ST-B'WAY NYU", "81 ST-MUSEUM", "82 ST-JACKSON H",
"86 ST", "9 AVE", "90 ST-ELMHURST", "96 ST", "9TH STREET", "ALABAMA AVE",
"ALLERTON AVE", "AQUEDUCT-N CNDT", "AQUEDUCT TRACK", "ASTOR PLACE",
"ATLANTIC AVE", "AVE H", "AVE I", "AVE J", "AVE M", "AVE N",
"AVE P", "AVE U", "AVE X", "BAY 50 ST", "BAY PARKWAY", "BAY PKY-22 AVE",
"BAY RIDGE-95 ST", "BAY RIDGE AVE", "BAYCHESTER AVE", "BEACH 105 ST",
"BEACH 25 ST", "BEACH 36 ST", "BEACH 44 ST", "BEACH 60 ST", "BEACH 67 ST",
"BEACH 90 ST", "BEACH 98 ST", "BEDFORD AVE", "BEDFORD PARK BL",
"BEDFORD/NOSTRAN", "BEEBE-39 AVE", "BERGEN ST", "BEVERLEY ROAD",
"BEVERLY ROAD", "BLEECKER ST", "BOROUGH HALL/CT", "BOTANIC GARDEN",
"BOWERY", "BOWLING GREEN", "BOYD-88 ST", "BRIGHTON BEACH", "BROAD CHANNEL",
"BROAD ST", "BROADWAY", "BROADWAY-31 ST", "BROADWAY-ENY", "BROADWAY/LAFAY",
"BRONX PARK EAST", "BROOK AVE", "BROOKLYN BRIDGE", "BUHRE AVE",
"BURKE AVE", "BURNSIDE AVE", "BUSHWICK AVE", "CANAL ST", "CARROLL ST",
"CASTLE HILL AVE", "CATHEDRL-110 ST", "CENTRAL AVE", "CHAMBERS ST",
"CHAUNCEY ST", "CHRISTOPHER ST", "CHURCH AVE", "CITY / BUS",
"CLARK ST", "CLASSON AVE", "CLEVELAND ST", "CLINTON-WASH AV",
"CORTELYOU ROAD", "CORTLANDT ST", "COURT SQ", "COURT SQ-23 ST",
"CRESCENT ST", "CROWN HTS-UTICA", "CYPRESS AVE", "CYPRESS HILLS",
"DEKALB AVE", "DITMARS BL-31 S", "DITMAS AVE", "DYCKMAN-200 ST",
"DYCKMAN ST", "DYRE AVE", "E 143 ST", "E 149 ST", "E 177 ST-PARKCH",
"E 180 ST", "E TREMONT AVE", "EAST 105 ST", "EAST BROADWAY",
"EASTERN PKWY", "ELDERTS LANE", "ELMHURST AVE", "ESSEX ST", "EUCLID AVE",
"EXCHANGE PLACE", "FAR ROCKAWAY", "FLATBUSH AVE", "FLUSHING AVE",
"FORDHAM ROAD", "FOREST AVE", "FOREST HILLS-71", "FOREST PARKWAY",
"FRANKLIN AVE", "FRANKLIN ST", "FREEMAN ST", "FRESH POND ROAD",
"FT HAMILTON PKY", "FULTON ST", "GATES AVE", "GRAHAM AVE", "GRAND-30 AVE",
"GRAND ARMY PLAZ", "GRAND AV-NEWTON", "GRAND ST", "GRANT AVE",
"GREENPOINT AVE", "GREENWOOD-111", "GROVE STREET", "GUN HILL ROAD",
"HALSEY ST", "HARRISON", "HEWES ST", "HIGH ST", "HOUSTON ST",
"HOWARD BCH-JFK", "HOYT ST", "HOYT ST-ASTORIA", "HOYT/SCHERMER",
"HUDSON-80 ST", "HUNTERS PT AVE", "HUNTS POINT AVE", "INTERVALE-163",
"INWOOD-207 ST", "JACKSON AVE", "JAMAICA-179 ST", "JAMAICA-VAN WYC",
"JAMAICA CENTER", "JAY ST-METROTEC", "JEFFERSON ST", "JFK HOWARD BCH",
"JFK JAMAICA CT1", "JOURNAL SQUARE", "JUNCTION BLVD", "JUNIUS ST",
"KINGS HIGHWAY", "KINGSBRIDGE RD", "KINGSTON-THROOP", "KINGSTON AVE",
"KNICKERBOCKER", "KOSCIUSZKO ST", "LAFAYETTE AVE", "LEFFERTS BLVD",
"LEXINGTON-53 ST", "LEXINGTON AVE", "LIBERTY AVE", "LIVONIA AVE",
"LONGWOOD AVE", "LORIMER ST", "MAIN ST", "MARBLE HILL-225", "MARCY AVE",
"METROPOLITAN AV", "METS-WILLETS PT", "MIDDLETOWN ROAD", "MONTROSE AVE",
"MORGAN AVE", "MORRIS PARK", "MORRISON AVE", "MOSHOLU PARKWAY",
"MT EDEN AVE", "MURRAY ST-B'WAY", "MYRTLE-WILLOUGH", "MYRTLE AVE",
"NASSAU AV", "NECK ROAD", "NEPTUNE AVE", "NEREID AVE", "NEVINS ST",
"NEW LOTS AVE", "NEW UTRECHT AVE", "NEWARK HW BMEBE", "NEWKIRK AVE",
"NORTHERN BLVD", "NORWOOD-205 ST", "NORWOOD AVE", "NOSTRAND AVE",
"OCEAN PARKWAY", "ORCHARD BEACH", "OXFORD-104 ST", "PARK PLACE",
"PARKSIDE AVE", "PARSONS BLVD", "PATH WTC", "PAVONIA/NEWPORT",
"PELHAM BAY PARK", "PELHAM PARKWAY", "PENNSYLVANIA AV", "PRESIDENT ST",
"PRINCE ST-B'WAY", "PROSPECT AVE", "PROSPECT PARK", "QUEENS PLAZA",
"QUEENSBORO PLZ", "RALPH AVE", "RECTOR ST", "RIT-MANHATTAN",
"RIT-ROOSEVELT", "ROCKAWAY AVE", "ROCKAWAY BLVD", "ROCKAWAY PK 116",
"ROCKAWAY PKY", "ROOSEVELT AVE", "ROOSEVELT IS", "SARATOGA AVE",
"SENECA AVE", "SHEEPSHEAD BAY", "SHEPHERD AVE", "SIMPSON ST",
"SMITH-9 ST", "SPRING ST", "ST. GEORGE", "STEINWAY ST", "STERLING ST",
"STILLWELL AVE", "SUTPHIN BLVD", "SUTTER AVE", "THIRTY ST", "TOMPKINSVILLE",
"TREMONT AVE", "TWENTY THIRD ST", "UNION ST", "UNION TPK-KEW G",
"UTICA AVE", "VAN ALSTON-21ST", "VAN SICLEN AVE", "VAN WYCK BLVD",
"VERNON/JACKSON", "W 4 ST-WASH SQ", "W 8 ST-AQUARIUM", "WAKEFIELD-241",
"WALL ST", "WASHINGTON-36 A", "WESTCHESTER SQ", "WHITEHALL ST",
"WHITLOCK AVE", "WILSON AVE", "WINTHROP ST", "WOODHAVEN BLVD",
"WOODLAWN ROAD", "YORK ST", "ZEREGA AVE"), class = "factor"),
ENTRIESn_hourly = structure(c(276L, 336L, 253L, 279L, 175L,
207L, 131L, 202L, 340L, 203L, 259L, 118L, 251L, 216L, 106L,
315L, 283L, 272L, 166L, 354L, 355L, 278L, 198L, 132L, 323L,
83L, 156L, 325L, 5L, 248L, 281L, 134L, 222L, 92L, 27L, 186L,
54L, 221L, 116L, 256L, 28L, 77L, 24L, 82L, 245L, 126L, 63L,
130L, 228L, 332L, 214L, 17L, 81L, 260L, 275L, 128L, 49L,
271L, 70L, 6L, 4L, 333L, 155L, 88L, 312L, 182L, 171L, 224L,
225L, 178L, 164L, 344L, 187L, 139L, 143L, 108L, 137L, 213L,
38L, 286L, 255L, 247L, 151L, 20L, 261L, 87L, 111L, 252L,
206L, 307L, 112L, 89L, 234L, 218L, 338L, 265L, 135L, 335L,
47L, 194L, 145L, 204L, 357L, 32L, 360L, 7L, 264L, 37L, 243L,
181L, 227L, 159L, 33L, 235L, 101L, 29L, 285L, 39L, 1L, 189L,
236L, 352L, 196L, 277L, 107L, 19L, 351L, 303L, 197L, 318L,
327L, 69L, 102L, 124L, 56L, 364L, 284L, 250L, 232L, 160L,
96L, 317L, 223L, 61L, 292L, 180L, 79L, 316L, 219L, 367L,
11L, 199L, 353L, 267L, 322L, 289L, 296L, 188L, 319L, 31L,
331L, 201L, 147L, 268L, 300L, 74L, 339L, 328L, 334L, 168L,
191L, 104L, 158L, 114L, 97L, 310L, 258L, 324L, 217L, 358L,
287L, 53L, 14L, 329L, 162L, 103L, 16L, 129L, 233L, 35L, 306L,
359L, 200L, 304L, 230L, 21L, 46L, 98L, 18L, 22L, 226L, 109L,
117L, 356L, 190L, 55L, 347L, 205L, 273L, 154L, 215L, 13L,
263L, 157L, 282L, 361L, 305L, 342L, 249L, 52L, 15L, 44L,
195L, 66L, 67L, 148L, 121L, 244L, 326L, 209L, 75L, 120L,
288L, 212L, 183L, 179L, 71L, 299L, 93L, 184L, 270L, 72L,
174L, 144L, 9L, 45L, 153L, 320L, 161L, 36L, 2L, 266L, 34L,
362L, 59L, 363L, 84L, 290L, 269L, 262L, 291L, 241L, 30L,
51L, 343L, 25L, 40L, 110L, 211L, 368L, 297L, 313L, 345L,
26L, 68L, 43L, 167L, 254L, 80L, 246L, 78L, 86L, 239L, 170L,
149L, 60L, 127L, 301L, 23L, 115L, 8L, 238L, 330L, 169L, 165L,
64L, 308L, 240L, 341L, 122L, 257L, 348L, 309L, 231L, 42L,
99L, 73L, 12L, 237L, 95L, 172L, 65L, 366L, 242L, 193L, 141L,
136L, 152L, 41L, 220L, 349L, 350L, 163L, 119L, 142L, 185L,
50L, 85L, 57L, 280L, 192L, 321L, 146L, 365L, 274L, 177L,
210L, 62L, 229L, 298L, 173L, 337L, 125L, 133L, 100L, 94L,
293L, 208L, 176L, 140L, 58L, 150L, 3L, 294L, 48L, 10L, 113L,
76L, 314L, 311L, 346L, 91L, 302L, 123L, 105L, 295L), .Label = c("0.0",
"1038087.0", "1038214.0", "105198.0", "105232.0", "105814.0",
"1077071.0", "108918.0", "109834.0", "1099355.0", "111335.0",
"1118847.0", "112669.0", "113192.0", "113219.0", "113417.0",
"114648.0", "114754.0", "115486.0", "1173962.0", "117997.0",
"118636.0", "119652.0", "122148.0", "123951.0", "124927.0",
"125453.0", "126432.0", "127308.0", "127364.0", "129942.0",
"1306534.0", "131182.0", "132651.0", "133321.0", "133535.0",
"1343166.0", "1348414.0", "134910.0", "134935.0", "135082.0",
"1353072.0", "135528.0", "135925.0", "136718.0", "138461.0",
"138517.0", "138525.0", "138589.0", "1389878.0", "140546.0",
"142723.0", "145157.0", "145311.0", "146186.0", "147793.0",
"148984.0", "149465.0", "151090.0", "151282.0", "15210.0",
"152316.0", "154729.0", "155427.0", "155894.0", "1569695.0",
"159544.0", "1607534.0", "161178.0", "161945.0", "164670.0",
"164818.0", "166328.0", "167382.0", "167454.0", "167806.0",
"169035.0", "169601.0", "170317.0", "171409.0", "1717708.0",
"173178.0", "173583.0", "174523.0", "176919.0", "177120.0",
"178062.0", "178869.0", "1809423.0", "181096.0", "181841.0",
"182419.0", "182785.0", "184393.0", "184670.0", "18478.0",
"185086.0", "186211.0", "187230.0", "187258.0", "1875112.0",
"188498.0", "188669.0", "1895906.0", "192987.0", "194706.0",
"194737.0", "195406.0", "195587.0", "196333.0", "196791.0",
"1979686.0", "198344.0", "199963.0", "200231.0", "203065.0",
"203406.0", "2037102.0", "206288.0", "206632.0", "209596.0",
"210464.0", "214647.0", "216150.0", "21880.0", "221249.0",
"222970.0", "224456.0", "224525.0", "226730.0", "232046.0",
"232567.0", "234393.0", "235036.0", "236987.0", "238367.0",
"240859.0", "24229.0", "2437157.0", "244354.0", "246135.0",
"24793.0", "2503176.0", "250350.0", "250782.0", "251207.0",
"251406.0", "253042.0", "254563.0", "262817.0", "264247.0",
"264969.0", "269851.0", "270069.0", "271716.0", "272757.0",
"276476.0", "276620.0", "2768273.0", "28336.0", "283901.0",
"283916.0", "284984.0", "285466.0", "287846.0", "2887918.0",
"295916.0", "296513.0", "297119.0", "306449.0", "3069611.0",
"309818.0", "316410.0", "317839.0", "318667.0", "31873.0",
"321343.0", "327140.0", "327552.0", "331136.0", "331976.0",
"332569.0", "332690.0", "337717.0", "338917.0", "340704.0",
"3448508.0", "346634.0", "34666.0", "347322.0", "34931.0",
"350826.0", "350938.0", "351233.0", "353723.0", "35386.0",
"354653.0", "354726.0", "357633.0", "35938.0", "361025.0",
"361932.0", "362166.0", "363837.0", "364769.0", "365996.0",
"372696.0", "380814.0", "382168.0", "386507.0", "386836.0",
"389045.0", "390151.0", "39345.0", "394576.0", "400352.0",
"400696.0", "401841.0", "408495.0", "409479.0", "413753.0",
"418809.0", "41975.0", "4211094.0", "425654.0", "425840.0",
"425993.0", "43130.0", "435504.0", "436570.0", "43911.0",
"4464.0", "451144.0", "455525.0", "456058.0", "456773.0",
"460156.0", "46162.0", "46398.0", "464041.0", "467637.0",
"468013.0", "468449.0", "475460.0", "484045.0", "49506.0",
"496509.0", "500742.0", "502784.0", "50605.0", "506834.0",
"50847.0", "508751.0", "512533.0", "522548.0", "532136.0",
"547702.0", "559091.0", "55927.0", "562872.0", "564624.0",
"57772.0", "578687.0", "581079.0", "581953.0", "583445.0",
"58559.0", "586440.0", "589984.0", "59138.0", "59237.0",
"602651.0", "605826.0", "608057.0", "610185.0", "612959.0",
"61623.0", "617480.0", "62391.0", "62915.0", "629835.0",
"644738.0", "651158.0", "6524.0", "65302.0", "658080.0",
"668183.0", "67488.0", "680047.0", "683945.0", "684963.0",
"686994.0", "687653.0", "69292.0", "69352.0", "69600.0",
"69700.0", "698532.0", "70348.0", "70615.0", "708111.0",
"711178.0", "71239.0", "713277.0", "713726.0", "717413.0",
"718941.0", "721823.0", "7289.0", "72916.0", "72944.0", "738211.0",
"74250.0", "749682.0", "77158.0", "77906.0", "78576.0", "79180.0",
"7921.0", "79818.0", "81297.0", "82150.0", "82205.0", "82208.0",
"829413.0", "835283.0", "83553.0", "84809.0", "86348.0",
"86396.0", "87448.0", "87524.0", "875542.0", "87683.0", "877492.0",
"885412.0", "887765.0", "88852.0", "897321.0", "899356.0",
"90433.0", "91031.0", "91400.0", "921754.0", "92729.0", "93093.0",
"93104.0", "93167.0", "93295.0", "93346.0", "93421.0", "934612.0",
"936992.0", "939622.0", "94277.0", "95005.0", "95344.0",
"959914.0", "96087.0", "96160.0", "96423.0", "965504.0",
"97520.0", "97682.0", "97788.0", "98276.0", "98286.0", "983932.0"
), class = "factor"), Dummy = structure(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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 1L, 1L, 1L, 1L,
1L, 1L), .Label = "1", class = "factor")), .Names = c("Station",
"ENTRIESn_hourly", "Dummy"), row.names = c(1L, 2L, 3L, 4L, 5L,
6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L,
19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L,
32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L,
45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L,
58L, 59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L,
71L, 72L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 80L, 81L, 82L, 83L,
84L, 85L, 86L, 87L, 88L, 89L, 90L, 91L, 92L, 93L, 94L, 95L, 96L,
97L, 98L, 99L, 100L, 101L, 102L, 103L, 104L, 105L, 106L, 107L,
108L, 109L, 110L, 111L, 112L, 113L, 114L, 115L, 116L, 117L, 118L,
119L, 120L, 121L, 122L, 123L, 124L, 125L, 126L, 127L, 128L, 129L,
130L, 131L, 132L, 133L, 134L, 135L, 136L, 137L, 138L, 139L, 140L,
141L, 142L, 143L, 144L, 145L, 146L, 147L, 148L, 149L, 150L, 151L,
152L, 153L, 154L, 155L, 156L, 157L, 158L, 159L, 160L, 161L, 162L,
163L, 164L, 165L, 166L, 167L, 168L, 169L, 170L, 171L, 172L, 173L,
174L, 175L, 176L, 177L, 178L, 179L, 180L, 181L, 182L, 183L, 184L,
185L, 186L, 187L, 188L, 189L, 190L, 191L, 192L, 193L, 194L, 195L,
196L, 197L, 198L, 199L, 201L, 202L, 203L, 204L, 205L, 206L, 207L,
208L, 209L, 210L, 211L, 212L, 213L, 214L, 215L, 216L, 217L, 218L,
219L, 220L, 221L, 222L, 223L, 224L, 225L, 226L, 227L, 228L, 229L,
230L, 231L, 232L, 233L, 234L, 235L, 236L, 237L, 238L, 239L, 240L,
241L, 242L, 243L, 244L, 245L, 246L, 247L, 248L, 249L, 250L, 251L,
252L, 253L, 254L, 255L, 256L, 257L, 258L, 259L, 260L, 261L, 262L,
263L, 264L, 265L, 266L, 267L, 268L, 269L, 270L, 271L, 272L, 273L,
274L, 275L, 276L, 277L, 278L, 279L, 280L, 281L, 282L, 283L, 284L,
285L, 286L, 287L, 288L, 289L, 290L, 291L, 292L, 293L, 294L, 295L,
296L, 297L, 298L, 299L, 301L, 302L, 303L, 304L, 305L, 306L, 307L,
308L, 309L, 310L, 311L, 312L, 313L, 314L, 315L, 316L, 317L, 318L,
319L, 320L, 321L, 322L, 323L, 324L, 325L, 326L, 327L, 328L, 329L,
330L, 331L, 332L, 333L, 334L, 335L, 336L, 337L, 338L, 339L, 340L,
341L, 342L, 343L, 344L, 345L, 346L, 347L, 348L, 349L, 350L, 351L,
352L, 353L, 354L, 355L, 356L, 357L, 358L, 359L, 360L, 361L, 362L,
363L, 364L, 365L, 366L, 367L, 368L), class = "data.frame")
答案 0 :(得分:2)
您的ENTRIESn_hourly
因素不是数字(您可以在数据框中使用函数str()
然后检查每个变量来查看它)。将它们转换为数字以制作箱形图。
str(df)
'data.frame': 366 obs. of 3 variables:
$ Station : Factor w/ 368 levels "1 AVE","103 ST",..: 1 2 3 4 5 6 7 8 9 10 ...
$ ENTRIESn_hourly: Factor w/ 368 levels "0.0","1038087.0",..: 276 336 253 279 175 207 131 202 340 203 ...
$ Dummy : Factor w/ 1 level "1": 1 1 1 1 1 1 1 1 1 1 ...
df$ENTRIESn_hourly<-as.numeric(as.character(df$ENTRIESn_hourly))