Skip to content

Dot plot of character and numeric matrix

3 messages · Ng Wee Kiat Jeremy, Jessica Streicher, Jeff Newmiller

#
As an example:

 chars<-c("A","A","B")
 numbers<-as.numeric(as.factor(chars)) #make this numerical
 plot(numbers,c(0.4,0.5,0.6),xaxt="n") #xaxt="n" says to not plot the x-axis
 axis(side=1,at=numbers,labels=chars) #make the axis with labels
On 23.01.2013, at 10:16, Ng Wee Kiat Jeremy wrote:

            
#
I think you need to become more familiar with the "factor" data type. Reread the Introduction to R document that comes with R.
---------------------------------------------------------------------------
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.
Ng Wee Kiat Jeremy <jeremy.ng.wk1990 at gmail.com> wrote: