similar to: Obtaining name of data frame used in a function argument

Displaying 20 results from an estimated 10000 matches similar to: "Obtaining name of data frame used in a function argument"

2009 Aug 27
1
generating multiple sequences in subsets of data
I'm running into a problem I can't seem to find a solution for. I'm attempting to add sequences into an existing data set based on subsets of the data. I've done this using a for loop with a small subset of data, but attempting the same process using real data (200k rows) is taking way too long. Here is some sample data and my ultimate goal >
2004 Sep 01
1
obtaining exact p-values in mixed effects model
Hello, Using a fixed effects linear model (with lm), I can get exact p-values out of the AVOVA table, even if they are very small, eg. 1.0e-200. Using lme (linear mixed effects) from the nlme library, it appears that there is rounding of the p-values to zero, if the p-value is less than about 1.0e-16. Is there a way we can obtain the exact p-values from lme without rounding? used commands:
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
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 <-
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
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
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
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
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
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
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"),