# How to display mean in a boxplot with cross sign in base R?

R ProgrammingServer Side ProgrammingProgramming

To display mean in a boxplot with cross sign in base R, we can use the points function and pass the mean with pch = 4 that represents a star, also we can change the color to highlight the mean using col argument and the size of the start can be changed using lwd argument as shown in the below examples.

## Example

Live Demo

x<-sample(0:9,100,replace=TRUE)
boxplot(x)

## Output ## Example

points(mean(x),col="blue",pch=4,lwd=6)

## Output
{"ft_lang_label":"__label__en","ft_lang_prob":0.7775365,"math_prob":0.9111651,"size":385,"snap":"2021-43-2021-49","text_gpt3_token_len":102,"char_repetition_ratio":0.11811024,"word_repetition_ratio":0.0,"special_character_ratio":0.25194806,"punctuation_ratio":0.10344828,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9753683,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-20T18:01:22Z\",\"WARC-Record-ID\":\"<urn:uuid:49deaa75-e2fd-46d0-8943-b57d30343fcc>\",\"Content-Length\":\"30849\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d295712d-cf5f-48e5-a604-8d8f5f999599>\",\"WARC-Concurrent-To\":\"<urn:uuid:1f9aa8b2-ad6a-405d-b76b-a9acd880e927>\",\"WARC-IP-Address\":\"72.21.91.42\",\"WARC-Target-URI\":\"https://www.tutorialspoint.com/how-to-display-mean-in-a-boxplot-with-cross-sign-in-base-r\",\"WARC-Payload-Digest\":\"sha1:FNVFTG3VC5EUQJX4MBMB3XBB4XXAR2YS\",\"WARC-Block-Digest\":\"sha1:KMYEHCGDG53NWK6WRE5ISBWAUZYTCBSQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585322.63_warc_CC-MAIN-20211020152307-20211020182307-00719.warc.gz\"}"}