Here is a simple function I wrote to help troubleshoot an issue. I have a function whose purpose is to return a tibble.
tstFunc <- function(n){
n <- tibble(style = character(), color = character(), count = integer())
add_row(n, style = "old", color = "blue", count = 8)
return(n)
}
When I execute this function:
tstFunc(b)
I get this response:
# A tibble: 0 x 3
# ... with 3 variables: style <chr>, color <chr>, count <int>
As you see, the row is NOT added to my tibble. However, when I execute this line at the console:
> testTibble <- tibble(style = character(), color = character(), count = integer())
> add_row(testTibble, style = "old", color = "blue", count = 8)
# A tibble: 1 x 3
style color count
<chr> <chr> <dbl>
1 old blue 8
You see that the row HAS been added. What am I failing to grasp here? Thanks.