I have observations in the form of ranges For eg: A 13-20, B 15-30, C 23-40, D 2-11 I want to plot them in R in form of the starting value and the end value for eg. 13 and 20 for A(upper and lower limits if you may say) in order to visualize and find out what ranges are common to certain combinations of observations. Is there a quick way to do this in R ? I think this is a very trivial problem I am having but I cant think of anyway to do it right now.
相关问题
- R - Quantstart: Testing Strategy on Multiple Equit
- Using predict with svyglm
- Reshape matrix by rows
- Extract P-Values from Dunnett Test into a Table by
- split data frame into two by column value [duplica
相关文章
- How to convert summary output to a data frame?
- How to plot smoother curves in R
- Paste all possible diagonals of an n*n matrix or d
- ess-rdired: I get this error “no ESS process is as
- How to use doMC under Windows or alternative paral
- dyLimit for limited time in Dygraphs
- Saving state of Shiny app to be restored later
- How to insert pictures into each individual bar in
It is not clear whether the dataset has range column as
string
or not i.e.'13-20'
,'15-30'
etc. or if it is twonumeric
columns as showed in the created example.If the
data
hasstring
column (d1
)data
Here is a solution using
ggplot
. It's not clear at all what format your data is in, so this assumes a data frame with columnsid
(A-D),min
, andmax
.I've added a lot of customization just to give you an idea of how it's done. You use the
aes(...)
function to tellggplot
which columns indf
map to various aesthetics of the graph. So for instanceaes(x=id)
tellsggplot
that the values for the x-axis are to be found in theid
column ofdf
, etc.EDIT: Response to OP's comment.
To change the size of axis text, use the
theme(...)
function, as in:Here I made the x-axis text bigger. Play around with
size=...
to get it the way you want. Also read the documentation (?theme
) for a list of other formatting options.