# [R] R plot like candlestick

Denis Francisci denis.francisci at gmail.com
Tue Jan 29 11:57:57 CET 2013

```Wonderful! Thank you Eik!
I thought there was a specific package or plot to get my purpose, but
your idea solves perfectly my problem.
Maybe I could try to write a simple R function using your suggest,
just to make fast my work. If I can get a result, I'll announce it in
this list.
Thank you very much.

Denis

2013/1/29 Eik Vettorazzi <E.Vettorazzi a uke.de>:
> Hi Denis,
> there is no "if", only "how" in R ;)
>
> how about this:
>
> rmail2<-read.table(textConnection("item, min, int_1, int_2, max
> a, 2.5, 3, 4, 5.5
> b, 2, 3.5, 4, 4.5
> c, 3.5, 4, 4.5, 5"),header=T,sep=",")
> with(rmail2,symbols(item, (int_1+ int_2)/2, boxplots=cbind(.25,
> int_2-int_1,
> int_1-min,max-int_2,0),inches=F,ylim=range(rmail2[,-1]),xaxt="n",ylab=""))
> axis(1,seq_along(rmail2\$item),labels=rmail2\$item)
>
> hth.
>
> Am 28.01.2013 22:26, schrieb Denis Francisci:
>> Hi all,
>> I'm new on this list so I greet all.
>> My question is: does exist in R a plot similar to candlestick plot but
>> not based on xts (time series)? I have to plot a range of 4 value: for
>> every item I have min value, max value and 2 intermediate values. I
>> would like plot this like a candlestick, i.e. with a box between 2
>> intermediate values and 1 segment between box and min value and a
>> segment between box and max value. Candlestick plot is provided by
>> quantmod package, but it is very specific for financial purpose and it
>> uses time series for x axis. I need a simpler method for plotting my
>> data that are stored in a table like this:
>>
>> item, min, int_1, int_2, max
>> a, 2.5, 3, 4, 5.5
>> b, 2, 3.5, 4, 4.5
>> c, 3.5, 4, 4.5, 5
>> .....
>>
>> Does anyone know if there is an R-plot for this purpose?
>> Thank you very much,
>>
>> D.
>>
>> ______________________________________________
>> R-help a r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
> --
> Eik Vettorazzi
>
> Department of Medical Biometry and Epidemiology
> University Medical Center Hamburg-Eppendorf
>
> Martinistr. 52
> 20246 Hamburg
>
> T ++49/40/7410-58243
> F ++49/40/7410-57790
> --
> Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG):
>
> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg
>
> Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander Kirstein, Joachim Prölß, Prof. Dr. Dr. Uwe Koch-Gromus
>

```

More information about the R-help mailing list