Displaying 20 results from an estimated 600 matches similar to: "Partial aggregate on sorted data"
2007 Sep 27
1
Cairo on windows
Hi All,
I just installed Cairo on R 2.5.1 on windows XP. My hope was to get to see
the transparency output e.g. http://had.co.nz/ggplot2/stat_smooth.html
ggplot2 - stat_smooth , which I finally managed to do. However, I find the
Cairo device, which I access either through CairoWin() or Cairo(type="win"),
is pretty shaky in a number of respects :
- whatever portion of the Cairo
2009 Dec 08
1
problem with split eating giga-bytes of memory
I'm having trouble using split on a very large data-set with ~1400 levels of
the factor to be split. Unfortunately, I can't reproduce it with the simple
self-contained example below. As you can see, splitting the artificial
dataframe of size ~13MB results in a split dataframe of ~ 144MB, with an
increase memory allocation of ~10 fold for the split object. If split scales
linearly, then my
2006 Jan 30
3
Date Not Staying in Date Format
I have a column in a data frame that has a class of "Date" and a mode of
"numeric". When I:
max(df$Date)
My output stays in Date format, i.e. "2006-01-03".
However, when I run the following statment:
tapply(df$Date, df$SomeFactor, max)
my output looks like this: 9129 9493 9861 10226 10591 10956 11320
11687 12052 12417
The returned object is of
2011 Apr 07
3
Correlation Matrix
Listers,
I have a question regarding correlation matrices. It is fairly straight
forward to build a correlation matrix of an entire data frame. I simply use
the command cor(MyDataFrame). However, what I would like to do is construct
a smaller correlation matrix using just three of the variable out of my data
set.
When I run this:
cor(MyDataFrame$variable1,
2010 Mar 11
2
Can't convert list to matrix properly
Hi guys, here is a list of names that I have:
MyList:
> myList<-list("A", "B","C","D")
> myList
[[1]]
[1] "A"
[[2]]
[1] "B"
[[3]]
[1] "C"
[[4]]
[1] "D"
I want to turn this list into a matrix of 1 row and 4 columns with those
four components (A, B, C, D) so here is what I do:
myDataFrame <-
2012 Jul 04
2
Difference between two-way ANOVA and (two-way) ANCOVA
Hi!
as my subject says I am struggling with the different of a two-way ANOVA and
a (two-way) ANCOVA.
I found the following examples from this webpage:
http://www.statmethods.net/stats/anova.html
# One Way Anova (Completely Randomized Design)
fit <- aov(y ~ A, data=mydataframe)
# Randomized Block Design (B is the blocking factor)
fit <- aov(y ~ A + B, data=mydataframe)
# Two Way
2005 Apr 04
2
mysql retrive question
hello R-Users,
I have this simple but not for me question:
I do:
> res<-dbSendQuery(con, "SELECT * FROM tabellaProva")
> myDataFrame<-fetch(res)
> myDataMatrix<-as.matrix(myDataFrame[,-1])
> namerows(myDataMatrix)<-as.character(myDataFrame[,1])
and I have:
io tu
io "0" "1"
tu "1" "0"
my problem is that the
2010 Apr 29
2
understanding behavior of "merge"
I'm trying to bootstrap resample from a repeated measures dataset. I sample
a vector of "ID"'s from my dataframe with replacement.
Then I merge this back with my dataframe.
I'm re-sampling subjects in the dataset rather than rows of the data.
I thought I could use the left/right join features of the merge to select
the records I want from the dataframe (mydataframe), like
2007 Apr 22
1
dput/dget when a data frame has 2 rows (PR#9627)
This doesn't seem right; I'm using R version 2.4.1 (2006-12-18) on Mac OS
and Win XP and find the same issue:
> mydataframe <- data.frame(ppi=c(.5,.5),mmu=c(5,10))
> dput(mydataframe,"mydataframe.txt")
> dget("mydataframe.txt")
Error in attributes(.Data) <- c(attributes(.Data), attrib) :
row names must be 'character' or 'integer', not
2010 May 15
1
Dataframe to word, using R2wd
Hi All,
I'm trying to use R2wd to send a dataframe to Word. The dataframe
isn't huge - 300 rows, 12 variables, although it has some long strings
in it.
Using:
wdTable(format(myDataFrame))
or
wdTable(myDataFrame)
Produces a very complex table, which Word struggles to process and
layout. (I can't work out what the table is - it seems to be nested
tables. Converting to text gives
2012 Jul 19
2
problem with using apply for dataframe
Dear people,
I am including an example of a dataframe:
mydataframe<-data.frame(X=c(1:4),total_bill=c(16.99,10.34,21.01,23.68),tip=c(1.01,1.66,3.50,3.31),sex=c("Male","Male","Male","Female"))
When I use the sapply function getting the information about the factors
works:
sapply(mydataframe,function(x)is.factor(x))
X total_bill tip
2010 Apr 26
1
Sweave: centering with echo=TRUE
In a .Rnw file I want to insert the R command
pairs(mydataframe)
and achieve the following effects
1. the command itseld is echoed into the tex document generated by Sweave
<<fig=TRUE,echo=TRUE>>=
2. The graphics generated appears in the tex document, with the graphics
centred.
3. The R command > pairs(mydataframe) is not centered.
Sweave-manual.pdf gives the following code chunk
2005 Jun 15
1
anova.lme error
Hi,
I am working with R version 2.1.0, and I seem to have run into what looks
like a bug. I get the same error message when I run R on Windows as well as
when I run it on Linux.
When I call anova to do a LR test from inside a function, I get an error.
The same call works outside of a function. It appears to not find the right
environment when called from inside a function. I have provided
2004 Nov 20
2
subset on data frame
I have a data frame. And I'd like to subset according to rownames.
subset(mydataframe, rownames(mydataframe) == myrow, select = mycols)
it turned out that "myrow" cannot be a vector. But I have multiple rows to
pick. Is there a way to get around this problem??
Thank you for your help!!
Lei Jiang
Department of Chemsitry
University of Washington
Box 351700
Seattle, WA 98195
2011 May 27
1
Reference Classes/S4 Classes: can method dispatch check superclasses BEFORE resorting to method for "ANY"?
Dear list,
is it possible that method dispatch checks for superclasses/virtual
classes before checking "ANY"?
I'd like to build a generic initialization method for all my Reference
Class (say "MyDataFrame") objects by having them inherit from class, say
"MyRefClassVirtual" (which would have to be a virtual S4 class; there
are no virtual Reference Classes,
2011 Dec 22
1
ff object in lapply function
Hello. I'm using as.ffdf(mydataframe) to create ffdf objects inside an lapply
loop and returning that. I then use crbind to combine the lapply results
into allData.
So...simplified flow looks like this.
res <- lapply(1:nchunks, function(n)
{
blah blah with nth chunk
mydataframe <- data.frame(blah blah)
dat <-
2018 Mar 12
0
Equivalent of gtools::mixedsort in R base
1- mixedorder does not work in a "do.call(mixedorder, mydataframe)"
call like the order function does
This is tangential, but do.call(order, mydataframe) is not safe to use in a
general purpose function either - you need to remove the names from
the second argument:
> d <- data.frame(method=c("New","New","Old","Old","Old"),
2007 Jan 11
2
Wishlist: Sweave: allow line breaks after forward slashes (PR#9443)
Full_Name: Arne Henningsen
Version: 2.4.0
OS: Linux
Submission from: (NULL) (134.245.140.242)
Sweave does not allow line breaks after forward slashes ("/"). This might lead
to a long "substring" of a command that cannot be wrapped. Hence, Sweave either
keeps this long "substring" in the current line and produces a too long line or
it moves the entire
2009 Jun 24
1
"by" question
Hello all
I have a big data frame and I regularly want to break it down into subsets,
calculate some new data, and add it back to the data frame.
At the moment my technique seems a bit ugly and embarrassing. Something
like:
result <- by(mydata, mydata$some_factor, function (x) {
# do something to create a vector v with length(v) == nrow(x)
return(v)
})
# now result has a big list, argh...
2004 Mar 03
1
R2HTML adding caption to data-frame
Hi,
I was wondering if there was an easy way to add a caption to a data frame when it is being sent to a html page using R2HTML.
currently the following command will produce a reasonably formatted table in a html file
HTML(mydataframe)
It would be good if you could send caption with the table something like
HTML(lCaption="my table caption",mydataframe) # this works but leaves a blank