0

A partial image of the output

My output contains more than 10 rows but dplyr is only displaying 10. I need all the output rows displayed.

I am using RStudio on a Mac.

I loaded my data with this code:

> allstarmets <- read.csv("All-Star-games-Mets.csv", stringsAsFactors = FALSE)

Here are the first 16 rows in the CSV file (The CSV contains 122 rows including the header row):

   playerID yearID gameNum       gameID teamID lgID GP startingPos
1   ashburi01   1962       1 ALS196207100    NYN   NL  0          NA
2   ashburi01   1962       2 NLS196207300    NYN   NL  1          NA
3   snidedu01   1963       0 ALS196307090    NYN   NL  1          NA
4    huntro01   1964       0 NLS196407070    NYN   NL  1           4
5   kraneed01   1965       0 ALS196507130    NYN   NL  0          NA
6    huntro01   1966       0 NLS196607120    NYN   NL  1          NA
7   seaveto01   1967       0 ALS196707110    NYN   NL  1          NA
8   groteje01   1968       0 NLS196807090    NYN   NL  1           2
9   koosmje01   1968       0 NLS196807090    NYN   NL  1          NA
10  seaveto01   1968       0 NLS196807090    NYN   NL  1          NA
11  jonescl01   1969       0 ALS196907230    NYN   NL  1           7
12  koosmje01   1969       0 ALS196907230    NYN   NL  1          NA
13  seaveto01   1969       0 ALS196907230    NYN   NL  0          NA
14  harrebu01   1970       0 NLS197007140    NYN   NL  1          NA
15  seaveto01   1970       0 NLS197007140    NYN   NL  1           1

Here is the main part of my code:

allstarmets2 <- allstarmets
> allstarmets2 %>%
+ group_by(yearID) %>%
+ summarize(n())

Here is what is displayed when I run the whole CSV file. I need to see all the rows, not just the first 10.

# A tibble: 57 x 2
   yearID `n()`
    <int> <int>
 1   1962     2
 2   1963     1
 3   1964     1
 4   1965     1
 5   1966     1
 6   1967     1
 7   1968     3
 8   1969     3
 9   1970     2
10   1971     2
# … with 47 more rows
joran
  • 169,992
  • 32
  • 429
  • 468
Metsfan
  • 510
  • 2
  • 8
  • Add `%>% View()` are the end of your pipe sequence to use the Rstudio viewer. – Andrew Jul 05 '19 at 17:50
  • Links for images of code/data: https://meta.stackoverflow.com/a/285557/3358272 (and https://xkcd.com/2116/). Links for good reproducible examples in R: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. Cheers! – r2evans Jul 05 '19 at 18:37

0 Answers0