, 나는 열 이름과 관련된 숫자 값을 가진 dataframe를 가지고,하지만 난 dataframe 만드는 예기치 않은 오류로 계속 실행 :만들기 막대 그래프의 ggplot2 하나의 희미한 dataframe
ggplot(audit_count,aes(x=colnames(audit_count),y=audit_count[1,])) +geom_bar()
을
날 오류 메시지
Error: Aesthetics must be either length 1 or the same as the data (1): x, y
을 제공하지만,이 에러 메시지는 COLNAMES (audit_count)로서, 저 이해와 [1, 상기와 동일한 길이이다 audit_count 그다지.
bar 이름으로 열 이름과 y 값으로 숫자 값으로 barchart로 플롯하기 위해 데이터를 변환해야하는 일종의 변환이 있습니까?
데이터 아래 :
structure(list(page_title_missing = 56L, page_title_length = 164L,
page_title_duplicates = 630L, meta_desc_missing = 703L, meta_desc_length = 0L,
meta_desc_duplicate = 28L, url_dynamic = 397L, url_underscore = 26L,
url_uppercase = 701L, pagination = 0L, image_alt_missing = 223L,
h1_missing = 56L, h1_multiple = 427L, meta_keyword_present = 0L,
https_missing = 0L, non_canonical = 293L, meta_no_index = 0L,
meta_no_follow = 0L, content_duplication = 617L, content_depth = 461L,
non_301_redirects = 55L, redirec_chains = 56L, errors_404 = 0L,
mobile_url_inconsisten = 0L, hreflang_missing = 731L), .Names = c("page_title_missing",
"page_title_length", "page_title_duplicates", "meta_desc_missing",
"meta_desc_length", "meta_desc_duplicate", "url_dynamic", "url_underscore",
"url_uppercase", "pagination", "image_alt_missing", "h1_missing",
"h1_multiple", "meta_keyword_present", "https_missing", "non_canonical",
"meta_no_index", "meta_no_follow", "content_duplication", "content_depth",
"non_301_redirects", "redirec_chains", "errors_404", "mobile_url_inconsisten",
"hreflang_missing"), row.names = c(NA, -1L), class = "data.frame")
감사합니다. 그런 식으로 ggplot2가 예상 한 데이터를 인식하지 못했습니다. – user12978541243