filmov
tv
How to Combine Character String & Expressions in Plot Text in R (2 Examples) | Base R vs. ggplot2

Показать описание
R code of this video:
y = c(1, 3, 5, 2, 7))
plot(data, # Draw plot without expressions
main = "My Main Title")
plot(data, # Draw plot with expressions in main title
main = expression("My Main Title"["No. 2"] ~ alpha ^ beta))
library("ggplot2")
ggp <- ggplot(data, aes(x, y)) + # Create ggplot2 scatterplot
geom_point()
ggp # Draw ggplot2 scatterplot
ggp + # Add main title without expressions
ggtitle("My Main Title")
ggp + # Add main title with expressions
ggtitle(expression("My Main Title"["No. 2"] ~ alpha ^ beta))
ggp + # Annotate text with expressions inside of plot
annotate("text",
x = 2,
y = 4,
label = expression("My Text"["No. 2"] ~ alpha ^ beta))
ggp +
annotate("text",
x = 2.2,
y = 4,
label = expression("My Text"["No. 2"] ~ alpha ^ beta),
col = 2,
size = 5)
Follow me on Social Media:
y = c(1, 3, 5, 2, 7))
plot(data, # Draw plot without expressions
main = "My Main Title")
plot(data, # Draw plot with expressions in main title
main = expression("My Main Title"["No. 2"] ~ alpha ^ beta))
library("ggplot2")
ggp <- ggplot(data, aes(x, y)) + # Create ggplot2 scatterplot
geom_point()
ggp # Draw ggplot2 scatterplot
ggp + # Add main title without expressions
ggtitle("My Main Title")
ggp + # Add main title with expressions
ggtitle(expression("My Main Title"["No. 2"] ~ alpha ^ beta))
ggp + # Annotate text with expressions inside of plot
annotate("text",
x = 2,
y = 4,
label = expression("My Text"["No. 2"] ~ alpha ^ beta))
ggp +
annotate("text",
x = 2.2,
y = 4,
label = expression("My Text"["No. 2"] ~ alpha ^ beta),
col = 2,
size = 5)
Follow me on Social Media:
String Concatenation | Python Tutorial
SQL String Functions Tutorial (LEFT, RIGHT, POSITION, CONCAT, LOWER, REPLACE)
How to Concatenate Strings in C# with the String Concat Method! C# Tutorial
String In Char Array VS. Pointer To String Literal | C Programming Tutorial
How to Combine Character String & Expressions in Plot Text in R (2 Examples) | Base R vs. ggplot...
How to join two or more Strings using the Java String concat() method
Java Tutorial - 08 - Combining Strings (Concatenation)
How to Concatenate in SQL (Oracle, SQL Server, MySQL, PostgreSQL)
Beautiful1st Inversion Triads Arpeggios in F | 1-5-4-6 Chord Progression Breakdown!
C_67 C Program to concatenate two strings | with strcat() and without strcat()
Add characters to beginning and end of an string in Excel
String Concatenation | C++ Tutorial
How to Concatenate String Values with Integer values in SQL Server - TSQL Tutorial
21 - ABAP Programming - String Operations - CONCATENATE
Concatenate IF | TEXTJOIN IF | Concatenate IF Cell Contains Text | Concatenate with IF Condition
concat method | String Object In JavaScript
JavaScript String Concatenation
25-String Functions in SQL | Types of SQL Functions | Examples | SUBSTR(),CONCAT(),UPPER(),REVERSE()
How To Use the new Excel TEXTBEFORE & TEXTAFTER Functions to Save Time on Your Next Project
How to concatenate text from multiple rows into a single text string in SQL server?
How to use the CONCAT function in Excel (vs the CONCATENATE function)
What is String in Python and How to Concatenate Two String Variables
Left, Right, Mid, Len, Find and Concatenate Function
String Concatenate Functions - strcat() & strncat()
Комментарии