Re: [R] Tables from Rmarkdown to Word Document - using huxtables

2019-12-12 Thread Ashim Kapoor
Dear Rui, No problem and Many thanks. Best Regards, Ashim On Fri, Dec 13, 2019 at 12:09 AM Rui Barradas wrote: > Hello, > > You're right, none of the two seems to be working. > > set_width gives me tables of the same width no matter what value I pass > as argument. > > And set_caption is

Re: [R] Tables from Rmarkdown to Word Document - using huxtables

2019-12-12 Thread Rui Barradas
Hello, You're right, none of the two seems to be working. set_width gives me tables of the same width no matter what value I pass as argument. And set_caption is asking for a flextable object, doesn't work with huxtable. I don't know how to solve it right now, I will try later. Rui

Re: [R] Tables from Rmarkdown to Word Document - using huxtables

2019-12-12 Thread Ashim Kapoor
Hello once again, for me,set_caption is not working as well. Here is my Rmd file :- --- title: Testing Huxtables author: Ashim Kapoor output: word_document --- ```{r} library(dplyr) library(huxtable) hx <- iris %>% group_by(Species) %>% summarise_if(is.numeric, mean) %>% as_hux() %>%

Re: [R] Tables from Rmarkdown to Word Document - using huxtables

2019-12-11 Thread Ashim Kapoor
On Wed, Dec 11, 2019 at 9:11 PM Rui Barradas wrote: > Hello, > > This works for me: > > > library(dplyr) > library(huxtable) > library(flextable) > library(officer) > > hx <- iris %>% >group_by(Species) %>% >summarise_if(is.numeric, mean) %>% >as_hux() %>% >add_colnames() %>% >

Re: [R] Tables from Rmarkdown to Word Document - using huxtables

2019-12-11 Thread Rui Barradas
Hello, This works for me: library(dplyr) library(huxtable) library(flextable) library(officer) hx <- iris %>% group_by(Species) %>% summarise_if(is.numeric, mean) %>% as_hux() %>% add_colnames() %>% set_bold(1, , TRUE) %>% set_bottom_border(1, , 1) %>% set_width(0.99) %>%

[R] Tables from Rmarkdown to Word Document - using huxtables

2019-12-11 Thread Ashim Kapoor
Dear All, I am reading this :- https://hughjonesd.github.io/huxtable/huxtable.html I quote from the above: If you want to create Word or Powerpoint documents, install the flextable package from CRAN. Huxtables can then be automatically printed in

Re: [R] Tables in Rmarkdown Word

2018-06-13 Thread Jeff Newmiller
I have heard of people using CSS formatting with Rmarkdown output and copy-pasting into Word/LibreOffice, but LaTeX is so much nicer if you don't require Word that I suppose there haven't been many with that itch. To some extent you can use a manually-styled Word starting document (referred to

Re: [R] Tables in Rmarkdown Word

2018-06-13 Thread Duncan Murdoch
On 13/06/2018 10:10 AM, Bert Gunter wrote: You should post this on the r-package-devel list, not here. That list is exactly concerned with such issues. This list is about R programming itself. No, r-package-devel is about developing and publishing R packages, not using them. I don't know

Re: [R] Tables in Rmarkdown Word

2018-06-13 Thread Bert Gunter
You should post this on the r-package-devel list, not here. That list is exactly concerned with such issues. This list is about R programming itself. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka

[R] Tables in Rmarkdown Word

2018-06-13 Thread Shakeel Suleman
I am relatively new to R and was wondering if someone could advise me on presenting tables in R Markdown for Word. I would like to present a simple table of counts, with column 1 representing name of an organisation (and last row called "All organisations") and another four columns representing

Re: [R] Tables, knitr markdown

2016-02-22 Thread Duncan Murdoch
On 22/02/2016 6:19 PM, Santosh wrote: Sorry.. I forgot to mention that I wanted it be published in MS Word, because it goes into a Report this is prepared using MS Word. I can't help you with that. Hence,the above effort.. yes, it's a lot easier to send it to Latex.. I was also wondering

Re: [R] Tables, knitr markdown

2016-02-22 Thread Gergely Daróczi
On Mon, Feb 22, 2016 at 3:36 PM, Santosh wrote: > Thanks, Gergely.. I wonder if it allows to insert lines etc as sent in > previous email which might need some additional preprocessing.. AFAIK that's not possible, as pandoc's markdown has no markup to add

Re: [R] Tables, knitr markdown

2016-02-22 Thread Santosh
Thanks, Gergely.. I wonder if it allows to insert lines etc as sent in previous email which might need some additional preprocessing.. Best, Santosh On Mon, Feb 22, 2016 at 3:27 PM, Gergely Daróczi wrote: > On Mon, Feb 22, 2016 at 1:55 PM, Duncan Murdoch >

Re: [R] Tables, knitr markdown

2016-02-22 Thread Gergely Daróczi
On Mon, Feb 22, 2016 at 1:55 PM, Duncan Murdoch wrote: > > On 22/02/2016 3:46 PM, Santosh wrote: >> >> Just figured out.. >> >> as.data.frame(as.matrix(),stringsAsFactors=F) >> >> could work! :) > > > Why do you want to produce Markdown output? the tables package

Re: [R] Tables, knitr markdown

2016-02-22 Thread Santosh
Sorry.. I forgot to mention that I wanted it be published in MS Word, because it goes into a Report this is prepared using MS Word. Hence,the above effort.. yes, it's a lot easier to send it to Latex.. I was also wondering if it is possible to add "\hline" separating the categories in a table..

Re: [R] Tables, knitr markdown

2016-02-22 Thread Duncan Murdoch
On 22/02/2016 3:46 PM, Santosh wrote: Just figured out.. as.data.frame(as.matrix(),stringsAsFactors=F) could work! :) Why do you want to produce Markdown output? the tables package (lowercase t!) can produce output in either LaTeX or HTML. Just tell knitr to leave the output alone, e.g.

Re: [R] Tables, knitr markdown

2016-02-22 Thread Santosh
Just figured out.. as.data.frame(as.matrix(),stringsAsFactors=F) could work! :) On Mon, Feb 22, 2016 at 12:17 PM, Santosh wrote: > Dear Rxperts.. > I am able to generate tables using Tables R package.. > However, when I have been unsuccessful in using kable (from knitr

[R] Tables, knitr markdown

2016-02-22 Thread Santosh
Dear Rxperts.. I am able to generate tables using Tables R package.. However, when I have been unsuccessful in using kable (from knitr package) to generate the table in R markdown script.. It's because the output generated by "tabular" in Tables package is of class "tabular". The kable function

Re: [R] tables package: localization of All subtotals label

2015-05-15 Thread Duncan Murdoch
On 15/05/2015 10:38 AM, Patricio Cuarón wrote: Hello. I'd like to know how could I localize (or otherwise change the string) of the All subtotal that appears when using something like library(tables) data(iris) tabular((Species + 1) ~ (n=1) + Format(digits=2)* + (Sepal.Length +

[R] tables package: localization of All subtotals label

2015-05-15 Thread Patricio Cuarón
Hello. I'd like to know how could I localize (or otherwise change the string) of the All subtotal that appears when using something like library(tables) data(iris) tabular((Species + 1) ~ (n=1) + Format(digits=2)* + (Sepal.Length + Sepal.Width)*(mean + sd), data=iris) (that's the first example

Re: [R] tables package: localization of All subtotals label

2015-05-15 Thread Duncan Murdoch
On 15/05/2015 10:38 AM, Patricio Cuarón wrote: Hello. I'd like to know how could I localize (or otherwise change the string) of the All subtotal that appears when using something like I just took a look at the source of the package. Currently there is no way to use the R internationalization

Re: [R] tables package and alternative to col percent

2014-01-16 Thread Daniel Cher
: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Monday, January 13, 2014 2:13 AM To: Daniel Cher; r-help@r-project.org Subject: Re: [R] tables package and alternative to col percent On 14-01-13 12:02 AM, Daniel Cher wrote: Library tables and tabular function is neato. I'm trying to figure

Re: [R] tables package and alternative to col percent

2014-01-13 Thread Duncan Murdoch
On 14-01-13 12:02 AM, Daniel Cher wrote: Library tables and tabular function is neato. I'm trying to figure out how to get percents other than just row and columns. I'd like a percent of a factor. That's a recent addition, still only on R-forge. library(tables) c=data.frame(

[R] tables package and alternative to col percent

2014-01-12 Thread Daniel Cher
Library tables and tabular function is neato. I'm trying to figure out how to get percents other than just row and columns. I'd like a percent of a factor. library(tables) c=data.frame( gender=c(1,1,1,1,2,2,2,2), race=c(3,3,4,4,4,4,4,4) ) tabular(

[R] Tables Package Ampersand Quoting

2013-11-10 Thread Jeff Newmiller
There seems to be some inappropriate quoting in the tabular function from the tables package. Consider this example: library(tables) sampledf - data.frame( Manufacturer=c(rep(Joe Co.,6) ,rep(\\tabular, Inc.,4)) ,

Re: [R] Tables Package Ampersand Quoting

2013-11-10 Thread Duncan Murdoch
On 13-11-10 1:16 PM, Jeff Newmiller wrote: There seems to be some inappropriate quoting in the tabular function from the tables package. Consider this example: library(tables) sampledf - data.frame( Manufacturer=c(rep(Joe Co.,6) ,rep(\\tabular,

Re: [R] Tables Package Ampersand Quoting

2013-11-10 Thread Duncan Murdoch
On 13-11-10 1:16 PM, Jeff Newmiller wrote: There seems to be some inappropriate quoting in the tabular function from the tables package. Consider this example: This turned out to be different than I thought at first. It was simply that I mis-used the latexTranslate function from the Hmisc

[R] Tables Package Grouping Factors

2013-11-09 Thread Jeff Newmiller
Visually, the elimination of duplicates in hierarchical tables in the tabular function from the tables package is very nice. I would like to do the same thing with non-crossed factors, but am perhaps missing some conceptual element of how this package is used. The following code illustrates my

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Duncan Murdoch
On 13-11-09 1:23 PM, Jeff Newmiller wrote: Visually, the elimination of duplicates in hierarchical tables in the tabular function from the tables package is very nice. I would like to do the same thing with non-crossed factors, but am perhaps missing some conceptual element of how this package

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Duncan Murdoch
On 13-11-09 1:23 PM, Jeff Newmiller wrote: Visually, the elimination of duplicates in hierarchical tables in the tabular function from the tables package is very nice. I would like to do the same thing with non-crossed factors, but am perhaps missing some conceptual element of how this package

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Jeff Newmiller
The problem that prompted this question involved manufacturers and their model numbers, so I think the cross everything and throw away most of it will get out of hand quickly. The number of models per manufacturer definitely varies. I think I will work on the print segments of the table

Re: [R] Tables Package Grouping Factors

2013-11-09 Thread Duncan Murdoch
On 13-11-09 5:56 PM, Jeff Newmiller wrote: The problem that prompted this question involved manufacturers and their model numbers, so I think the cross everything and throw away most of it will get out of hand quickly. The number of models per manufacturer definitely varies. I think I will

[R] tables with row sorted numerically although factors

2013-10-08 Thread Renger van Nieuwkoop
Hi I am using the package tables and want to have the rows in the numerical order and not in the alphabetical order: library(tables) Nodes - c(1,10,20,2) Values- c(1,2,3,4) Data - data.frame(cbind(Nodes,Values)) data$Nodes- as.factor(as.character(data$Nodes)) # necessary to get

Re: [R] tables with row sorted numerically although factors

2013-10-08 Thread Rui Barradas
Hello, First of all, there's no need for data.frame(cbind(...)). data.frame() only will do the job, and it's less error prone. As for the question, since the column Nodes is to become a factor, why use as.character()? Without it the problem is solved: data - data.frame(Nodes,Values)

Re: [R] tables with row sorted numerically although factors

2013-10-08 Thread David Winsemius
On Oct 8, 2013, at 10:29 AM, Renger van Nieuwkoop wrote: Hi I am using the package tables and want to have the rows in the numerical order and not in the alphabetical order: library(tables) Nodes - c(1,10,20,2) Values- c(1,2,3,4) Data - data.frame(cbind(Nodes,Values))

Re: [R] tables with row sorted numerically although factors

2013-10-08 Thread Greg Snow
The order in the table is the order of the levels in the factor, so the best thing to do is to set the order in the factor itself. You can do this using the factor function when you create the factor, or with a function like relevel after the function has been created. In your case, what happens

Re: [R] Tables package - remove NAs and NaN

2013-04-25 Thread Liviu Andronic
On Wed, Apr 24, 2013 at 9:23 PM, Santosh santosh2...@gmail.com wrote: Dear Rxperts, Sorry if I am posting a really really dumb request.. I am new to subversion and am trying to use subversion to download the tables package as suggested by Duncan. I installed subversion client(from collabnet)

[R] tables: proper use of Hline() in tabular()

2013-04-25 Thread Liviu Andronic
Dear all, I am unable to understand how Hline() works in tabular(). I've read the vignette and the help page, and here this example compiles perfectly fine: latex( tabular( Species + Hline() + 1 ~ Heading()*mean*All(iris), data=iris) ) However, if I try it on my own data it fails.

Re: [R] Tables package - remove NAs and NaN

2013-04-24 Thread Santosh
Dear Rxperts, Sorry if I am posting a really really dumb request.. I am new to subversion and am trying to use subversion to download the tables package as suggested by Duncan. I installed subversion client(from collabnet) and tried to access tables package using the command below. svn checkout

Re: [R] Tables package - remove NAs and NaN

2013-04-24 Thread Duncan Murdoch
On 13-04-24 3:23 PM, Santosh wrote: Dear Rxperts, Sorry if I am posting a really really dumb request.. I am new to subversion and am trying to use subversion to download the tables package as suggested by Duncan. I installed subversion client(from collabnet) and tried to access tables package

Re: [R] Tables package - remove NAs and NaN

2013-04-24 Thread Santosh
yes, With Duncan's and Liviu's help, I was able to remove those NAs and NaNs from the tabular summary. svn .. thing has not worked for me yet.. would try this later.. Thanks so much! Regards, Santosh On Wed, Apr 24, 2013 at 1:46 PM, Santosh santosh2...@gmail.com wrote: Thanks so much.. I

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Liviu Andronic
Dear David, I'm having the exact same issue as Santosh, and looking at the fix that you've provided it seems to me that results are slightly different. On Tue, Apr 23, 2013 at 4:40 AM, David Winsemius dwinsem...@comcast.net wrote: b c p a N mean sdmean sd A

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread David Winsemius
On Apr 23, 2013, at 12:53 AM, Liviu Andronic wrote: Dear David, I'm having the exact same issue as Santosh, and looking at the fix that you've provided it seems to me that results are slightly different. Reverse the order of arguemtns to `interaction`: tabular( (`p a`=interaction(a,p,

Re: [R] tables package - error message of duplicate values

2013-04-23 Thread Liviu Andronic
Dear David, I'm once again facing the same issue as Santosh. On Sat, Apr 20, 2013 at 12:15 AM, David Winsemius dwinsem...@comcast.net wrote: On Apr 19, 2013, at 2:03 PM, Santosh wrote: Rounding was done to replicate the problem I faced in the original data set... I got an error every

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread David Winsemius
On Apr 23, 2013, at 1:00 AM, David Winsemius wrote: On Apr 23, 2013, at 12:53 AM, Liviu Andronic wrote: Dear David, I'm having the exact same issue as Santosh, and looking at the fix that you've provided it seems to me that results are slightly different. Reverse the order of

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Liviu Andronic
On Tue, Apr 23, 2013 at 10:06 AM, David Winsemius dwinsem...@comcast.net wrote: On Apr 23, 2013, at 1:00 AM, David Winsemius wrote: On Apr 23, 2013, at 12:53 AM, Liviu Andronic wrote: Dear David, I'm having the exact same issue as Santosh, and looking at the fix that you've provided it

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Liviu Andronic
Dear David, On Tue, Apr 23, 2013 at 10:00 AM, David Winsemius dwinsem...@comcast.net wrote: tabular( (`p a`=interaction(a,p, drop=TRUE, sep= )) ~ (N = 1) + (b + c)* (mean+sd),data=q) b c p a N mean sd mean sd 1 A 10 12.8 0.7888 52.1 8.020 3 A 10

Re: [R] tables package - error message of duplicate values

2013-04-23 Thread Duncan Murdoch
On 13-04-23 4:05 AM, Liviu Andronic wrote: Dear David, I'm once again facing the same issue as Santosh. On Sat, Apr 20, 2013 at 12:15 AM, David Winsemius dwinsem...@comcast.net wrote: On Apr 19, 2013, at 2:03 PM, Santosh wrote: Rounding was done to replicate the problem I faced in the

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Duncan Murdoch
On 13-04-22 10:40 PM, David Winsemius wrote: On Apr 22, 2013, at 5:49 PM, Santosh wrote: Dear Rxperts, q - data.frame(p=rep(c(A,B),each=10,len=30), a=rep(c(1,2,3),each=10),id=seq(30), b=round(runif(30,10,20)), c=round(runif(30,40,70))) The operation below...

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Liviu Andronic
Dear Duncan, Thank you for your explanations. On Tue, Apr 23, 2013 at 12:31 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: This isn't something that the package is designed to handle: if you say p*a, it wants all combinations of p and a. To your knowledge is there another 'complex tables'

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Duncan Murdoch
On 13-04-23 6:31 AM, Duncan Murdoch wrote: On 13-04-22 10:40 PM, David Winsemius wrote: On Apr 22, 2013, at 5:49 PM, Santosh wrote: Dear Rxperts, q - data.frame(p=rep(c(A,B),each=10,len=30), a=rep(c(1,2,3),each=10),id=seq(30), b=round(runif(30,10,20)), c=round(runif(30,40,70))) The operation

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Duncan Murdoch
On 13-04-23 8:07 AM, Liviu Andronic wrote: Dear Duncan, Thank you for your explanations. On Tue, Apr 23, 2013 at 12:31 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: This isn't something that the package is designed to handle: if you say p*a, it wants all combinations of p and a. To

Re: [R] Tables package - remove NAs and NaN

2013-04-23 Thread Liviu Andronic
Dear Duncan, On Tue, Apr 23, 2013 at 2:13 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: I've done this now, in version 0.7.54 on R-forge. To leave out the rows with N=0, you can select a subset of the table where N (the first column) is non-zero: tab -

[R] Tables package - remove NAs and NaN

2013-04-22 Thread Santosh
Dear Rxperts, q - data.frame(p=rep(c(A,B),each=10,len=30), a=rep(c(1,2,3),each=10),id=seq(30), b=round(runif(30,10,20)), c=round(runif(30,40,70))) The operation below... tabular(((p=factor(p))*(a=factor(a))+1) ~ (N = 1) + (b + c)* (mean+sd),data=q) yields some rows of NAs and NaN as shown below

Re: [R] Tables package - remove NAs and NaN

2013-04-22 Thread David Winsemius
On Apr 22, 2013, at 5:49 PM, Santosh wrote: Dear Rxperts, q - data.frame(p=rep(c(A,B),each=10,len=30), a=rep(c(1,2,3),each=10),id=seq(30), b=round(runif(30,10,20)), c=round(runif(30,40,70))) The operation below... tabular(((p=factor(p))*(a=factor(a))+1) ~ (N = 1) + (b + c)*

[R] tables package - error message of duplicate values

2013-04-19 Thread Santosh
Dear expeRts! when I try summarize data using tabular of tables package.. here is an example.. a - data.frame(a=rep(10,10),b=round(runif(10,10,20)),c=round(runif(10,40,50))) a a b c 1 10 14 44 2 10 17 40 3 10 13 40 4 10 18 40 5 10 11 49 6 10 16 46 7 10 15 43 8 10 19 49 9 10 19 49

Re: [R] tables package - error message of duplicate values

2013-04-19 Thread John Kane
Are you sure that it is not just telling you that it cannot tabulate on a since it only has one value? John Kane Kingston ON Canada -Original Message- From: santosh2...@gmail.com Sent: Fri, 19 Apr 2013 13:29:05 -0700 To: r-help@r-project.org Subject: [R] tables package - error

Re: [R] tables package - error message of duplicate values

2013-04-19 Thread David Winsemius
On Apr 19, 2013, at 1:29 PM, Santosh wrote: Dear expeRts! when I try summarize data using tabular of tables package.. here is an example.. a - data.frame(a=rep(10,10),b=round(runif(10,10,20)),c=round(runif(10,40,50))) a a b c 1 10 14 44 2 10 17 40 3 10 13 40 4 10 18 40 5

Re: [R] tables package - error message of duplicate values

2013-04-19 Thread Santosh
Rounding was done to replicate the problem I faced in the original data set... 2 independent identifiers in a group (shown only for 1 of 7 groups) may have same value of b or c. On Fri, Apr 19, 2013 at 1:53 PM, David Winsemius dwinsem...@comcast.netwrote: On Apr 19, 2013, at 1:29 PM, Santosh

Re: [R] tables package - error message of duplicate values

2013-04-19 Thread David Winsemius
On Apr 19, 2013, at 2:03 PM, Santosh wrote: Rounding was done to replicate the problem I faced in the original data set... I got an error every time I tried to use digits=0. My basic rule is that if a parameter choice consistently errors out ... stop using it. I'm fundamentally a pragmatist.

Re: [R] tables package - error message of duplicate values

2013-04-19 Thread Santosh
Dear Rxperts! Thanks for the suggestions...(esp. Dr. Mathemedician)! :) I add one more factor level (a level higher to a) in the example.. a - data.frame(p=rep(c(A,B),each=10,len=30), a=rep(c(1,2,3),each=10),id=seq(30), b=round(runif(30,10,20)), c=round(runif(30,40,70)))

[R] tables package: How to remove column headings and alignment issues

2013-01-18 Thread Marius Hofert
Dear expeRts, Here is a minimal example with the latest version of 'tables' (questions below): require(tables) saveopts - table_options(toprule=\\toprule, midrule=\\midrule, bottomrule=\\bottomrule, titlerule=\\cmidrule(lr), rowlabeljustification=r)#,

Re: [R] Tables extraction in R ?

2012-07-08 Thread Jim Lemon
On 07/07/2012 03:23 AM, Greeknovice wrote: Hi, I 'm a novice user of R statistics and my hands-on experience with it is minimal. I want to create a table for my MBA course assignment that looks like the ones that SPSS and MS Excel produces ,the data that the table has to include are the

Re: [R] Tables extraction in R ?

2012-07-08 Thread Greeknovice
I would like to thank all of you for spending your precious time in ordrer to help me out. I really appreciate the fact that experienced R users replied to my newbie post. Regards, Spiros Gkolfinopoulos -- View this message in context:

Re: [R] Tables extraction in R ?

2012-07-07 Thread David L Carlson
To: Greeknovice; r-help@r-project.org Subject: Re: [R] Tables extraction in R ? Have a look at the xtables package. I have not used it in some time but I think it may do what you want. A google search R statistics xtables should bring up some useful information on this. John Kane Kingston

[R] Tables extraction in R ?

2012-07-06 Thread Greeknovice
Hi, I 'm a novice user of R statistics and my hands-on experience with it is minimal. I want to create a table for my MBA course assignment that looks like the ones that SPSS and MS Excel produces ,the data that the table has to include are the following : table(agec) agec 1 2 3 749 160

Re: [R] Tables extraction in R ?

2012-07-06 Thread John Kane
2012 10:23:13 -0700 (PDT) To: r-help@r-project.org Subject: [R] Tables extraction in R ? Hi, I 'm a novice user of R statistics and my hands-on experience with it is minimal. I want to create a table for my MBA course assignment that looks like the ones that SPSS and MS Excel produces

Re: [R] Tables and merge

2011-07-05 Thread Silvano
- Original Message - From: Silvano silv...@uel.br To: r-help@r-project.org Sent: Thursday, June 30, 2011 9:07 AM Subject: Tables and merge Hi, I have 21 files which is common variable CODE. Each file refers to a question. I would like to join the 21 files into one, to construct

Re: [R] Tables and merge

2011-07-05 Thread David Winsemius
On Jul 6, 2011, at 7:36 AM, Silvano wrote: - Original Message - From: Silvano silv...@uel.br To: r-help@r-project.org Sent: Thursday, June 30, 2011 9:07 AM Subject: Tables and merge I have 21 files which is common variable CODE. Each file refers to a question. I would like to join

Re: [R] Tables and merge

2011-07-05 Thread Jeff Newmiller
Merge can only handle two tables at a time. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#.

[R] Tables and merge

2011-07-05 Thread Walmes Zeviani
Silvano, I have some examples using merge() from my class notes in http://www.leg.ufpr.br/doku.php/disciplinas:ce223-2011-01. See aula11.R. For the moment, this minimal reproducible code can be useful id - 1:30 n - 20 a1 - data.frame(id=sample(id, n), v1=rnorm(n)) a2 - data.frame(id=sample(id,

[R] Adding dash-lines in R tables

2011-05-22 Thread Axel Urbiz
is it possible to add dash lines to tables or matrices when they are printed? An example of what I'm looking for is this: library(Design) y - sample(c(0,1),100, replace = TRUE) x - rnorm(100) summary(y ~ x) Thanks, Axel. [[alternative HTML version deleted]]

Re: [R] Adding dash-lines in R tables

2011-05-22 Thread David Winsemius
On May 22, 2011, at 7:47 AM, Axel Urbiz wrote: is it possible to add dash lines to tables or matrices when they are printed? An example of what I'm looking for is this: library(Design) y - sample(c(0,1),100, replace = TRUE) x - rnorm(100) summary(y ~ x) There is a method for summary on

Re: [R] Adding dash-lines in R tables

2011-05-22 Thread Ista Zahn
Axel, you may also be interested in the ascii function (in the ascii package). The ascii version of David's example is library(ascii) #may need install.packages(ascii) first ascii(M) ascii(table(sample(1:10, 100, replace=TRUE))) Best, Ista On Sun, May 22, 2011 at 9:52 AM, David Winsemius

Re: [R] Adding dash-lines in R tables

2011-05-22 Thread David Hajage
moreover: library(ascii) M - matrix(letters[1:10], 2) M [,1] [,2] [,3] [,4] [,5] [1,] a c e g i [2,] b d f h j ascii(M) | | a | c | e | g | i | b | d | f | h | j | print(ascii(M), rest) +---+---+---+---+---+ | a | c | e | g | i |

Re: [R] Adding dash-lines in R tables

2011-05-22 Thread David Winsemius
On May 22, 2011, at 2:22 PM, David Hajage wrote: moreover: library(ascii) Seems strange that the ascii.interger function doesn't set the digits argument to 0: ascii(as.integer(c(3,4,5))) |= | 3.00 | 4.00 | 5.00 |= ascii(as.integer(c(3,4,5)),

Re: [R] Adding dash-lines in R tables

2011-05-22 Thread David Winsemius
On May 22, 2011, at 2:41 PM, David Winsemius wrote: On May 22, 2011, at 2:22 PM, David Hajage wrote: moreover: library(ascii) Seems strange that the ascii.interger function doesn't set the digits argument to 0: ascii.integer ascii(as.integer(c(3,4,5))) |= |

[R] Tables in Packages

2010-08-17 Thread Daniel Murphy
I have a 100x2 matrix to go into a package. I could type it into the R code but, more generally, what is the *best* way to read a table from disk into, say, package 'foo' when it is loaded into memory via library(foo)? I thought of having .onLoad create an environment and assign a matrix read from

[R] tables

2010-06-21 Thread Erin Hodgess
Dear R People: I have generated the following table: table(zza$DEATH,zza$GENDER) F M 2009-04-21 0 1 2009-04-22 4 2 2009-04-24 6 0 2009-04-25 1 3 2009-04-26 2 0 2009-04-28 3 0 2009-04-29 2 2 However, instead of total counts in the F

Re: [R] tables

2010-06-21 Thread Phil Spector
Erin - Here's a reproducible example that should help answer your question: set.seed(17) df = data.frame(a=sample(letters[1:5],250,replace=TRUE), + b=sample(c('A','B'),250,replace=TRUE)) tt = table(df$a,df$b) 100 * prop.table(tt) # total of all percentages = 100

Re: [R] tables

2010-06-21 Thread John Kane
?prop.table probably. RSiteSearch at R Site Search http://finzi.psych.upenn.edu/nmz.html or ?RSiteSearch would probably given you the anwser in about 30 seconds. --- On Mon, 6/21/10, Erin Hodgess erinm.hodg...@gmail.com wrote: From: Erin Hodgess erinm.hodg...@gmail.com Subject: [R] tables

Re: [R] tables

2010-06-21 Thread David Winsemius
On Jun 21, 2010, at 2:46 PM, Erin Hodgess wrote: Dear R People: I have generated the following table: table(zza$DEATH,zza$GENDER) F M 2009-04-21 0 1 2009-04-22 4 2 2009-04-24 6 0 2009-04-25 1 3 2009-04-26 2 0 2009-04-28 3 0 2009-04-29 2 2

[R] Tables to export to excel

2010-01-10 Thread Orvalho Augusto
I am doing some tables with verry long and numerouses categories. Eg. Cause of Death Crossed by sex e then by group ages. Is it possible to have such crosstab sent to an excel file so I could easilly report. Thanks in advance Caveman -- OpenSource Software Consultant CENFOSS

Re: [R] Tables to export to excel

2010-01-10 Thread Erich Neuwirth
There are a few different options for exporting matrices and dataframes from R to Excel. RExcel (an Excel addin available from rcom.univie.ac.at) allows you use a menu item Get array or Get dataframe to do this. Other options are described in Chapter 8 of the R Data Import/Export manual. There

Re: [R] Tables without names

2009-06-12 Thread Duncan Murdoch
On 11/06/2009 5:35 PM, Stavros Macrakis wrote: A table without names displays like a vector: unname(table(2:3)) [1] 1 1 1 and preserves the table class (as with unname in general): dput(unname(table(2:3))) structure(c(1L, 1L), .Dim = 2L, class = table) Does that make sense?

Re: [R] Tables without names

2009-06-12 Thread Martin Maechler
DM == Duncan Murdoch murd...@stats.uwo.ca on Fri, 12 Jun 2009 06:09:14 -0400 writes: DM On 11/06/2009 5:35 PM, Stavros Macrakis wrote: A table without names displays like a vector: unname(table(2:3)) [1] 1 1 1 and preserves the table class (as with unname in

Re: [R] Tables without names

2009-06-12 Thread Stavros Macrakis
On Fri, Jun 12, 2009 at 6:09 AM, Duncan Murdoch murd...@stats.uwo.cawrote: On 11/06/2009 5:35 PM, Stavros Macrakis wrote: A table without names displays like a vector: unname(table(2:3)) [1] 1 1 1 and preserves the table class (as with unname in general):

Re: [R] Tables without names

2009-06-12 Thread Gabor Grothendieck
On Fri, Jun 12, 2009 at 10:57 AM, Stavros Macrakismacra...@alum.mit.edu wrote: On Fri, Jun 12, 2009 at 6:09 AM, Duncan Murdoch murd...@stats.uwo.cawrote: On 11/06/2009 5:35 PM, Stavros Macrakis wrote: A table without names displays like a vector:     unname(table(2:3))    [1] 1 1 1 and

[R] Tables without names

2009-06-11 Thread Stavros Macrakis
A table without names displays like a vector: unname(table(2:3)) [1] 1 1 1 and preserves the table class (as with unname in general): dput(unname(table(2:3))) structure(c(1L, 1L), .Dim = 2L, class = table) Does that make sense? R is not consistent in its treatment of such

Re: [R] Tables without names

2009-06-11 Thread David Winsemius
On Jun 11, 2009, at 5:35 PM, Stavros Macrakis wrote: A table without names displays like a vector: unname(table(2:3)) [1] 1 1 1 and preserves the table class (as with unname in general): dput(unname(table(2:3))) structure(c(1L, 1L), .Dim = 2L, class = table) Does that make sense?

[R] Tables

2009-03-26 Thread skrug
Hi, I am just starting using R. Hence, sorry for asking probably rather easy questions. I used read.table to bring an .txt Table to R. Unfortunately the columns do not have the same length. I tried fill=TRUE, to fill the blank space with na. In a certain kind of way it worked, but befor

Re: [R] Tables

2009-03-26 Thread jim holtman
How are you sure it moved the data? What is the column separator that you have? Is it just 'white space' as opposed to a tab or comma? It you have a CSV file with a separator, the system knows where the columns are. If it sees 'a b c' and then 'a c' as the next row, 'c' will be in

Re: [R] Tables in legend

2009-02-09 Thread Vemuri, Aparna
any ideas on how to do this. -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: Friday, February 06, 2009 4:52 PM To: Vemuri, Aparna Cc: r-help@r-project.org Subject: Re: [R] Tables in legend This will probably do what you need: plot(1) x - 1:10 # numbers

[R] Tables in legend

2009-02-06 Thread Vemuri, Aparna
I need to create a legend for a simple scatter plot in the following format. This is Blah1 number1 number2 This is Blah2 number3 number4 . . . This is Blah6 number11number12 I looked up these help pages and found the following solution. lStr-c(Blah1, Blah2,Blah6, number 1,

Re: [R] Tables in legend

2009-02-06 Thread jim holtman
This will probably do what you need: plot(1) x - 1:10 # numbers for the legend blah - LETTERS[1:5] legendData - character(5) for (i in 1:5) legendData[i] - sprintf(Blah-%s %d %d, blah[i], x[2*i - 1], x[2*i]) legend('topright', legend=legendData) On Fri, Feb 6, 2009 at 6:57 PM, Vemuri,

[R] Tables for journal/conference publications from within R

2009-01-13 Thread Jason Rupert
Yeah.    addtable2plot in the plotrix is really close, but, working from within R, I would really like to be able format tables in such a way that they look like they are ready for journal or conference paper publication.    Is addtable2plot in the plotrix the right tool for that or are there

Re: [R] Tables for journal/conference publications from within R

2009-01-13 Thread ONKELINX, Thierry
. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Jason Rupert Verzonden: dinsdag 13 januari 2009 15:04 Aan: r-help@r-project.org Onderwerp: [R] Tables for journal/conference publications from within R Yeah

Re: [R] Tables for journal/conference publications from within R

2009-01-13 Thread John Kane
xtable package and depending on what word processor you're using export as latex or html. Fancier approach is xtable combined with Sweave. --- On Tue, 1/13/09, Jason Rupert jasonkrup...@yahoo.com wrote: From: Jason Rupert jasonkrup...@yahoo.com Subject: [R] Tables for journal/conference