由买买提看人间百态

topics

全部话题 - 话题: mfrow
1 (共1页)
l**********1
发帖数: 5204
1
Continue:
第四乐章 Finale
找有关的PhD dissertation 里边的 R source code program
while U can debug it or even rewrite it for another task,
then you already masted NGS coding skills.
比如
http://www.dspace.cam.ac.uk/handle/1810/218542
DSpace at Cambridge
title: Genome-wide analyses using bead-based microarrays
Authors: Dunning, Mark J
Issue Date: 4-Sep-2008
Files in This Item:
File Description Size Format
dunning_thesis_.pdf 10.47 MB Adobe PDF
its Appendix B
R source Code f... 阅读全帖
w******a
发帖数: 25
2
来自主题: Statistics版 - imputation question?thanks
Here is an R example to impute one or two missing data in each record:
The data will look like
col1 col2 col3
x
x x x
x x
x x
x x x
x
x x x
...
library(Rlab)
alp = 1
K_delta = 2
len_Y1 = 200
#Sample setting:
#Measurment N_
patient Percent
# 1 12
0.18
# 1 2 4
0.05... 阅读全帖
w******a
发帖数: 25
3
来自主题: Statistics版 - imputation question?thanks
Here is an R example to impute one missing data in each record,half of the code is to make data sample, you probably only need second half,but including them here helps you understand what is going on:
The data will look like
col1 col2
x
x x
x
x x
x x
...
library(Rlab)
alp = 1
Prob_R1 = 0.5
Prob_R0 = 1 - Prob_R1
len_Y1 = 200
K_delta = 2
Y1 = rnorm(len_Y1,mean=0,sd=1)
R1 = rbinom(n=len_Y1, size=1, prob=Prob_R1)
Y2 = rnorm(n=len_Y1,... 阅读全帖
m***b
发帖数: 11
4
我以前(< R 2.5?)可用pdf("myplot.pdf",append=T) 将多个图输出到同一个PDF文件 (
用loop). 但R 2.7.1好象没有'append' argument了.如何实现这样的操作? 单个输出再
merge PDF文件的问题是: 每个图的尺寸应小与每页的尺寸.用mfrow=c(n,1)的问题是:
太多图(300), 不知怎样设置window大小, 总是说超限. 谢谢.
n*********n
发帖数: 5605
5
来自主题: Statistics版 - 请教一个用R画图的问题
1.
par(new=TRUE)
把两个画重叠在一起;
或者
2.
par(mfrow=c(2,2))
分别画 4 个图
plot前打以上命令,
自己试试看
p*******o
发帖数: 2726
6
来自主题: Statistics版 - R 画图问题求教
par(mfrow)/mult.fig

R
a***r
发帖数: 420
7
来自主题: Statistics版 - R 画图结果怎么分别保存?
那就par(mfrow=c(n,n))
虽然好像也不是直接解决你的问题。。。
z**k
发帖数: 378
8
来自主题: Statistics版 - 问一个时间序列的问题
Try it yourself:
#!/usr/bin/R
a <- runif(1000)
k <- 10
a.f <- filter(a, filter=rep(1/k,k))
opar <- par(mfrow=c(2,1))
acf(a)
acf(na.omit(a.f))
par(opar)
h******3
发帖数: 190
9
I could not find any answer online. Need this urgently.
Thanks!
h******3
发帖数: 190
10
I could not find any answer online. Need this urgently.
Thanks!
l***l
发帖数: 22
11
# Is this what you want?
x <- c(1, 2); # you can add more points here
y <- c(2, 1); # and here
x11(20, 10);
par(mfrow=c(1, 2));
plot(x, y, xlim = c(0.5, 2.5),
ylim = c(0.5, 2.5),
type = "o", pch = 21, col = "red", )
segments(x0 = x[seq(1, length(x), by=2)],
x1 = x[seq(2, length(x), by=2)],
y0 = y[seq(1, length(y), by=2)],
y1 = y[seq(2, length(y), by=2)],
col = "blue");
x <- c(0, 1, 1, 2, 2, 3); # you can add more points here
y <- c(3, 3, 2, ... 阅读全帖
j******4
发帖数: 6090
12
来自主题: Statistics版 - R 里面的怎么批量画图
There is a "par" function that can set up the forms of your output, you can
type in ?par in R to look up those parameters.
Here is an MA plot example(Bioinformatics/Microarray):
par(mfrow=c(8,8), mar=c(0.1, 0.1, 0.1, 0.1), xaxt="n", yaxt="n")
for(i in 1:length(rma)){for(j in 1:length(rma)){
Ai<-((rma[,i])+(rma[,j]))/2
Mj<-((rma[,i])-(rma[,j]))
plot( c(min(Ai), max(Ai)), c(-3,3), type="n", xlab="A", ylab="M")
points(Ai, Mj, pch=".")
lines(c(0, 13), c(0,0), col=2)
}}
g*****p
发帖数: 3403
13
来自主题: Statistics版 - 请教R Projection pursuit
par(mfrow=c(3,2))
plot(ais.ppr, main="ppr(LBM~ ., nterms=2, max.terms=6)")
## bass: super smoother bass tone control used with automatic span
## selection (see 'supsmu'); the range of values is 0 to 10,
## with larger values resulting in increased smoothing.
plot(update(ais.ppr, bass=5), main = "update(..., bass = 5)")
plot(update(ais.ppr, sm.method="gcv", gcvpen=2),
main = "update(..., sm.method="gcv", gcvpen=2)")
这个画出来的三幅图是什么意思?
怎么分析
J*****n
发帖数: 4859
14
来自主题: Statistics版 - Question about LASSO in R
When I used lars package, through the grammar in its documents:
data(diabetes)
par(mfrow=c(2,2))
attach(diabetes)
object <- lars(x,y)
I got following one.
Error in rep(1, n) : invalid 'times' argument
My R is the latest version.
Any suggestion?
Thank you.
S******y
发帖数: 1123
15
I have finally got Hadoop working on my Linux box. Next I would like to try
to see if I could to parallel model estimation for some commonly used models
such as logistic regression.
My question now is - how to paralell gradient descent for logistic model
estimation for real large data set?
Any thoughts would be greatly appreciated. Thanks in advance!
PS. See R code below. If needed, I could rewrite the following code in Java
or Python. But the question is how to decompose the following estimatio... 阅读全帖
a***d
发帖数: 336
16
par(mfrow=c(n1,n2)) #divides the plot area into n1 rows and n2 columns.
plot(..)
plot(..) #etc
o****o
发帖数: 8077
17
来自主题: Statistics版 - R plot question: 如何把图黏在一起
par(mfrow=c(2,2), mar=c(1,1,1,1))
e*****s
发帖数: 273
18
来自主题: Statistics版 - R 绘图的一个问题
par(mfrow=c(2,5))
或者用楼上说的lattice
s********i
发帖数: 111
19
来自主题: Statistics版 - 问个低级R plot问题
用par(mfrow=c(2,3))吧当前graphics窗口分成2x3个subplot后,如何选择当前active
的plot,比如说,直接选择在第2行第1列做plot?
用惯matlab,初学R,不太习惯,谢谢回答。
t*****w
发帖数: 254
20
来自主题: Statistics版 - 请问面试 R 应该怎么准备?
When I had my job interview, they always tested my SAS skill.However I use R
all the time. To help your preparation, read my R codes to see how much you
can understand it.
%in%
?keyword
a<-matrix(0,nrow=3,ncol=3,byrow=T)
a1 <- a1/(t(a1)%*%spooled%*%a1)^.5 #standadization in discrim
a1<- a>=2; a[a1]
abline(h = -1:5, v = -2:3, col = "lightgray", lty=3)
abline(h=0, v=0, col = "gray60")
abs(r2[i])>r0
aggregate(iris[,1:4], list(iris$Species), mean)
AND: &; OR: |; NOT: !
anova(lm(data1[,3]~data1[,1... 阅读全帖
z**k
发帖数: 378
21
来自主题: Statistics版 - Adaboost M1 - what's wrong with this code?
My understanding is, for Adaboost M1, the loss function mean(-y*F) is always
strictly decreasing, but this is not the case for the following code. Can
anyone help?
I m following the example of Hastie ESL-II chapter 10.1.
sorry cannot type Chinese here. Thank you very much for help.
#================R Script====================
## Data using example given in T. Hastie, ESL, chapter 10.1
dta <- matrix(rnorm(20000), 2000, 10)
pred <- apply(dta, 1, function(x) sum(x^2))
y <- (pred > qchisq(0.5, 10))... 阅读全帖
w**********y
发帖数: 1691
22
a = rep(1,1000)
for(i in 2:1000)
a[i] = a[i-1]*(-0.2) + rnorm(1)
par(mfrow=c(2,1))
hist(a)
acf(a)
1 (共1页)