Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messed up output #114

Open
MarieAgosta opened this issue Nov 11, 2016 · 3 comments
Open

messed up output #114

MarieAgosta opened this issue Nov 11, 2016 · 3 comments

Comments

@MarieAgosta
Copy link

With this line of code:


library(dplyr)
library(stargazer)
age <- anes$dem_age_r_x %>% as.data.frame()
#stargazer(age, type = "text", summary = TRUE) for seeing #what the table looks #like, because without specifying text it just looks like the code for output as #it will eventually appear in a knitted document stargazer
(age, summary = TRUE)
stargazer(age, summary = TRUE)

We get this output before our table. I have been googling away as to why and how to correct it but I just don’t understand. Could you please help me? 


![screen shot 2016-11-11 at 10 09 49 am](https://cloud.githubusercontent.com/assets/22035414/20211540/568ac1be-a7ff-11e6-9f36-9ad4cf42754f.png)
@tori-d
Copy link
Contributor

tori-d commented Nov 11, 2016

Hey Marie -- so you want to get rid of the "attaching package" and "please cite as" messages?

In your r code chunk in your markdown document, try adding these messages:

```{r, message=F, warning=F, results ='asis'}

Message = F and Warning = F should suppress these types of messages from showing. Reults='asis' helps ensure the table is formatted correctly by Knittr. Does this help?

@MarieAgosta
Copy link
Author

Thanks Tori! I appreciate the help. One more if you happen to know… how to stop a table from running off the page when using stargazer? It’s a pretty basic frequency table…

Thanks again,

Marie

From: Tori <[email protected]mailto:[email protected]>
Reply-To: HertieDataScience/SyllabusAndLectures <[email protected]mailto:[email protected]>
Date: Friday, November 11, 2016 at 11:23 AM
To: HertieDataScience/SyllabusAndLectures <[email protected]mailto:[email protected]>
Cc: Marie <[email protected]mailto:[email protected]>, Author <[email protected]mailto:[email protected]>
Subject: Re: [HertieDataScience/SyllabusAndLectures] messed up output (#114)

Hey Marie -- so you want to get rid of the "attaching package" and "please cite as" messages?

In your r code chunk in your markdown document, try adding these messages:

Message = F and Warning = F should suppress these types of messages from showing. Reults='asis' helps ensure the table is formatted correctly by Knittr. Does this help?


—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://github.com/HertieDataScience/SyllabusAndLectures/issues/114#issuecomment-259927396>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AVA71q-Z17fTfYafstZuazO37T3ST9tXks5q9EIUgaJpZM4Kvmqi>.

@christophergandrud
Copy link
Contributor

A suggestion on the frequency table issue. One easy option is to choose a smaller font size (in stargazer you can choose font.size = 'tiny' for example.

Generally though, if the are running onto multiple pages with a frequency table it is better to think of a more effective way to visualise the data, e.g. a histogram or other chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants