-1

How can I change the Font and the size in R. I want it Times New Roman is it possible. Where should I put the command this the script that I've been trying to change the font

George
  • 3
  • 3

1 Answers1

2

If you're referring to changing the font in a plot's legend and labels. Then here is a possible solution using ggplot2. A full list of fonts can be found here.

library(tidyverse)

df <- data_frame(a=runif(100), 
                 b=runif(100),
                 c=sample(c("Class A","Class B"), 100, T))

ggplot(df, aes(x=a,y=b,colour=c)) +
  geom_line() +
  theme(text=element_text(family="Times"))
Adam Spannbauer
  • 2,707
  • 1
  • 17
  • 27