bumpchart              package:plotrix              R Documentation

_D_i_s_p_l_a_y _a "_b_u_m_p_s" _c_h_a_r_t.

_D_e_s_c_r_i_p_t_i_o_n:

     Display a chart with two of more columns of points in order of
     ascending values with lines connecting the points in a row.

_U_s_a_g_e:

      bumpchart(y,top.labels=colnames(y),labels=rownames(y),rank=TRUE,
       mar=c(2,8,5,8),pch=19,col=par("fg"),lty=1,lwd=1,...)

_A_r_g_u_m_e_n_t_s:

       y: A numeric matrix or data frame which may contain NAs.

top.labels: The strings that will appear at the top of each column of
          points on the plot.

  labels: The strings that will appear next to the outer columns of
          points.

    rank: Whether to rank the values in 'y' before plotting.

     mar: The margins to use for the bumps chart.

     pch: The symbols to use when plotting the points.

     col: The colors to use.

     lty: The line types to use.

     lwd: The line widths to use.

     ...: Additional arguments passed to 'matplot'.

_D_e_t_a_i_l_s:

     'bumpchart' calls 'matplot' to plot the values in the transposed
     'y' matrix or data frame, joining the points with lines. At the
     left and right edges of the plot, the labels identifying each row
     of points are displayed. This type of plot is often used to show
     the changing positions of entities over time, like the ranking in
     surveys in different years.

     Because of the way 'matplot' plots the values, the order of
     everything is reversed. If the user wants to rank in descending
     order, such as test scores, rank the values in the correct order
     before sending them to 'bumpchart'.

_V_a_l_u_e:

     nil

_A_u_t_h_o_r(_s):

     Jim Lemon

_S_e_e _A_l_s_o:

     'matplot'

_E_x_a_m_p_l_e_s:

      # percentage of those over 25 years having completed high school
      # in 10 cities in the USA in 1990 and 2000
      educattn<-matrix(c(90.4,90.3,75.7,78.9,66,71.8,70.5,70.4,68.4,67.9,
       67.2,76.1,68.1,74.7,68.5,72.4,64.3,71.2,73.1,77.8),ncol=2,byrow=TRUE)
      rownames(educattn)<-c("Anchorage AK","Boston MA","Chicago IL",
       "Houston TX","Los Angeles CA","Louisville KY","New Orleans LA",
       "New York NY","Philadelphia PA","Washington DC")
      colnames(educattn)<-c(1990,2000)
      bumpchart(educattn,main="Rank for high school completion by over 25s")
      # now show the raw percentages and add central ticks
      bumpchart(educattn,rank=FALSE,
       main="Percentage high school completion by over 25s",col=rainbow(10))
      # margins have been reset, so use
      par(xpd=TRUE)
      boxed.labels(1.5,seq(65,90,by=5),seq(65,90,by=5))
      par(xpd=FALSE)

