[R] xtable with dupplicate rownames

2007-03-10 Thread Anirudh V. S. Ruhil
I have  a table (tab5; see below) with the first block showing the counts 
in a cross-tabulation, and the lower block reflecting the proportions of 
interest.

 tab5
 None Low Level Moderate Intense Very Intense Total
None 0.00  3.00 0.000.00 1.00 4
Low Level1.00  2.00 0.000.00 0.00 3
Moderate 2.00  3.00 2.000.00 0.00 7
Intense  3.00  1.00 1.001.00 0.00 6
Very Intense 0.00  1.00 2.000.00 0.00 3
Total6.00 10.00 5.001.00 1.0023
None 0.00  0.75 0.000.00 0.25 1
Low Level0.33  0.67 0.000.00 0.00 1
Moderate 0.29  0.43 0.290.00 0.00 1
Intense  0.50  0.17 0.170.17 0.00 1
Very Intense 0.00  0.33 0.670.00 0.00 1

When I execute
foo5 - xtable(format(tab5), caption = XYZ)

I get the following error message
Warning message:
some row.names duplicated: 7,8,9,10,11 -- row.names NOT used in: 
data.row.names(row.names, rowsi, i)

Is there any way to force the duplicate row-names to be retained in xtable?

Alternatively, is there a succinct way of building a cross-tabulation with 
both counts and proportions in each cell, and then using xtable?

thanks for any and all tips

Ani

Anirudh V. S. Ruhil, Ph.D.
Sr. Research Associate
Voinovich Center for Leadership and Public Affairs
Ohio University
Building 21, The Ridges
Athens, OH 45701-2979
Tel: 740.597.1949 | Fax: 740.597.3057

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] xtable with dupplicate rownames

2007-03-10 Thread Anirudh V. S. Ruhil
I patched a solution together; essentially by using cbind to stack the 
proportions as columns. Duplicate columns names appear to pose no problems 
for xtable but duplicate rownames do!



--On Saturday, March 10, 2007 1:11 PM -0500 Anirudh V. S. Ruhil 
[EMAIL PROTECTED] wrote:

: I have  a table (tab5; see below) with the first block showing the counts
: in a cross-tabulation, and the lower block reflecting the proportions of
: interest.
:
: tab5
:  None Low Level Moderate Intense Very Intense Total
: None 0.00  3.00 0.000.00 1.00 4
: Low Level1.00  2.00 0.000.00 0.00 3
: Moderate 2.00  3.00 2.000.00 0.00 7
: Intense  3.00  1.00 1.001.00 0.00 6
: Very Intense 0.00  1.00 2.000.00 0.00 3
: Total6.00 10.00 5.001.00 1.0023
: None 0.00  0.75 0.000.00 0.25 1
: Low Level0.33  0.67 0.000.00 0.00 1
: Moderate 0.29  0.43 0.290.00 0.00 1
: Intense  0.50  0.17 0.170.17 0.00 1
: Very Intense 0.00  0.33 0.670.00 0.00 1
:
: When I execute
:   foo5 - xtable(format(tab5), caption = XYZ)
:
: I get the following error message
:   Warning message:
:   some row.names duplicated: 7,8,9,10,11 -- row.names NOT used in:
:   data.row.names(row.names, rowsi, i)
:
: Is there any way to force the duplicate row-names to be retained in
: xtable?
:
: Alternatively, is there a succinct way of building a cross-tabulation
: with  both counts and proportions in each cell, and then using xtable?
:
: thanks for any and all tips
:
: Ani
:
: Anirudh V. S. Ruhil, Ph.D.
: Sr. Research Associate
: Voinovich Center for Leadership and Public Affairs
: Ohio University
: Building 21, The Ridges
: Athens, OH 45701-2979
: Tel: 740.597.1949 | Fax: 740.597.3057
:
: __
: 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 and provide commented,
: minimal, self-contained, reproducible code.



Anirudh V. S. Ruhil, Ph.D.
Sr. Research Associate
Voinovich Center for Leadership and Public Affairs
Ohio University
Building 21, The Ridges
Athens, OH 45701-2979
Tel: 740.597.1949 | Fax: 740.597.3057

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Drawing sub-samples

2007-03-08 Thread Anirudh V. S. Ruhil
Folks,

I have a dataframe (snippet shown below).

  demo.df[1:10, 1:6]
dirn   county year exp  exp.waver3
1  43901 Cuyahoga 20060 0 56
2  49098 Pickaway 20060 0 77
3  44164  Portage 20060 0 85
4  44610Wayne 20061 1 76
5  45120Wayne 20060 0 82
6  49593   Scioto 20061 1 89
7  46516 Crawford 20060 0 75
8  50054   Summit 20060 0 92
9  48231Lucas 20060 0 79
10 49908Stark 20060 0 90

If I need to draw all possible samples of size n (where n = 30, n = 50, and 
so on), and run a particular linear model on each subsample of a specific 
size, then tabulate coeffs on specific covariates for subsequent 
manipulation/graphical representation, what would be the best means of 
doing so?

sample.1 - sample(demo.df, 30, replace = FALSE)

doesn't work; it just gives me the entire population in demo.df. What am I 
missing?

thanks in advance

Ani

Anirudh V. S. Ruhil, Ph.D.
Sr. Research Associate
Voinovich Center for Leadership and Public Affairs
Ohio University
Building 21, The Ridges
Athens, OH 45701-2979
Tel: 740.597.1949 | Fax: 740.597.3057

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Calculating distance given coordinates

2006-12-07 Thread Anirudh V. S. Ruhil
Given the following data (see below) on nest locations (fid.albers = 149, 
148, etc.), I need to (a) calculate the distance between all fid pairs, and 
(b) flag all nests within an user-specified radius. What syntax will 
accomplish both tasks? If it helps, I have the nest locations as eastings 
and northings as well but thought better of estimating distance by 
calculating the root of the hypotenuse between all nest pairs.

 x.albers y.albers fid.albers
[1,]   723557   671748149
[2,]   723384   671867148
[3,]   723375   671757147
[4,]   723363   671824146

best

Ani

Anirudh V. S. Ruhil, Ph.D.
Sr. Research Associate
Voinovich Center for Leadership and Public Affairs
Ohio University
Building 21, The Ridges
Athens, OH 45701-2979
Tel: 740.597.1949 | Fax: 740.597.3057

__
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
and provide commented, minimal, self-contained, reproducible code.