plot(cars,dist,main="@R_Experts")
abline(v=seq(5,25,2),col="red",main="@R_Experts")
abline(h=seq(2,120,10),col="purple",main="@R_Experts")
@R_Experts
abline(v=seq(5,25,2),col="red",main="@R_Experts")
abline(h=seq(2,120,10),col="purple",main="@R_Experts")
@R_Experts
#pairs()
از این تابع برای رسم ستون های یک ماتریس عددی در برابر ستون های دیگر استفاده می شود
@R_Experts
از این تابع برای رسم ستون های یک ماتریس عددی در برابر ستون های دیگر استفاده می شود
@R_Experts
#تمرین_شماره_ی_17
با استفاده از دستورات گفته شده شکل بالا را رسم کنید.
راهنمایی برای رسم شکلک ها می توانید
pch="☺️"
را از اینجا کپی کنید
@R_Experts
با استفاده از دستورات گفته شده شکل بالا را رسم کنید.
راهنمایی برای رسم شکلک ها می توانید
pch="☺️"
را از اینجا کپی کنید
@R_Experts
#corrplot
ی تصویر خیلی زیبا و قشنگی از ماتریس همبستگی رو تو این نمودار خواهیم دید 👇👇👇
@R_Experts
@R_Experts
Miscellaneous plots in R
install.packages("corrplot")
library(corrplot)
set.seed(12345)
A <- matrix(runif(100,1,100),nrow=10,ncol=10,byrow=T)
correlation_matrix <- cor(t(A), method="spearman")
corrplot(correlation_matrix)
ی تصویر خیلی زیبا و قشنگی از ماتریس همبستگی رو تو این نمودار خواهیم دید 👇👇👇
@R_Experts
@R_Experts
col <- colorRampPalette(c("#BB4444", "#EE9988", "#FFFFFF", "#77AADD", "#4477AA"))
corrplot(correlation_matrix,
method="shade", # visualisation method
shade.col=NA, # colour of shade line
tl.col="black", # colour of text label
tl.srt=45, # text label rotation
col=col(200), # colour of glyphs
addCoef.col="black", # colour of coefficients
order="AOE" # ordering method
)
👇👇👇👇👇
@R_Experts
#heatmap
@R_Experts
@R_Experts
set.seed(31)
y <- matrix(rnorm(50),
10,
5,
dimnames=list(paste("g", 1:10, sep=""),
paste("t", 1:5, sep=""))
)
# data needs to be in long format
# install reshape if necessary
#install.packages("reshape")
library(reshape)
yy <- melt(y)
ggplot(yy, aes(x=X1, y=X2, fill=value)) +
geom_raster() +
scale_fill_gradient2(midpoint=0, mid="grey70", limits=c(-2,2))
@R_Experts
@R_Experts
> sim.I <- function(x) { # this is a closure
+ function(u) exp(-(x*u)^2/2) * x
+ }
>
> g <- sim.I(10) # function used to simulate I_10
> U <- runif(1e5)
> Ts <- g(U)
> mean(Ts)
[1] 1.245262
> 0.5 * sqrt(2*pi)
[1] 1.253314
>
@R_Experts
#heatmap
یکی دیگر از راه های رسم نقشه گرمایی"هت مپ"
استفاده از پکیج
میباشد دستور و بعضی از ارگومان های ان به صورت زیر است :
#heatmap
یکی دیگر از راه های رسم نقشه گرمایی"هت مپ"
استفاده از پکیج
میباشد دستور و بعضی از ارگومان های ان به صورت زیر است :
@R_Experts
یکی دیگر از راه های رسم نقشه گرمایی"هت مپ"
استفاده از پکیج
ctc
میباشد دستور و بعضی از ارگومان های ان به صورت زیر است :
#heatmap
یکی دیگر از راه های رسم نقشه گرمایی"هت مپ"
استفاده از پکیج
ctc
میباشد دستور و بعضی از ارگومان های ان به صورت زیر است :
heatmap(...) function can draw a heatmap, it's usage is:
heatmap(x, Rowv=NULL, Colv=if(symm)"Rowv" else NULL,
distfun = dist, hclustfun = hclust,
reorderfun = function(d,w) reorder(d,w),
add.expr, symm = FALSE, revC = identical(Colv, "Rowv"),
scale=c("row", "column", "none"), na.rm = TRUE,
margins = c(5, 5), ColSideColors, RowSideColors,
cexRow = 0.2 + 1/log10(nr), cexCol = 0.2 + 1/log10(nc),
labRow = NULL, labCol = NULL, main = NULL,
xlab = NULL, ylab = NULL,
keep.dendro = FALSE, verbose = getOption("verbose"), ...)
x: Numeric matrix
Rowv: Row dendrogram
Colv: Column dendrogram
@R_Experts
#curve
دستوری برای رسم توابع در نرم افزار
تابع مورد نظر،
دامنه تابع مورد نظر
اضافه کردن تابعی دیگر برای رسم ،
و برخی دیگر از آرگومانهای این دستور که برای نامگذاری و... استفاده میشوند
@R_Experts
دستوری برای رسم توابع در نرم افزار
curve(expr, from = NULL, to = NULL, n = 101, add = FALSE,
type = "l", xname = "x", xlab = xname, ylab = NULL,
log = NULL, xlim = NULL, ...)
expr
تابع مورد نظر،
from_to
دامنه تابع مورد نظر
add
اضافه کردن تابعی دیگر برای رسم ،
و برخی دیگر از آرگومانهای این دستور که برای نامگذاری و... استفاده میشوند
@R_Experts
x <- seq(-3.5,3.5,0.01)
curve(dnorm(x),x,col="purple",xlim=c(-4,4),ylim=c(0,1),main="@R_Experts")
curve(pnorm(x),x,col="red",xlim=c(-4,4),ylim=c(0,1),add=T)
@R_Experts
curve(dnorm(x),x,col="purple",xlim=c(-4,4),ylim=c(0,1),main="@R_Experts")
curve(pnorm(x),x,col="red",xlim=c(-4,4),ylim=c(0,1),add=T)
@R_Experts
#demo
#برچسب_ریاضی
ابتدا
demo(plotmath)
را فراخوانی سپس
از اپراتورهای ان استفاده میکنیم،
که در پنجره پلات ظاهر شده
و با زدن enter جا به جا میشوند
#Example
@R_Experts
#برچسب_ریاضی
ابتدا
demo(plotmath)
را فراخوانی سپس
از اپراتورهای ان استفاده میکنیم،
که در پنجره پلات ظاهر شده
و با زدن enter جا به جا میشوند
#Example
demo(plotmath)
par(mar = c(4, 4, 2, 0.1))
plot(rnorm(100), rnorm(100),
xlab = expression(hat(mu)[0]), ylab = expression(alpha^beta),
main = expression(paste("Plot of ", alpha^beta, " versus ", hat(mu)[0])))
par(mar = c(4, 4, 2, 0.1))
x_mean <- 1.5
x_sd <- 1.2
hist(rnorm(100, x_mean, x_sd),
main = substitute(
paste(X[i], " ~ N(", mu, "=", m, ", ", sigma^2, "=", s2, ")"),
list(m = x_mean, s2 = x_sd^2)
)
)
@R_Experts