data.table's fread reads this as expected. Quoted strings aren't coerced.
sapply(fread('5724550,"000202075214",2005.02.17,2005.02.17,"F"\n'), class)
# V1 V2 V3 V4 V5
# "integer" "character" "character" "character" "character"
Best,
Arun.
On Wed, Sep
Ramiro,
`dt[, lapply(.SD, mean), by=name]` is the idiomatic way.
I suggest reading through the new HTML vignettes at
https://github.com/Rdatatable/data.table/wiki/Getting-started
Ista, thanks for linking to the new vignette.
On Wed, Jun 10, 2015 at 2:17 AM, Ista Zahn wrote:
> Hi Ramiro,
>
> T
David,
In data.table v1.9.5 (current development version, which you can get
from here: https://github.com/Rdatatable/data.table/wiki/Installation),
new features were added to both `melt` and `cast` for data.tables.
They both can handle multiple columns simultaneously. I think this
would be of inte
You're on the wrong list. This is more appropriate on the bioconductor
mailing list.
On Mon, May 5, 2014 at 9:42 AM, Catalina Aguilar Hurtado
wrote:
> Hi,
>
> I want to compare DESeq vs DESeq2 and I am getting different number of DEGs
> which I will expect to be normal. However, when I compare t
Hi Dark,
Sorry for the late response. Since you asked for a `data.table` solution as
well, here's one:
require(data.table)
dt <- as.data.table(rawData)
dt[, GRP := (0:(.N-1L))%/%25L, by=PersonID]
dt[, `:=`(var="codes", N = 1:.N), by=list(PersonID, GRP)]
dcast.data.table(dt, PersonID+GRP ~ var+N,
I think this'll be way simpler and also faster:
ans <- data.frame(pop = rep.int(tab$pop, tab$Freq), ind=sequence(tab$Freq))
Arun
From:Â Dennis Murphy djmu...@gmail.com
Reply:Â Dennis Murphy djmu...@gmail.com
Date:Â March 13, 2014 at 9:57:20 PM
To:Â arun smartpink...@yahoo.com
Cc:Â R help r-help@
Here's another one: match(d, unique(d)).
Arun
From:Â Greg Snow 538...@gmail.com
Reply:Â Greg Snow 538...@gmail.com
Date:Â March 12, 2014 at 8:41:31 PM
To:Â T Bal studentt...@gmail.com
Cc:Â r-help r-help@r-project.org
Subject:Â Re: [R] Assign numbers in R
Here are a couple more options if you
Duncan,
Thank you. What I meant was that "^" is the only *arithmetic operator* to
result in a matrix on operating in a data.frame. I understand it's quite old
code. Also, your explanation makes sense, with the exception of "/" operator, I
suppose (I could be wrong here).
Arun
On Thursday, N
Dear R-users,
I am wondering why "^" operator alone returns a matrix, when operated on a
data.frame (as opposed to all other arithmetic operators). Here's an example:
DF <- data.frame(x=1:5, y=6:10)
class(DF*DF) # [1] data.frame
class(DF^2) # [1] matrix
I posted here on SO:
http://stackoverfl
One way using `Reduce`:
set.seed(45)
grp <- factor(rep(letters[1:10], each=10)) # equivalent of your column x
# dummy data
df <- as.data.frame(matrix(sample(1:1000, replace=T),
ncol=length(levels(grp
# solution
Reduce('+', split(df, grp))/length(levels(grp))
Arun
On Saturday, January 1
10 matches
Mail list logo