similar to: replace an expression with its value, or read macros

Displaying 20 results from an estimated 4000 matches similar to: "replace an expression with its value, or read macros"

2011 Feb 14
1
conditional value assignment
Dear R-Help, I am trying to compute a new variable, let's call it "target cannon orientation (tco)" based conditionally on old variables, "TargetColor," "CannonOriB," and "CannonOriR." For every case in the data set, if TargetColor is "B" then I want tco to equal the value for that case of CannonOirB, else CannonOriR. I've tried writing
2018 Mar 08
4
Fwd: Re: [EXTERNAL] Re: backquotes and term.labels
Ben, Looking at your notes, it appears that your solution is to write your own terms() function for lme.? It is easy to verify that the "varnames.fixed" attribute is not returned by the ususal terms function. Then I also need to write my own terms function for the survival and coxme pacakges? Because of the need to treat strata() terms in a special way I manipulate the formula/terms in
2009 May 11
3
Looking for a quick way to combine rows in a matrix
I'm working with genotype data in a frequency table: > a=matrix(1:16, nrow=4) > rownames(a)=c("AA","AT","TA","TT") > a [,1] [,2] [,3] [,4] AA 1 5 9 13 AT 2 6 10 14 TA 3 7 11 15 TT 4 8 12 16 'AT' and 'TA' are essentially the same, and I'd like to combine (add) the rows to reflect
2018 Mar 08
1
Fwd: Re: [EXTERNAL] Re: backquotes and term.labels
>>>>> Ben Bolker <bbolker at gmail.com> >>>>> on Thu, 8 Mar 2018 09:42:40 -0500 writes: > Meant to respond to this but forgot. > I didn't write a new terms() function -- I added an attribute to the > terms() (a vector of the names > of the constructed model matrix), thus preserving the information at > the point when
2010 Apr 17
2
Interacting with dendrogram plots, locator() or click()
I would like to explore dendrogam plots interactively. For example, click on a node and return information about all of the children of that node. Is there a high level wrapper for locator() or click() that will return the nearest dendrogram node on a plot? If not, is there a way to obtain the [x,y] coordinates of all the nodes on a plot? Thanks, David David J. States, M.D., Ph.D. Professor
2018 Mar 07
1
backquotes and term.labels
Thanks to Bill Dunlap for the clarification. On follow-up it turns out that this will be an issue for many if not most of the routines in the survival package: a lot of them look at the terms structure and make use of the dimnames of attr(terms, 'factors'), which also keeps the unneeded backquotes. Others use the term.labels attribute. To dodge this I will need to create a
2007 May 21
4
How to compare linear models with intercept and those without intercept using minimizing adjs R^2 strategy
Dear R-list, I apologize for my many emails but I think I know how to desctribe my problem differently and more clearly. My question is how to compare linear models with intercept and those without intercept using maximizing adjusted R^2 strategy. Now I do it like the following: > library(leaps) > n=20 > x=matrix(rnorm(n*3),ncol=3) > b=c(1,2,0) > intercept=1 >
2007 Nov 28
3
using names with functions..
Dear all, I have the following (rather) strange problem.. For some reasons, I finally work with a variable whose name includes an R function, "a.log(z)", say. And that is a problem when I call it in a formula, for instance: > myname<-"a.log(z)" > dd<-data.frame("a.log(z)"=1:10,y=rnorm(10)) > o<-lm(y~1,data=dd) >
2010 Jul 16
2
Deleting a variable number of characters from a string
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 deleted is proceeded by either a "+" or a "-". A toy example: Suppose I have
2006 May 26
1
Kernel#system Kernel#` - Is anyone using these in Rails?
Since my previous question didn''t get much attention, I thought I''d make the subject more expressive. I didn''t realize the list had this much traffic. Is anyone using system or "backquote" to run commands in Rails? These work fine in webrick, but both return nil when running in Apache FCGI. In CGI mode, system seems to work, but backquote doesn''t.
2004 Aug 28
6
model.matrix.default chokes on backquote (PR#7202)
Full_Name: Gabor Grothendieck Version: R version 1.9.1, 2004-08-03 OS: Windows XP Submission from: (NULL) (207.35.143.52) The following gives an error: > `a(b)` <- 1:4 > `c(d)` <- (1:4)^2 > lm(`a(b)` ~ `c(d)`) Error in model.matrix.default(mt, mf, contrasts) : model frame and formula mismatch in model.matrix() To fix it replace this line in model.matrix.default:
2009 Mar 27
5
use of "@" character in variable name
Importing data with a header row using read.delim, one variable should be named @5HTT but it is automatically renamed to X.5HTT, presumably because the "@" is either unacceptable or misunderstood. I've tried to find out what the rules are on variable names but have been unsuccessful. I'll bet someone here can tell me where to look. Maybe it's hidden away in here
2008 Jan 24
3
features boxplot
Hallo, I just made a boxplot with the following command: boxplot(vsnrg$M~col(vsnrg$M)) When I now look at the plot. On the x-axis I just find numbers 1-6 because I have 6 datasets plotted. Now I want to add there the corresponding names which can be found in colnames(qrg). How can I realize this the online help does not help me. Thanks Corinna
2006 Nov 17
2
Getting R and .Rdata together again
Somehow, I've managed to have my .Rdata files become `disassociated' from the R program. I am running Windows XP Pro. I have re-installed R 2.4 in an attempt to have it re-associate itself with .Rdata files, but to no avail. .Rdata files are now associated with a file compression program or alternatively with Rgui.exe. .Rdata files are represented by the blue R, but double-clicking on
2011 Apr 10
2
list to data frame
I need to make a data frame out of the data that I currently have in a list. This works, but is ugly: ineffData<-rbind(ineffFilesList[[1]], ineffFilesList[[2]], ineffFilesList[[3]], ineffFilesList[[4]], ineffFilesList[[5]], ineffFilesList[[6]], ineffFilesList[[7]], ineffFilesList[[8]], ineffFilesList[[9]], ineffFilesList[[10]], ineffFilesList[[11]], ineffFilesList[[12]], ineffFilesList[[13]],
2012 Apr 09
2
return one vector that is the sum of a list of vectors
Dear R Help, I am attempting to write a function that takes a list of variable groups and a vector of numbers (e.g., "jtsv" would indicate one group of variables, "jtsv1", "jtsv2", etc, each of which name a variable in a data frame), and returns a list of variable group sums. For example, given list("jtsv", "ptsv") and c(1:10), where jtsv1, etc,
2006 Jun 10
3
MultiMarkdown and MathML - new feature and request for help
A lot of people have expressed interest in combining math features with Markdown, but I am not aware of any real developments from these requests. I was looking around and toying with [ASCIIMathPHP](http:// www.jcphysics.com/ASCIIMath/) and integrated it with MultiMarkdown and my xhtml2latex XSLT transforms. You can include math as an inline formula by using a markup similar to inline
2006 Oct 20
2
Forest plot
Has anyone developed a function to generate a forest plot, the one used a lot in meta-analysis? Joseph F. Lucke, PhD Biostatistician Center for Clinical Research and Evidence-based Medicine Department of Pediatrics School of Medicine University of Texas Health Science Center at Houston Voice: 713-500-5651 Email: Joseph.F.Lucke@uth.tmc.edu Postal Mail: PO Box 20708, Houston, TX 77225-0708
2010 Jun 18
5
extract date time from a text file
I a have a text file where every line is like that: "2007-12-03 13:50:17 Juan Perez" ("yy-mm-dd hh:mm:ss First Name Second Name") I would like to make a data frame with two column one for date and the other one for name. When I use read.delim it was transformed in a data frame with 4 colums. Bye, Sebasti?n.
2010 Feb 21
1
tests for measures of influence in regression
influence.measures gives several measures of influence for each observation (Cook's Distance, etc) and actually flags observations that it determines are influential by any of the measures. Looks good! But how does it discriminate between the influential and non- influential observations by each of the measures? Like does it do a Bonferroni-corrected t on the residuals identified by