Displaying 20 results from an estimated 800 matches similar to: "problem with split eating giga-bytes of memory"
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 <-
2007 Oct 24
3
Partial aggregate on sorted data
Hi All,
I'm looking for ways to compute aggregate statistics (with the aggregate
function) but with an option for sorting and selecting a subset of the data
frame. For example, I have would like to turn this :
aggregate(myDataframe$TargetValue,list(SomeFactor =
myDataframe$SomeFactor),mean)
into something like
aggregate(myDataframe$TargetValue,list(SomeFactor =
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
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
2010 Mar 11
1
Obtaining name of data frame used in a function argument
I'm writing a function that can take a data.frame as an argument. I'd
like to be able to obtain the name of the data.frame and print it out
within the function. My current function looks like this:
examineIt<-function(x) {
print(nrow(x))
print(x[ceiling(runif(10)*nrow(x)),])
print(summary(x))
}
examineIt(myDataFrame)
I'd like for the function to also output
2012 Mar 05
1
Error in file(fname, "r") : invalid 'description' argument when running maptools' readAsciiGrid on a dataframe
Hi,
I'm trying to calculate a sum of differences between two ascii grids.
I have the file names of the two grid files in a data.frame along with
other data. I'm then trying to add a new column to the data.frame with
the result of that calculation.
eg.
library(maptools)
difcount <- function(surfA, surfB) {
A <- readAsciiGrid(surfA, colname="a")
B <-
2009 Jul 09
3
Stratified data summaries
Hi All,
I'm trying to automate a data summary using summary or describe from the
HMisc package. I want to stratify my data set by patient_type. I was
hoping to do something like:
Describe(myDataFrame ~ patient_type)
I can create data subsets and run the describe function one at a time,
but there's got to be a better way. Any suggestions?
Rachel
[[alternative HTML