0

I want to output the lower tri in a matrix and format it to latex for a pretty output.

I have tried:

stargazer(overlap_stats1$overlap_prop$iso95[upper.tri(overlap_stats1$overlap_prop$iso95)])

but the result is only one line of output.

user3655531
  • 145
  • 1
  • 10
  • Is your model in the list described in `?"stargazer models"` ? – scoa Oct 19 '15 at 07:12
  • no. It is a adehabitat overlap iso95 matrix generated according to this: http://tlocoh.r-forge.r-project.org/tips/isopleth_overlap_auto.html – user3655531 Oct 19 '15 at 07:16
  • then stargazer doesn't know how to format it properly. You should try to use another package like `xtable` or `pander` – scoa Oct 19 '15 at 07:19
  • I tried pander and that worked fine but i wanted the latex strength of Stargazer – user3655531 Oct 19 '15 at 07:21
  • xtable seems to be a good alternative i see. But. I get too many digits in my output. I tried to use the digits = 2 but that was ignored by xtable. Maybe i should reduce the number of digits in my data before using xtable or the likes?? – user3655531 Oct 19 '15 at 07:29
  • you could use `round()` to format digits beforehand. It's hard to help more without a look at the data – scoa Oct 19 '15 at 07:32
  • round or signif worked to some degree when applying to the data before using xtable, but in cases with e.g 0.50 the last 0 is ignored. But some progress :-) – user3655531 Oct 19 '15 at 07:46

1 Answers1

0

using a combination of signif and formatC like this a1$overlap_prop$iso95 <- formatC(signif(a1$overlap_prop$iso95, digits = 2), 2, format = "f") and adding empty spaces in the upper tri inkluding the diagonal made the stargazer output look very nice :-)

Thanks for your help :-)

user3655531
  • 145
  • 1
  • 10