|R| Experts
1.08K subscribers
375 photos
35 videos
58 files
204 links
@R_Experts
🔴آمار علم جان بخشیدن به داده‌هاست.
🔷ارتباط با ما
@iamrezaei
لینک یوتیوب و اینستاگرام و ویرگول:
https://zil.ink/expertstv
Download Telegram
#dotchart

نمودار نقطه ای نیز نمودار پر کاربردی می باشد وتفاسیری مانند نمودار #ساقه_و_برگ دارد علاوه بر آن فراوانی هر مشاهده را به ما میدهد

@R_Experts
#dotchart

dotchart(speed,col="purple",pch=19,main="@R_Experts")


@R_Experts
#abline()

برای رسم یک خط با شیب و عرض از مبدا دلخواه روی یک نمودار از این تابع استفاده میشود . هم چینسن برای رسم خط عمود بر محور های مختصات کافی است برای عمود بر محور
X

در داخل تابع ارگومان

v=a

و برای عمود بر محور
Y


h=b

را اضافه کنیم

@R_Experts
plot(cars,dist,main="@R_Experts")
abline(20,2,col="red",lty=1)

@R_Experts
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
#pairs()

از این تابع برای رسم ستون های یک ماتریس عددی در برابر ستون های دیگر استفاده می شود

@R_Experts
x <- c(rnorm(101),rgamma(100,2,3))
M <- matrix(x,nc=3)
pairs(M,main="@R_Experts")

@R_Experts
#تمرین_شماره_ی_17


با استفاده از دستورات گفته شده شکل بالا را رسم کنید.
راهنمایی برای رسم شکلک ها می توانید

pch="☺️"
را از اینجا کپی کنید
@R_Experts
#corrplot

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

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
Simulation"by using uniform (0,1)"

@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

یکی دیگر از راه های رسم نقشه گرمایی"هت مپ"

استفاده از پکیج

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

دستوری برای رسم توابع در نرم افزار

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