Q:

Column is NULL when printed as individual field or column, filled when whole data frame is printed

When I create a column of counts using dplyr, it appears to be filled correctly, until I try to use the counts column on its own. 
Example:
I create this dataframe:
V1 <- c("TEST", "test", "tEsT", "tesT", "TesTing", "testing","ME-TESTED", "re tested", "RE testing")
V2 <- c("othertest", "anothertest", "testing", "123", "random stuff", "irrelevant", "tested", "re-test", "tests")
V3 <- c("type1", "type2", "type1", "type2", "type3", "type2", "type2", "type2", "type1")
df <- data.frame(V1, V2, V3)

Then, I use dplyr to create a column of counts:
df$counts <- df %>% group_by(V3) %>% mutate(count = n())

This gives the expected result:
> df
      V1           V2    V3  counts.V1    counts.V2 counts.V3 counts.count
1       TEST    othertest type1       TEST    othertest     type1            3
2       test  anothertest type2       test  anothertest     type2            5
3       tEsT      testing type1       tEsT      testing     type1            3
4       tesT          123 type2       tesT          123     type2            5
5    TesTing random stuff type3    TesTing random stuff     type3            1
6    testing   irrelevant type2    testing   irrelevant     type2            5
7  ME-TESTED       tested type2  ME-TESTED       tested     type2            5
8  re tested      re-test type2  re tested      re-test     type2            5
9 RE testing        tests type1 RE testing        tests     type1            3

But, when I try to use the counts.count column in any way, the result is null:
> df$counts.count
NULL

Same result for the other columns created by dplyr.
But the rest of the data frame seems normal:
> df$V1
[1] TEST       test       tEsT       tesT       TesTing    testing    ME-TESTED  re tested  RE testing
Levels: ME-TESTED re tested RE testing test tesT tEsT TEST testing TesTing

I am totally confused about why printing the whole df gives me a different output than printing just the column of interest. What am I missing here?

A:

If you rewind and recreate the dataframe and then don't do an assignment but just print the result to the screen you see this:
df %>% group_by(V3) %>% mutate(count = n())

Source: local data frame [9 x 4]
Groups: V3 [3]

          V1           V2     V3 count
      <fctr>       <fctr> <fctr> <int>
1       TEST    othertest  type1     3
2       test  anothertest  type2     5
3       tEsT      testing  type1     3
4       tesT          123  type2     5
5    TesTing random stuff  type3     1
6    testing   irrelevant  type2     5
7  ME-TESTED       tested  type2     5
8  re tested      re-test  type2     5
9 RE testing        tests  type1     3

If you now do the assgnment the structure is rather confused and I think you might have gotten a more informative error if there had been fewer unique values of V1 or V2:
df$counts <- df %>% group_by(V3) %>% mutate(count = n())
# snipped what you already showed
 str(df)
#-----
'data.frame':   9 obs. of  4 variables:
 $ V1    : Factor w/ 9 levels "ME-TESTED","re tested",..: 7 4 6 5 9 8 1 2 3
 $ V2    : Factor w/ 9 levels "123","anothertest",..: 4 2 8 1 5 3 7 6 9
 $ V3    : Factor w/ 3 levels "type1","type2",..: 1 2 1 2 3 2 2 2 1
 $ counts:Classes ‘grouped_df’, ‘tbl_df’, ‘tbl’ and 'data.frame':   9 obs. of  4 variables:
  ..$ V1   : Factor w/ 9 levels "ME-TESTED","re tested",..: 7 4 6 5 9 8 1 2 3
  ..$ V2   : Factor w/ 9 levels "123","anothertest",..: 4 2 8 1 5 3 7 6 9
  ..$ V3   : Factor w/ 3 levels "type1","type2",..: 1 2 1 2 3 2 2 2 1
  ..$ count: int  3 5 3 5 1 5 5 5 3
  ..- attr(*, "vars")=List of 1
  .. ..$ : symbol V3
  ..- attr(*, "labels")='data.frame':   3 obs. of  1 variable:
  .. ..$ V3: Factor w/ 3 levels "type1","type2",..: 1 2 3
  .. ..- attr(*, "vars")=List of 1
  .. .. ..$ : symbol V3
  .. ..- attr(*, "drop")= logi TRUE
  ..- attr(*, "indices")=List of 3
  .. ..$ : int  0 2 8
  .. ..$ : int  1 3 5 6 7
  .. ..$ : int 4
  ..- attr(*, "drop")= logi TRUE
  ..- attr(*, "group_sizes")= int  3 5 1
  ..- attr(*, "biggest_group_size")= int 5

The format you are seeing is how R displays a matrix that is embedded in a dataframe. Objects of class table (and perhaps tbl?)  inherit from the matrix-class.

