R တွင် bold font ကိုအသုံးပြုနည်း (ဥပမာများနှင့်အတူ)
R ကွက်များတွင် ရဲရင့်သောဖောင့်တစ်ခုထုတ်လုပ်ရန် အောက်ပါအခြေခံအထားအသိုကိုသုံးနိုင်သည်။
substitute(paste(bold(' this text is bold ')))
အောက်ပါဥပမာများသည် ဤ syntax ကိုလက်တွေ့တွင်မည်သို့အသုံးပြုရမည်ကိုပြသထားသည်။
ဥပမာ 1- အကွက်ဝင်ရိုးအညွှန်းများပေါ်ရှိ ခပ်ထူထူဖောင့်
အောက်ဖော်ပြပါကုဒ်သည် axes နှစ်ခုလုံး၏ အညွှန်းများအတွက် ပုံမှန်ဖောင့်ကို အသုံးပြု၍ R တွင် scatterplot တစ်ခုကို ဖန်တီးနည်းကို ပြသသည်-
#define data x <- c(1, 2, 3, 4, 4, 5, 6, 6, 7, 9) y <- c(8, 8, 9, 10, 13, 12, 10, 11, 14, 17) #create scatter plot with normal font for axis labels plot(x, y, xlab=' X Label ', ylab=' Y Label ')
အောက်ဖော်ပြပါကုဒ်သည် ကွက်ကွက်တစ်ခု၏ X နှင့် Y ဝင်ရိုးအညွှန်းများအတွက် ရဲရင့်သောဖောင့်ကို သတ်မှတ်နည်းကို ပြသသည်-
#define data x <- c(1, 2, 3, 4, 4, 5, 6, 6, 7, 9) y <- c(8, 8, 9, 10, 13, 12, 10, 11, 14, 17) #create scatterplot with axes labels in bold plot(x, y, xlab = substitute(paste(bold(' X Label '))), ylab = substitute(paste(bold(' Y Label '))))
ပုဆိန်နှစ်ခုလုံးအတွက် အညွှန်းများသည် ယခုမည်ကဲ့သို့ ရဲရင့်သည်ကို သတိပြုပါ။
ဥပမာ 2- လမ်းကြောင်းရှိ စာသားပါသော ခပ်ထူထူ ဖောင့်
အောက်ပါကုဒ်သည် လမ်းကြောင်းတစ်ခုအတွင်းရှိ စာသားဒြပ်စင်အတွက် ရဲရင့်သောဖောင့်ကို ထည့်သွင်းနည်းကို ပြသသည်-
#define data
x <- c(1, 2, 3, 4, 4, 5, 6, 6, 7, 9)
y <- c(8, 8, 9, 10, 13, 12, 10, 11, 14, 17)
#create scatterplot
plot(x, y)
#add normal text at location x=3, y=14
text(3, 14, ' This is some normal text ')
#add bold text at location x=3, y=16
text(3, 16, substitute(paste(bold(' This is some bold text '))))
ရဲရင့်ဖောင့်နှင့် ပုံမှန်ဖောင့်ကြား ခြားနားချက်ကို မှတ်သားပါ။
ထပ်လောင်းအရင်းအမြစ်များ
အောက်ဖော်ပြပါ သင်ခန်းစာများသည် R တွင် အခြားဘုံလုပ်ဆောင်ချက်များကို မည်သို့လုပ်ဆောင်ရမည်ကို ရှင်းပြသည်-
R တွင် italic ဖောင့်ကို အသုံးပြုနည်း
R တွင်ကွက်ကွက်များပေါ်တွင် superscripts နှင့် subscript များထည့်နည်း
ggplot2 မှာ ဖောင့်အရွယ်အစားကို ဘယ်လိုပြောင်းမလဲ။