Hi,
It might be a trivial question but I just wonder if you could advise good
theoretical tutorials, reviews on NGS (different platforms) quality control
like nucleotides quality by cycle, nucleotides frequency by cycle, GC content
and distribution, K-mer frequency by cycle as well as quality c
Replace
lst <- paste('dat$', grp, sep='', collapse =',')
aggregate(dat$x, list(lst), mean)
with
aggregate(dat$x, dat[grp], mean)
The 'by' argument to aggregate should be a list
and data.frames (like dat and dat[grp]) are lists.
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -
Hi all,
How can I have a dynamic list for different combinations of grouping factors in
the following example? Thanks.
dat <- data.frame(x=rnorm(100),
a=sample(letters[1:5], replace = T),
b=sample(letters[1:5], replace = T),
c=sample(letters[
Hi ,
I am trying to get some estimator based on lognormal distribution when we have
left,interval, and right censored data. Since, there is now avalible pakage in
R can help me in this, I had to write my own code using Newton Raphson method
which requires first and second derivative of log likel
Hello,
You could see what is fun1 receiving with this modification meant for
debugging:
fun1 <-function(x, y, z=10){
print(match.call())
x + y + z
}
Anyway, there is s standard way of dealing with argument '...' when one
needs to know what was passed.
Include dots <- list(...) at the
Hi all,
I've been trying to run a model using R2winBUGS, and recurrently I
get the message:
"Error in FUN(X[[3L]], ...) :
invalid to change the storage mode of a factor"
My model is the following:
sink("GLMM_Poisson.txt")
cat("
model{
mu~dnorm(0,0.01)
beta1~dnorm(-1,1)
for(j in 1:ns
Thank you all for the quick responses.
Setting 0 with *NA* is the right thing to do.
Also Peter, thanks to your package, using the command 'cos <-
cor(m,method='pearson',cosine=TRUE,use='p')' you mentioned' makes my life a
lot more easier.
zz
--
View this message in context:
http://r.789
Dear Friends,
Let's assume there are three parameters that were passed into fun1. In
fun1, we need to modify one para but the remains need to be untouched. And
then all parameters were passed into fun2. However, I have failed to
achieve it.
Please see the following code.
Dave said my newdata data frame 'new' must have a column named 'area'.
It did. Nonetheless predict.lm throws an error with type = "terms" and
newdata = new. I see nothing in the predict.lm documentation that
bars this usage. Is there a bug?
To illustrate an OLS behavior, I had cited Ludbrook '12.
On Aug 30, 2012, at 2:29 PM, John Thaden wrote:
> Dave said my newdata data frame 'new' must have a column named 'area'.
> It did. Nonetheless predict.lm throws an error with type = "terms" and
> newdata = new. I see nothing in the predict.lm documentation that
> bars this usage. Is there a bug?
Whit Armstrong is building a R-centric BUGS (RcppBugs) which looks
very powerful as well: you might talk to him about it.
www.rinfinance.com/agenda/2012/talk/WhitArmstrong.pdf
https://github.com/armstrtw/rcppbugs
Cheers,
Michael
On Thu, Aug 30, 2012 at 3:12 PM, Seref Arikan
wrote:
> Hi Petar,
>
Hi Petar,
I've tried to build a model with WinBugs and found out that there is a
limit related to defining variables with discrete distributions. Sorry I
can't remember the details but I think it did not support more than 5
discrete variables as parent of another variable or something like that.
JA
On Thu, Aug 30, 2012 at 10:48 AM, zz wrote:
> Hello,
>
> I have a self-defined function to be computed on each column in a matrix.
> The basic idea is to ignore the elements that have value of 0 during
> computation.
>
> I should be able to write my own function but it could be computational
> exp
> * William Dunlap [2012-08-30 17:35:08 +]:
>
> I don't agree with your analysis of what went wrong with your example
>> a double conversion: from number to string first (by c()) and then back.
I did not make myself quite clear, sorry.
I should have written something like
c(1,2,"a") ==> "1" "2
Hi zz,
The help file for the dist() function ( ?dist) says that
"Missing values are allowed, and are excluded from all computations
involving the rows within which they occur"
so if you can cajole this into any of the standard distance metrics,
you could do something like:
x[x == 0] <- NA
On Thu, Aug 30, 2012 at 2:30 AM, Andreas Leha
wrote:
> Hi all,
>
> I experience a segfault when calling gplots::heatmap.2(), but only when
> certain other packages are loaded.
>
> I am not sure for the correct place to send this bug report. Should I send
> it to the package maintainers directly?
Hello,
I have a self-defined function to be computed on each column in a matrix.
The basic idea is to ignore the elements that have value of 0 during
computation.
I should be able to write my own function but it could be computational
expensive, so I'd love to ask if anyone may have suggestions
Hi,
For the first part in the two questions, do this:
dat1<-data.frame(Temp=c(5,10,9,15,NA,14,25,21,24,23,21,24,35,35,36,34,32,33),Temp2=c(5,10,9,15,15,14,25,21,24,23,21,24,35,35,36,34,32,33),Month=rep(c("January","February","March","April","May","June"),each=3),Roof=as.factor(rep(1:6,times=3)))
Hi Bert,
Thanks! These worked perfectly.
mydata<-mydata[,!(i1)]
Dan
-Original Message-
From: Bert Gunter [mailto:gunter.ber...@gene.com]
Sent: Thursday, August 30, 2012 8:54 AM
To: Lopez, Dan
Cc: R help (r-help@r-project.org)
Subject: Re: [R] Identifying and Removing NA Columns and fac
you might to do something like
library(SuppDists)
t = runif(100, 100, 500) # original RT
t_IG = qinvGauss(ecdf(t)(t)-0.5/length(t), 1, 16)
plot(density(t_IG))
but what is the purpose of it? Usually reaction times are thought to
follow a certain kind of distribution (e.g. an inverse Gaussian
dis
> * Bert Gunter [2012-08-30 09:59:46 -0700]:
>
> You really should spend a little more time with the docs figuring out
> what R _does_ and a little less complaining about what you think R
> cannot do.
The only thing I think R cannot do is compact its memory, thus,
effectively, leaking it in _some
On 29 August 2012 at 20:07, Linh Tran wrote:
| Thank you for the advice. I tried using the command, and it still
| wouldn't load.
|
| I tried uninstalling all of the MPI interfaces, reinstalled openmpi
| using the "--enabled-shared --disable-dlopen" command, and Rmpi was able
| to install suce
Hello,
Yet another alternative.
library(plyr)
dfr <- ldply(strsplit(c("a,1", "b,2", "c,3"), ","), identity)
str(dfr)
#dfr$V2 <- as.numeric(dfr$V2)
So, if the op was about conversion to df, the answer is yes.
Rui Barradas
Em 30-08-2012 18:14, David Winsemius escreveu:
On Aug 30, 2012, at 9
Have you tried to check memory limit.
You may want to check
Memory.limit()
Although in most of the cases you can extend limit to 4000.
Also as David mentioned try to run only r and force stop others.
Best Regards,
Bhupendrasinh Thakre
Sent from my iPhone
On Aug 30, 2012, at 10:02 AM, David Win
At 00:23 30/08/2012, Louise Cowpertwait wrote:
Please can someone advise me how I can adjust correlations using
bonferroni's correction? I am doing manny correlation tests as part
of an investigation of the validity/reliability of a psychometric measure.
Louise, apart from the excellent advice
Here are two ways of turning a character vector like yours into a data.frame,
neither of which uses an apply-like function.
> s <- c(XVI="p,16", XVII="q,17", XVIII="r,18")
> d1 <- data.frame(Letter=sub(",.*", "", s),
Number=as.integer(sub(".*,","",s)))
> d2 <- read.table(text=s, sep=",", col
Can you post a reproducible example? Do you have \begin{document} in
your Rnw file?
Regards,
Yihui
--
Yihui Xie
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Thu, Aug 30, 2012 at 10:35 AM, Sven D wrote:
> Hello,
>
> a
Hello,
after trying to convert to pdf using knitr, I get the following error
messages from the error log:
C:/Users/duve/Documents/plots2.tex:5: LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help
You're in trouble here. Tr
Thanks for your help guys. I was refering to the variables the wrong way.
This worked for me:
idx <- !duplicated(detail2[,c("TDATE","FIRM","CM","BRANCH",
"BEGTIME", "ENDTIME","OTYPE","OCOND",
"ACCTYP","OSIDE","SHARES","STOCKS",
"ST
On Aug 30, 2012, at 9:44 AM, Sam Steingold wrote:
* Sam Steingold [2012-08-30 08:56:17 -0400]:
Is there a way for an apply-type function to return a data frame?
the closest thing I think of is
foo <- as.data.frame(t(sapply(...)))
names(foo) <- c()
alas, this has a problem of creating
?lapply
> z <-data.frame(a=1:3,b=letters[1:3])
> lapply(z,"[",1:2)
$a
[1] 1 2
$b
[1] a b
Levels: a b c
> data.frame(lapply(z,"[",1:2)) ## Is this not what you want?
a b
1 1 a
2 2 b
You really should spend a little more time with the docs figuring out
what R _does_ and a little less complaini
> * Sam Steingold [2012-08-30 08:56:17 -0400]:
>
> Is there a way for an apply-type function to return a data frame?
> the closest thing I think of is
>
> foo <- as.data.frame(t(sapply(...)))
> names(foo) <- c()
alas, this has a problem of creating a "homogeneous" data frame, i.e.,
all th
Possibly easier: plot(x, y, log = "x")
Cheers,
Michael
On Aug 30, 2012, at 5:47 AM, Rui Barradas wrote:
> Hello,
>
> The following is the general idea.
>
> x <-c(0.25,0.5,1,2,4,8,16,32)
> y <-c(1,1,1,1,0.9,0.8,0.6,0.2)
>
> plot(log(x),y,type="b", xaxt = "n")
> axis(1, at = log(x), labels = x
If d is your data frame
i1 <- sapply(d,function(x)is.factor(x)&&length(levels(x))>31)
## a vector of length ncol(d) that is TRUE only for factor columns
with >31 levels
i2 >- sapply(d,function(x)any(is.na(x)))
## You can figure it out.
-- Bert
On Thu, Aug 30, 2012 at 8:38 AM, Lopez, Dan wrote:
Dear Jinsong,
This model is grossly underidentified because there are no exogenous
variables in it. Your inability to estimate the model isn't a software
issue.
Best,
John
---
John Fox
Senator McMaster Professor of Social Statistics
Department of Soci
Hi,
How do you subset a dataframe so that you only have columns:
1. that contain one or more NAs?
2. that contain factors with greater than or equal to 32 levels?
How do you remove from a dataframe columns**
3. with one or more NA's?
4. that contain factors with greate
?paste
plot(1, main = paste(x, "hours", y , "minutes", z , "seconds", sep =" "))
John Kane
Kingston ON Canada
> -Original Message-
> From: motyoc...@yahoo.com
> Sent: Thu, 30 Aug 2012 06:49:04 -0700 (PDT)
> To: r-help@r-project.org
> Subject: [R] Help on Plot Title where text is "mixe
On Aug 30, 2012, at 4:02 AM, mushira wrote:
Hi all,
I am trying out with random forest on party package but am getting
an error
saying : cannot allocate vector of size 564." What would be the
problem? the
coding as below:
data.controls <- cforest_unbiased(ntree=1000, mtry=3)
data.cforest
On Aug 30, 2012, at 4:02 AM, andyspeak wrote:
Hello
Thankyou for the help.
kruskal.test(Temp, Roof) is simple but just returns one result for
the
whole temperature dataset organised by roof.
I want to compare the Temp data for each Roof in each Month. So
because i
have temperature dat
Look at the sprintf and paste functions (either one will do what you describe).
On Thu, Aug 30, 2012 at 7:49 AM, Andras Farkas wrote:
> Dear All,
>
> I have the following code set up:
>
> x <-2000
> y <-8
> z <-3
>
> I would need to use these numbers to show up in my plot title "mixed" with
> te
On Aug 30, 2012, at 7:24 AM, Juan Antonio Balbuena wrote:
matrix1 <- matrix(rnorm(16),4)
rownames(matrix1) <- LETTERS[1:4] # fixed the coding error
colnames(matrix1) <- letters[1:4]
matrix2 <- matrix1
colnames(matrix2) <-
paste(rownames(matrix1),colnames(matrix1),sep="-")
matrix2
--
Da
On Aug 30, 2012, at 12:08 AM, m4n14ccc wrote:
Hey
I have a little problem here:
I have an experimental space, lets say [-1,+1]^2, and I fit a second
order
model above it. Regarding the whole experimental space the regression
function maps within [-3,+4], which means nothing else than
f^-1
HI,
As you are more number of columns which are numeric,
try this:
set.seed(1)
dat1<-data.frame(OreTot=c(40,-7,41,35,7,15),GeoTot=c(TRUE,FALSE,TRUE,FALSE,TRUE,NA),OreCli=as.numeric(sample(1:25,6,replace=TRUE)))
dat2<-dat1[sapply(dat1,is.numeric)]
dat3<-data.frame(sapply(dat2,function(x)
ifelse(
HI,
You can also use "gsub"
set.seed(1)
dat1<-data.frame(OreTot=c(40,-7,41,35,7,15),GeoTot=c(TRUE,FALSE,TRUE,FALSE,TRUE,NA),OreCli=as.numeric(sample(1:25,6,replace=TRUE)))
dat1[,1]<-ifelse(dat1[,1]>0,gsub("(\\d+)","+\\1",dat1[,1]),dat1[,1])
dat1[,3]<-ifelse(dat1[,3]>0,gsub("(\\d+)","+\\1",dat1[,3]
HI,
Try this:
set.seed(1)
dat1<-data.frame(OreTot=c(40,-7,41,35,7,15),GeoTot=c(TRUE,FALSE,TRUE,FALSE,TRUE,NA),OreCli=as.numeric(sample(1:25,6,replace=TRUE)))
dat1$OreTot<-ifelse(dat1$OreTot>0,formatC(dat1$OreTot,format="f",digits=1,flag="+"),dat1$OreTot)
dat1$OreCli<-ifelse(dat1$OreCli>0,formatC(da
Hi there,
I searched R-help list with "path analysis" as keyword, and learn that
sem package can do it. However, I don't figure out a way to construct
the model for the path diagram as Fig. 1. in Huang et al. (2002)[1].
I try the following code:
huang.cor <- readMoments(diag=FALSE, names=c('
Hi all,
I am trying out with random forest on party package but am getting an error
saying : cannot allocate vector of size 564." What would be the problem? the
coding as below:
>data.controls <- cforest_unbiased(ntree=1000, mtry=3)
> data.cforest <- cforest(class ~x1+x2+x3, data = Score,
> contro
Dear All,
I have the following code set up:
x <-2000
y <-8
z <-3
I would need to use these numbers to show up in my plot title "mixed" with
text. The x,y,z numbers would need to change, the text would not. So my title
should look like this
"x txt1 y txt2 z txt3"
so if:
txt1=hours
txt2=m
Hello
Thankyou for the help.
kruskal.test(Temp, Roof) is simple but just returns one result for the
whole temperature dataset organised by roof.
I want to compare the Temp data for each Roof in each Month. So because i
have temperature data on the three roofs for 16 different months then i wan
Actually its okay.
I just created 16 subsets of the dataframe using the different months and
then ran kruskal test 16 times.
Im sure there is a nice way to code this to do it automatically and produce
a nice table of the results but i only started learning R two weeks ago!!!
Thanks for all the hel
Hello
I would appreciate any help with the following:
Given a matrix with col and row names, such as
> matrix1 <- matrix(rnorm(16),4)
> rownames(matrix1) <- LETTERS(1:4)
> colnames(matrix1) <- letters[1:4]
> matrix1
a bc d
A 1.6845882 -0.27809792 -0.87479
I forgot to mention data.table package and also function aggregate as part
of base R functions could be useful here
Andrija
On 30 Aug 2012 13:09, "andrija djurovic" wrote:
>
> hi
> try with plyr library and function ddply
>
> Andrija
>
> On 30 Aug 2012 12:58, "Sam Steingold" wrote:
> >
> > Is t
hi
try with plyr library and function ddply
Andrija
On 30 Aug 2012 12:58, "Sam Steingold" wrote:
>
> Is there a way for an apply-type function to return a data frame?
> the closest thing I think of is
>
> foo <- as.data.frame(sapply(...))
> names(foo) <- c()
>
> is there a more "elegant"
Is there a way for an apply-type function to return a data frame?
the closest thing I think of is
foo <- as.data.frame(sapply(...))
names(foo) <- c()
is there a more "elegant" way?
Thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.chil
Hello ALL!
Some times ago I started to learn and play with Bayesian stuffs. Many
advice use of WinBUGS for Bayesian inference Using Gibbs Sampler.
However, WinBUGS is discontinued, and now, development is under
OpenBUGS. I wasn't lazy, so I installed both and tried out. In more than
90% of cases th
Hello,
Instead of reversing the regression, that, like you say, may have
problems, it's very easy to wrap the formula
x' <- (y' - beta0)/beta1
in a function and use the direct regression to get new 'x' values from
new 'y' ones.
This function assumes a first order ols model.
invpredict <- f
Hello,
The following is the general idea.
x <-c(0.25,0.5,1,2,4,8,16,32)
y <-c(1,1,1,1,0.9,0.8,0.6,0.2)
plot(log(x),y,type="b", xaxt = "n")
axis(1, at = log(x), labels = x)
If the x values are not so "neat", you can adjust the axis ticks and
labels using round/seq.
Hope this helps,
Rui Barrad
Hi,
again i had small clarification regarding the discussion. I had 6
images of two threshold test, so can i plot 6 roc for each individual image?
or can i plot two roc curve (threshold 1 all images summed up and similar to
threshold 2)? which is the correct one?
Please clarify me in this re
Thanks a lot 2 all of you.
Both proposals work very fine!!
Thank you and best greetings.
Geophagus
--
View this message in context:
http://r.789695.n4.nabble.com/barchart-with-3-rows-tp4641572p4641809.html
Sent from the R help mailing list archive at Nabble.com.
__
dear All
I am trying to plot the following with the x axis on the log scale, but I would
like the original x values to show up as labels:
x <-c(0.25,0.5,1,2,4,8,16,32)
y <-c(1,1,1,1,0.9,0.8,0.6,0.2)
plot(log(x),y,type="b")
here I would like the labels 0.25,0.5,1,2,4,8,16, and 32 to show on
Hi, r-helpers,
does anybody know how to get the MAP estimator?
I have a dataframe (nrow=10,000, ncol=24) with 24 parameters. It is a
sample from MCMC simulation. which function can generate the MAP estimator
for each of the 24 parameters.
Many thanks in advance,
Bin
[[alternative HTML
Hi
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Luca Meyer
> Sent: Thursday, August 30, 2012 7:55 AM
> To: R help
> Subject: [R] Leading plus in numeric fields
>
> Hello R experts,
>
> I have go this data frame:
>
> 'dat
Hey
I have a little problem here:
I have an experimental space, lets say [-1,+1]^2, and I fit a second order
model above it. Regarding the whole experimental space the regression
function maps within [-3,+4], which means nothing else than
f^-1([-3,+4])=[-1,+1]
Now for example the question is: Wh
Hi all,
I experience a segfault when calling gplots::heatmap.2(), but only when
certain other packages are loaded.
I am not sure for the correct place to send this bug report. Should I send
it to the package maintainers directly? If R-help is the wrong place,
please feel free to direct me to th
On Thu, Aug 30, 2012 at 12:50 AM, Yihui Xie wrote:
> Do you know what environments are allowed inside \subfloat{}? The
> graphics example works because it is nothing but a simple
> \includegraphics{} command. The table example you gave is much more
> complicated than that.
>
> Regards,
> Yihui
> -
On 29.08.2012 20:32, Ivan Alves wrote:
Dear Uwe,
Many thanks for the reply.
On 1, the problem is that RODBC on 32 bit ' interprets' factors correctly, whereas on 64
bit it gives the error below. On both systems forcing characters (via colClasses =
"character" in read.csv), results in no pro
66 matches
Mail list logo