[R] How to create several variables from composite character variable

2007-08-17 Thread Dale Steele
I'm trying to create two variables (dka and newsonset) from the following composite character variable diagnosis: diagnosis - c(hypoglycemia,diabetes ,newonsetdka, newonset, diabetes, dkaGI, diabetesGI, newonset, dka) I can extract the indices for dka and newonset using the following

Re: [R] Tools For Preparing Data For Analysis

2007-06-08 Thread Dale Steele
For windows users, EpiData Entry http://www.epidata.dk/ is an excellent (free) tool for data entry and documentation.--Dale On 6/8/07, Chris Evans [EMAIL PROTECTED] wrote: Martin Henry H. Stevens sent the following at 08/06/2007 15:11: Is there an example available of this sort of

[R] Data management problem (reorder rows in dataframe by text flag)

2007-02-07 Thread Dale Steele
Given two columns of type character in a dataframe of the form: col1col2 31* 66 0 0* 102*66 71* 80 31 2* 66 31* 47 38* How do I generate the following dataframe? Ie. col1 contains row item with * and col2 contains row member without * col1col2 31

[R] How to reorder rows in dataframe by text flag

2007-02-06 Thread Dale Steele
Given two columns of type character in a dataframe of the form: col1col2 31* 66 0 0* 102*66 71* 80 31 2* 66 31* 47 38* How do I generate the following dataframe? Ie. col1 contains row item with * and col2 contains row member without * col1col2

[R] Contour plot of bivariate log-likelihood function

2006-10-15 Thread Dale Steele
Thanks to prior help from the list, I've made progress in adapting a univariate log-likelihood function to a bivariate one for Box-Cox transformations. However, I'm having trouble plotting values of the log-likelihood function (z) for given range of lambda(1) and lambda(2). The current result

[R] for loop not working in function

2006-10-10 Thread Dale Steele
I'm trying to write a small function (below) to compute Box Cox transformations of x for arbitrary values of lambda. I'd like to specify a range of values for lamba (min,max,step) and am having trouble getting the for loop to work. Suggestions? Any pointers to resources for learning to

[R] Maximum value of two columns

2006-05-10 Thread Dale Steele
Hello -- Given the 10x2 matrix below, my goal is to create a vector which contains the maximum of column 1 and column 2, or the only value if there is an NA in one column. I experimented with max.col without success. Thanks. --Dale tmax.m tmaxhme tmaxer [1,] 101.0 99.8 [2,]

[R] How to find row maximum of two columns

2006-05-10 Thread Dale Steele
Hello -- Given the 10x2 matrix below, my goal is to create a vector which contains the maximum of column 1 and column 2, or the only value if there is an NA in one column. I experimented with max.col without success. Thanks. --Dale tmax.m tmaxhme tmaxer [1,] 101.0 99.8

[R] Data management problem: convert text string to matrix of 0's and 1's

2006-01-26 Thread Dale Steele
0 0 Thanks. Dale Dale Steele, MD Pediatric Emergency Medicine Brown Medical School __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html