Displaying 20 results from an estimated 900 matches similar to: "help with adding lines to current plot"
2010 Nov 17
0
X11 module cannot be loaded
HI, Dear R community,
I have used the following codes this morning, but this afternoon, I got the
following errors:
> x <- seq(0,10, by=1)
> y <- c(0.952, 0.947, 0.943, 0.941, 0.933, 0.932, 0.939, 0.932, 0.924,
0.918, 0.920) # missense
> z <- c(0.068, 0.082, 0.080, 0.099, 0.108, 0.107, 0.101, 0.105, 0.118,
0.130, 0.132) # missense False Negative
> p <- c(0.035, 0.036,
2005 Feb 04
2
no. at risk in survfit()
Hi,
when I generated a survfit() object, I can get number
of patients at risk at various time points by using
summary():
fit<-survfit(Surv(time,status)~class,data=mtdata)
summary(fit)
class=1
time n.risk n.event survival std.err lower 95% CI
upper 95% CI
9.9 78 1 0.987 0.0127 0.963 1
41.5 77 1 0.974 0.0179 0.940 1
54.0 76
2007 Aug 10
7
Help wit matrices
Hello all,
I am working with a 1000x1000 matrix, and I would like to return a
1000x1000 matrix that tells me which value in the matrix is greater
than a theshold value (1 or 0 indicator).
i have tried
mat2<-as.matrix(as.numeric(mat1>0.25))
but that returns a 1:100000 matrix.
I have also tried for loops, but they are grossly inefficient.
THanks for all your help in advance.
Lanre
2010 Feb 17
2
extract the data that match
Hi r-users,
I would like to extract the data that match. Attached is my data:
I'm interested in matchind the value in column 'intg' with value in column 'rand_no'
> cbind(z=z,intg=dd,rand_no = rr)
z intg rand_no
[1,] 0.00 0.000 0.001
[2,] 0.01 0.000 0.002
[3,] 0.02 0.000 0.002
[4,] 0.03 0.000 0.003
[5,] 0.04 0.000 0.003
[6,]
2017 Oct 21
2
Help_urgent_how to calculate mean and sd in biomod 2
Hello
I am new in R. I am trying to implement Biomod 2 package.
However, I have a doubt. I want to calculate the mean and sd of
"Testing.data"
(ROC and TSS)
> # let's print the ROC scores of all selected models
> myBiomodModelEval_55["ROC","Testing.data",,,]
RUN1 RUN2 RUN3 RUN4 RUN5 RUN6 RUN7 RUN8 RUN9 RUN10
0.938 0.938 0.926 0.931 0.939
2011 Apr 05
6
simple save question
Hi,
When I run the survfit function, I want to get the restricted mean
value and the standard error also. I found out using the "print"
function to do so, as shown below,
print(km.fit,print.rmean=TRUE)
Call: survfit(formula = Surv(diff, status) ~ 1, type = "kaplan-meier")
records n.max n.start events *rmean *se(rmean) median
200.000
2010 Apr 06
2
help output figures in R
somfunc<- function (file) {
aa_som<-scale(file)
final.som<-som(data=aa_som, rlen=10000, grid=somgrid(5,4, "hexagonal"))
pdf(file="/home/cdu/changbin/file.pdf") #output graphic file.
plot(final.som, main="Unsupervised SOM")
dev.off()
}
I have many different files, if I want output pdf file with the same name
as for each dataset I feed to the function
2010 Jun 23
1
Probabilities from survfit.coxph:
Hello:
In the example below (or for a censored data) using survfit.coxph, can
anyone point me to a link or a pdf as to how the probabilities appearing in
bold under "summary(pred$surv)" are calculated? Do these represent
acumulative probability distribution in time (not including censored time)?
Thanks very much,
parmee
*fit <- coxph(Surv(futime, fustat) ~ age, data = ovarian)*
2010 May 05
3
sort the data set by one variable
> #sort the data by predicted probability
> b.order<-bo.id.pred[(order(-predict)),]
> b.order[1:20,]
gene_id predict
43 637882902 0.07823997
53 638101634 0.66256490
61 639084581 0.08587504
41 637832824 0.02461066
25 637261662 0.11613879
22 637240022 0.06350477
62 639084582 0.02238538
63 639097718 0.06792841
44 637943079 0.04532625
80 640158389 0.06582658
3 637006517 0.57648451
2010 May 18
2
get the row sums
> head(en.id.pr)
valid.gene_id b.pred rf.pred svm.pred
1521 2500151211 0 0 0
366 639679745 0 0 0
1965 2502081603 1 1 1
1420 644148030 1 1 1
1565 2500626489 1 1 1
1816 2501711016 1 1 1
> p.pred <- data.frame(en.id.pr, sum=apply(en.id.pr[,2:4], 1, sum)) #
2010 Apr 26
3
R.GBM package
HI, Dear Greg,
I AM A NEW to GBM package. Can boosting decision tree be implemented in
'gbm' package? Or 'gbm' can only be used for regression?
IF can, DO I need to combine the rpart and gbm command?
Thanks so much!
--
Sincerely,
Changbin
--
[[alternative HTML version deleted]]
2010 May 05
2
probabilities in svm output in e1071 package
svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification",
kernel="radial", cost=bestc, gamma=bestg, cross=10) # model fitting
svm.pred<-predict(svm.fit, hh, decision.values = TRUE, probability = TRUE) #
find the probability, but can not find.
attr(svm.pred, "probabilities")
> attr(svm.pred, "probabilities")
1 0
1 0 0
2 0
2010 Apr 29
2
can not print probabilities in svm of e1071
> x <- train[,c( 2:18, 20:21, 24, 27:31)]
> y <- train$out
>
> svm.pr <- svm(x, y, probability = TRUE, method="C-classification",
kernel="radial", cost=bestc, gamma=bestg, cross=10)
>
> pred <- predict(svm.pr, valid[,c( 2:18, 20:21, 24, 27:31)],
decision.values = TRUE, probability = TRUE)
> attr(pred, "decision.values")[1:4,]
2010 Nov 04
4
how to work with long vectors
HI, Dear R community,
I have one data set like this, What I want to do is to calculate the
cumulative coverage. The following codes works for small data set (#rows =
100), but when feed the whole data set, it still running after 24 hours.
Can someone give some suggestions for long vector?
id reads
Contig79:1 4
Contig79:2 8
Contig79:3 13
Contig79:4 14
Contig79:5 17
2010 Apr 15
2
r-loop
HI, Dear community,
I am building the following loop,
ww<-function(file) {
lossw<-vector()
for (x in seq(0.1, 0.9, by=0.1)) {
cat('xweight ', x, '\n')
lossw[i] <- cross.validation(file, x)$avg
}
return(lossw) }
MY question is how to index the lossw[i]?
for (i in 1:9)
for (x in seq(0.1, 0.9, by=0.1))
Thanks so much!
2010 May 25
4
R eat my data
HI, Dear R community,
My original file has 1932 lines, but when I read into R, it changed to 1068
lines, how comes?
cdu@nuuk:~/operon$ wc -l id_name_gh5.txt
1932 id_name_gh5.txt
> gene_name<-read.table("/home/cdu/operon/id_name_gh5.txt", sep="\t",
skip=0, header=F, fill=T)
> dim(gene_name)
[1] 1068 3
--
Sincerely,
Changbin
--
Changbin Du
DOE Joint Genome
2011 Sep 01
3
how to split a data frame by two variables
HI, Dear R community,
I want to split a data frame by using two variables: let and g
> x = data.frame(num =
c(10,11,12,43,23,14,52,52,12,23,21,23,32,31,24,45,56,56,76,45), let =
letters[1:5], g = 1:2)
> x
num let g
1 10 a 1
2 11 b 2
3 12 c 1
4 43 d 2
5 23 e 1
6 14 a 2
7 52 b 1
8 52 c 2
9 12 d 1
10 23 e 2
11 21 a 1
12 23 b 2
13 32 c 1
14
2010 Nov 01
2
how to save this result in a vector
HI, Dear R community,
I have the following codes to calculate the commulative coverage. I want to
save the output in a vector, How to do this?
test<-seq(10, 342, by=2)
#cover is a vector
cover_per<-function (cover) {
for (i in min(cover):max(cover)) {print(100*sum(ifelse(cover >= i, 1,
0))/length(cover))}
}
result<-cover_per(test)
> result
NULL
Can anyone help me this this?
2010 Jun 15
1
output from the gbm package
HI, Dear Greg and R community,
I have one question about the output of gbm package. the output of Boosting
should be f(x), from it , how to calculate the probability for each
observations in data set?
SInce it is stochastic, how can guarantee that each observation in training
data are selected at least once? IF SOME obs are not selected, how to
calculate the training error?
Thanks?
--
2010 Dec 16
1
my function does not work for large data set
Dear R community,
I have one function, it works for small data set, but does not work on large
data set, can anyone help me with this?
> #creat new variable by dividing each aa dimer by total_length.
> imper<-function(x, file) {
+ round(x/file$length, 5)
+ }
> dim(test)
[1] 999 2402
> test[varname[2:2401]]<-