全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 数据分析与数据挖掘
931 0
2018-04-07
x=scan()
3  3 3 4 1 4 2 1 3 2 5 3 1 2 5 2 3 4 2 2 5 3 1 4 2 2 4 3 5 2
barplot(x)
table(x)
barplot(table(x))
barplot(table(x)/length(x))
table(x)/length(x)
length(x)

library(MASS)
quine
attach(quine)
table(Age)
table(Sex,Age);tab=xtabs(~Sex+Age,quine);unclass(tab)
tapply(Days,Age,mean)
tapply(Days,list(Sex,Age),mean)
detach(quine)

x=seq(-3,3,len=20);y=dnorm(x)
(x)
(y)
w=data.frame(x,y)
(w)
par(mfcol=c(2,2))
plot(y~x,w,main="正态密度函数")
plot(y~x,w,type="l",main="正态密度函数")
plot(y~x,w,type="o",main="正态密度函数")
plot(y~x,w,type="b",main="正态密度函数")
par(mfcol=c(1,1))

plot(1,1,xlim=c(1,7.5),ylim=c(0,5),type="n")
points(1:7,rep(4.5,7),cex=seq(1,4,l=7),col=1:7,pch=0:6)
text(1:7,rep(3.5,7),labels=paste(0:6,letters[1:7]),cex=seq(1,4,l=7),col=1:7)
points(1:7,rep(2,7),pch=(0:6)+7)
text((1:7)+0.25,rep(2,7),paste((0:6)+7))
points(1:7,rep(1,7),pch=(0:6)+14)
text((1:7)+0.25,rep(1,7),paste((0:6)+14))

ss=function(n=100){z=2;
for (i in 2:n)if(any(i%%2:(i-1)==0)==F)z=c(z,i);return(n)}
fix(ss)
ss()
t1=Sys.time()
ss(1000)
t2=Sys.time()-t1
system.time(ss(1000))



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群