"Relation between Mile per hours and drat", The caption can inform about who did the computation and the source of the data. You are talking about the subtitle and the caption. Two additional detail can make your graph more explicit. You use the paste() with mean_mpg to create a dynamic title returning the mean value of mpg.You create the average of mpg with mean(mtcars$mpg) stored in mean_mpg variable.Title = paste("Plot Mile per hours and drat, in log. You can add a dynamic name to our graph, namely the average of mpg. Output: # "The first year is 2010 and the last year is 2018" Paste("The first year is", A, "and the last year is", B) Note you can add as much static text and variable as you want. " ": Text inside the quotation marks are the static text You can use the paste() function to print static text and dynamic text. It avoids rewriting all the codes each time you add new information to the graph.Ī dynamic title is helpful to add more precise information in the title. my_graph: You use the graph you stored.Title = "Plot Mile per hours and drat, in log" One mandatory information to add is obviously a title. It is possible to change or add title with:Įxample:lab(title = "Hello Guru99", subtitle = "My first plot") The basic syntax for lab() is : lab(title = "Hello Guru99") The reader should see the story behind the data analysis just by looking at the graph without referring additional documentation. So far, we haven’t added information in the graphs. Note that other smoothing methods are available se = FALSE: Don’t display the standard error. FITPLOT R9 CODE
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |