[R] Tracing a variable name back

2015-03-06 Thread Davis, Brian
I'm looking to find a way to trace back the original variable name after a being passed through a series of functions. I can get the variables names for the current call easy enough with match.call, but I'd like to go back further if the function was called from another function. Say I have.

[R] assigning the class of an object

2013-09-10 Thread Davis, Brian
I'm sure this has been answered before but alas my googlefoo is not that strong. I have several .Rdata files with a single object in them. I need to set the class of the object to "myClass". Unfortunately, I don't know the name of the object beforehand. Obviously I could ls() and get the name

Re: [R] Help understanding environments

2013-06-18 Thread Davis, Brian
Thanks a bunch. Can't believe I missed that. -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Tuesday, June 18, 2013 9:57 AM To: Davis, Brian Cc: r-help@r-project.org Subject: Re: [R] Help understanding environments Hello, The first argument to exists()

Re: [R] Help understanding environments

2013-06-18 Thread Davis, Brian
bined <- res } } return(combined) } combined_results <- c_objects(FILES) -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Monday, June 17, 2013 5:40 PM To: Davis, Brian Cc: r-help@r-project.org Subject: Re: [R] Help understanding environment

Re: [R] Help understanding environments

2013-06-17 Thread Davis, Brian
day, June 17, 2013 4:25 PM To: Davis, Brian Subject: Re: [R] Help understanding environments Hello, The error I get is: Error: object 'res' not found You are using an undefined variable, 'res'. I don't believe this has something to do with environments. Rui Barradas Em

[R] Help understanding environments

2013-06-17 Thread Davis, Brian
I have a collection of .RData files that have result objects that I would like to combine. Specifically, skatCohort objects from the skatMeta package, but I've run into a similar issue with simple data.frames also. If I run something like FILES <- list.files(path="/path/to/my/results", pattern

Re: [R] Needing a better solution to a lookup problem.

2012-03-15 Thread Davis, Brian
user system elapsed 0.700.000.71 Brian -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Wednesday, March 14, 2012 2:44 PM To: Davis, Brian Cc: r-help@R-project.org Subject: Re: [R] Needing a better solution to a lookup problem. On Mar 14, 2

Re: [R] Needing a better solution to a lookup problem.

2012-03-14 Thread Davis, Brian
24), 20, replace=TRUE)),s=runif(20),t=runif(20)) system.time(with(FDF <- merge(fdf2,fdf1),FDF[s>=p & p >= t,])) Thanks again, Brian -Original Message- From: ila...@gmail.com [mailto:ila...@gmail.com] On Behalf Of ilai Sent: Wednesday, March 14, 2012 3:26 PM To: D

[R] Needing a better solution to a lookup problem.

2012-03-14 Thread Davis, Brian
I have a solution (actually a few) to this problem, but none are computationally efficient enough to be useful. I'm hoping someone can enlighten me to a better solution. I have data frame of chromosome/position pairs (along with other data for the location). For each pair I need to determine

Re: [R] Counting occurances of a letter by a factor

2010-09-10 Thread Davis, Brian
ll three levels) Brian -Original Message- From: Thomas Lumley [mailto:tlum...@u.washington.edu] Sent: Friday, September 10, 2010 3:22 PM To: Davis, Brian Cc: Phil Spector; r-help@r-project.org Subject: Re: [R] Counting occurances of a letter by a factor On Fri, 10 Sep 2010, Davis, Brian w

Re: [R] Counting occurances of a letter by a factor

2010-09-10 Thread Davis, Brian
instead of a string like: > DF2<-data.frame(c("C", "C", NA, "C", "G", "G"), c("L", "U", "L", "U", "L", > NA)) > colnames(DF2)<-c("X", "Y") > DF2 X Y 1

[R] Counting occurances of a letter by a factor

2010-09-10 Thread Davis, Brian
I'm trying to find a more elegant way of doing this. What I'm trying to accomplish is to count the frequency of letters (major / minor alleles) in a string grouped by the factor levels in another column of my data frame. Ex. > DF<-data.frame(c("CC", "CC", NA, "CG", "GG", "GC"), c("L", "U", "L

[R] String processing - is there a better way

2010-07-21 Thread Davis, Brian
I have a two part question Part 1) I am trying to remove characters in a string based on the position of a key character in another string.  I have a solution that works but it requires a for-loop.  A vectorized way of doing this has alluded me.  CleanRead<-function(x,y) {   if (!is.characte

[R] Deleting a variable number of characters from a string

2010-07-16 Thread Davis, Brian
I have a text processing problem I'm hoping someone can help me solve. This issue it this. I have a character string in which I need to delete a variable number of characters from the string. The string itself contains the number of characters to be deleted. The number of characters to be d