[R] odfweave table styles

2009-11-03 Thread Colin Robertson
Hello List,

Does anyone have examples of custom formatting of tables in odfweave? I know
there is an example of this in the formatting.odt file that comes with the
package, but running that through odfweave gives the following error:

Error:  chunk 13 (label=showTableStyles)
Error in names(x) <- value :
  'names' attribute [1] must be the same length as the vector [0]

What I am really trying to do is replicate this part which highlights one
row

<>=
bigState <- which.max(tableData[, "Area"])
tableStyles$text[bigState,] <- "ArialHighlight"
tableStyles$cell[bigState,] <- "highlight"
tableStyles$text
@

In my code I do:

<>=
  bluesYes <- which(outTable[,2] >= 3 & outTable[,2] < 4)
  namel <- colnames(outTable)
  tstyles <- tableStyles(outTable, useRowNames = F, header = namel)
  tstyles$cell[bluesYes,2] <- "highlight"
@
<>=
  odfTable(outTable, styles = tstyles, useRowNames = F, colnames = namel)
@

My code runs and does not throw an error, but the resulting table does not
have the rows I asked for highlighted. If I check the tableStyles object the
values of $cell are properly set as I want. What are valid values that
tableStyles$cell can be set to? Does this have to be a custom style defined
in the ODT file beforehand?

Thanks in advance,


Colin Robertson

PhD Candidate
Dept of Geography
University of Victoria

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] odfweave table styles

2009-11-04 Thread Colin Robertson
Thanks! The formattingOut.odt document had exactly what I needed. The style
"highlight" wasnt defined in my environment.

Cheers,

Colin


On Wed, Nov 4, 2009 at 4:59 AM, Max Kuhn  wrote:

> It's hard to say without a reproducible example or the output form
> sessionInfo().
>
> Before doing that though, did you read the 31 page document
> "formattingOut.odt" (or the corresponding pre-odfWeave document) in
> the examples folder of the package?
>
> Max
>
> On Tue, Nov 3, 2009 at 8:14 PM, Colin Robertson 
> wrote:
> > Hello List,
> >
> > Does anyone have examples of custom formatting of tables in odfweave? I
> know
> > there is an example of this in the formatting.odt file that comes with
> the
> > package, but running that through odfweave gives the following error:
> >
> > Error:  chunk 13 (label=showTableStyles)
> > Error in names(x) <- value :
> >  'names' attribute [1] must be the same length as the vector [0]
> >
> > What I am really trying to do is replicate this part which highlights one
> > row
> >
> > <>=
> > bigState <- which.max(tableData[, "Area"])
> > tableStyles$text[bigState,] <- "ArialHighlight"
> > tableStyles$cell[bigState,] <- "highlight"
> > tableStyles$text
> > @
> >
> > In my code I do:
> >
> > <>=
> >  bluesYes <- which(outTable[,2] >= 3 & outTable[,2] < 4)
> >  namel <- colnames(outTable)
> >  tstyles <- tableStyles(outTable, useRowNames = F, header = namel)
> >  tstyles$cell[bluesYes,2] <- "highlight"
> > @
> > <>=
> >  odfTable(outTable, styles = tstyles, useRowNames = F, colnames = namel)
> > @
> >
> > My code runs and does not throw an error, but the resulting table does
> not
> > have the rows I asked for highlighted. If I check the tableStyles object
> the
> > values of $cell are properly set as I want. What are valid values that
> > tableStyles$cell can be set to? Does this have to be a custom style
> defined
> > in the ODT file beforehand?
> >
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] using rcorr.cens for Goodman Kruskal gamma

2007-12-19 Thread Colin Robertson
Dear List,

 

I would like to calculate the Goodman-Kruskal gamma for the predicted
classes obtained from an ordinal regression model using lrm in the Design
package. I couldn't find a way to get gamma for predicted values in Design
so have found previous positings suggesting to use :

 

Rcorr.cens(x, S outx = TRUE)  in the Hmisc package

 

My question is, will this work for predicted vs observed factors?  I.e. x =
predicted class and S = observed class? Or is there a better way to obtain
this? I used the maximum individual probability for each observation to
determine the predicted class. 

 

Any help appreciated, 

 

Thanks

 

Colin

 

 

 

Colin Robertson

Dept of Geography

University of Victoria

 

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] AUC values from LRM and ROCR

2008-01-04 Thread Colin Robertson
Dear List,

 

I am trying to assess the prediction accuracy of an ordinal model fit with
LRM in the Design package. I used predict.lrm to predict on an independent
dataset and am now attempting to assess the accuracy of these predictions.
>From what I have read, the AUC is good for this because it is threshold
independent. I obtained the AUC for the fit model output from the c score (c
= 0.78). For the predicted values and independent data, for each level of
the response I used the ROCR functions to get the AUC (i.e., probability y
>= class1, y >= class2, y >= class3 etc) and plotted the ROC curves for
each. The AUC values are all higher (AUC = 0.80 - 0.93) for the predicted
values than what I got from the fit model in lrm. 

 

I am not sure whether I have misinterpreted the use of the AUC for ordinal
models or whether the prediction results are actually better than the model
results.

 

Any help / clarification appreciated,

 

Colin

 

Colin Robertson

University of Victoria

 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.