Displaying 20 results from an estimated 10000 matches similar to: "New class: data.table"
2011 Aug 03
2
Error message for MCC
Greetings all,
I am getting an error message that is stifling me.
Any ideas?
> ## Define Directories ##
> load_from <- "/home/mcc/Dropbox/abrodsky/kegg_combine_data/"
> save_to <- "/home/mcc/Dropbox/abrodsky/ttest_results/"
>
> ###############################
> ## Define Columns To Compare ##
> compareA <- "log_b_rich"
> compareB
2009 Jul 12
2
Nonlinear Least Squares nls() programming help
Hi, I am trying to use the nls() function to closely approximate a vector of
values, colC and I'm running into trouble. I am not sure how if I am asking
the program to do what I think its doing, because the same minimization in
Excel's Solver does not run into problems. If anyone can tell me what is
going wrong, and why I'm getting a singular convergence(7) error, please
tell me. I
2012 Oct 04
4
Subsetting a group of data
Hi,
I am making my way down the learning curve of R, and find it a great
language with so many helpful users!
Below is an example of what I'm trying to do, but can't quite figure out the
right path to go down.
Here's what I have:
Main is a time series of data with columns Cola and Colb
Cola Colb
1 1 1
2 1
2008 Jun 27
2
change values in data frames
Hello every body,
I am quite a new user of R so I beg your pardon for this naive question and
the lake of syntax with wich I ask it:
I have a data frames like this:
cola colb
1 c
1 i
1 i
1 c
2 i
2 c
2 c
2 i
2 i
...
10000
I would like ,for each level of cola and for x in colb:
-if colb[x]=="i" and colb[x-1] does not exist (first row in dataframes),
then replace colb[x] by
2012 Jul 11
4
Help with loop
Hi,
I have two dataframes:
The first, df1, contains some missing data:
cola colb colc cold cole
1 NA 5 9 NA 17
2 NA 6 NA 14 NA
3 3 NA 11 15 19
4 4 8 12 NA 20
The second, df2, contains the following:
cola colb colc cold cole
1 1.4 0.8 0.02 1.6 0.6
I'm wanting all missing data in df1$cola to be replaced by the value of
df2$cola.
2013 Apr 30
2
R Function to extract columnNames
Hi,
May be this helps:
funcName<- function(df1, x){
?whatCol=df1[[x]]
?print("Got it")
?print(whatCol)
?}
?
funcName(df,"ColA")
#[1] "Got it"
#[1] 1 2 3 4 5
? funcName(df,"ColB")
#[1] "Got it"
#[1] A B C D E
#Levels: A B C D E
A.K.
>I am trying to extract the 2nd column from a dataframe using a function
called funcName. Note this is an
2011 Aug 05
2
Which is more efficient?
Greetings all,
I am curious to know if either of these two sets of code is more efficient?
Example1:
## t-test ##
colA <- temp [ , j ]
colB <- temp [ , k ]
ttr <- t.test ( colA, colB, var.equal=TRUE)
tt_pvalue [ i ] <- ttr$p.value
or
Example2:
tt_pvalue [ i ] <- t.test ( temp[ , j ], temp[ , k ], var.equal=TRUE)
-------------
I have three loops, i, j, k.
One to test the all of
2005 Sep 09
3
how to do something like " subset(mat, ("col1">4 & "col2">4)) "
Dear all,
I have a problem with the "subset()" function. I spent all day yesterday
with a collegue to solve it and we did not find a satisfying solution (even
in the archived mails), so I ask for your help.
Let's say (for a simple example) a matrix mat:
R> mat
cola colb colc
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
My goal is to select the lines of the matrix on the basis of the
2011 Jun 10
2
Sorting Data Frame Without Loop
Hello all!
I am currently trying to sort a data frame in a particular way, but I am having some difficulties with this. Specifically I want to sort the below dataset in such a way that there is only one line per ProteinID and if there are multiple GeneID or GeneName entries for a single proteinID, that they be concatenated with a comma separating them. The way I have done it earlier worked fine
2013 May 26
0
SAPPLY function for COLUMN NULL
colnames(dd)
#[1] "col1" "colb"
null_vector<- colnames(dd)
sapply(null_vector,makeNull,dd)
#???? col1 colb
#[1,]?? NA??? 4
#[2,]??? 2?? NA
#[3,]??? 3??? 2
#[4,]??? 4?? NA
#[5,]??? 1??? 4
#[6,]?? NA??? 5
#[7,]??? 1??? 6
A.K.
>I am trying to make a column value in a dataframe = NA if there is a 0
or high value in that column. I need to do this process repeatedly,
hence
2010 Dec 09
2
Reshape Columns
Hello,
I have a general formatting question. I have two columns of data:
ColA <- c("m", "m", "m", "m")
ColB<- c("d","d","d","d")
And I would like to reorder them into a new column that looks like this:
ColC<-
2011 May 28
1
newbie xml parsing question
I am trying to read some data off the zillow site. Newbie to xml, html,
parsing and the xml package. I've been able to load the web page I'm
interested with the following code but I'm not sure of the next step to get
the information I'm interested in into R :
library(XML)
url <- "http://www.zillow.com/homes/511 W Lafayette St, Norristown, PA_rb"
doc <-doc <-
2012 Jul 11
1
sapply question
Why does this sapply code change df3 but not df1?
Thanks
df1 <- read.table(text="
cola colb colc cold cole
1 NA 5 9 NA 17
2 NA 6 NA 14 NA
3 3 NA 11 15 19
4 4 8 12 NA 20
", header=TRUE)
df2 <-df1*2
df1
df2
df3 <-sapply(names(df1),function(x) {df1[[x]]<- df2[[x]]})
df1
df3
[[alternative HTML version deleted]]
2005 Dec 09
3
[R] data.frame() size
Hi,
Please see below for post on r-help regarding data.frame() and the
possibility of dropping rownames, for space and time reasons.
I've made some changes, attached, and it seems to be working well. I see the
expected space (90% saved) and time (10 times faster) savings. There are no
doubt some bugs, and needs more work and testing, but I thought I would post
first at this stage.
Could some
2006 Mar 02
5
Deparsing '...'
Hi,
The following function works, but is there a neater way to write it?
f = function(x,...)
{
# return a character vector of the arguments passed in after 'x'
gsub("
","",unlist(strsplit(deparse(substitute(list(...))),"[(,)]")))[-1]
}
> f(x,a,b,c*d)
[1] "a" "b" "c*d"
>
Thanks.
[[alternative HTML
2004 Nov 26
2
Tcl error - brace in argument?
Hi all,
Does anyone know a solution for this error ?
> tkwidget(dlg, "iwidgets::spinint", range="{0 23}")
Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class =
"tclObj") :
[tcl] wrong # args: should be ".31.1.19 configure -range {begin
end}".
Thanks,
Matthew
[[alternative HTML version
2009 Mar 31
0
data.table is on CRAN (enhanced data.frame for time series joins and more)
Dear all,
The data.table package was released back in August 2008. This email is to
publicise its existence in response to several suggestions to do so. It
seems I didn't send a general announcement about it at the time and
therefore perhaps, not surprisingly, not many people know about it. Glancing
at some r-help threads recently supports the idea of sending a public
announcement.
The
2009 Mar 31
0
data.table is on CRAN (enhanced data.frame for time series joins and more)
Dear all,
The data.table package was released back in August 2008. This email is to
publicise its existence in response to several suggestions to do so. It
seems I didn't send a general announcement about it at the time and
therefore perhaps, not surprisingly, not many people know about it. Glancing
at some r-help threads recently supports the idea of sending a public
announcement.
The
2015 Feb 24
2
intercalar elementos de vectores
Gracias, Carlos.
Habia pensado en algo similar usando sapply():
sapply(seq(1, ncol(vtmp), by = 2), function(i) c(rbind(as.character(vtmp[,
i]), as.character(vtmp[, i+1]))))
Dependiendo de la dimension de los datos, quizas mapply() sea mas eficiente
que sapply().
Saludos cordiales,
Jorge.-
2015-02-25 1:01 GMT+11:00 Carlos Ortega <cof en qualityexcellence.es>:
> Hola,
>
> Este
2005 Dec 08
2
data.frame() size
Hi,
In the example below why is d 10 times bigger than m, according to
object.size ? It also takes around 10 times as long to create, which fits
with object.size() being truthful. gcinfo(TRUE) also indicates a great deal
more garbage collector activity caused by data.frame() than matrix().
$ R --vanilla
....
> nr = 1000000
> system.time(m<<-matrix(integer(1), nrow=nr, ncol=2))
[1]