You can use capture.output
with invisible
> invisible(capture.output(y <- ff(2)))
> y
[1] 4
or sink
> sink("file")
> y <- ff(2)
> sink()
> y
[1] 4
More Related Contents:
- Why do R objects not print in a function or a “for” loop?
- Removing display of row names from data frame
- R – do I need to add explicit new line character with print()?
- Print pretty data.frames/tables to console
- How do you print to stderr in R?
- Local Variables Within aes
- Fastest way to find second (third…) highest/lowest value in vector or column
- Add a new column of the sum by group [duplicate]
- How to correctly use lists?
- calculating time difference in R
- read.csv warning ‘EOF within quoted string’ prevents complete reading of file
- R – How to get row & column subscripts of matched elements from a distance matrix
- How do I override a non-visible function in the package namespace?
- Shiny slider on logarithmic scale
- filter function in dplyr errors: object ‘name’ not found
- How to pass dynamic column names in dplyr into custom function?
- cbind 2 dataframes with different number of rows
- Line break in expression()?
- In `knitr` how can I test for if the output will be PDF or word?
- how to create a loop that includes both a code chunk and text with knitr in R
- Library is not writable
- Is it possible to get the number of rows in a CSV file without opening it?
- How to stop bookdown tables from floating to bottom of the page in pdf?
- Elegant way to select the color for a particular segment of a line plot?
- How to increase the size of points in legend of ggplot2? [duplicate]
- Are there global variables in R Shiny?
- Shifting a column down by one
- Problem loading rJava
- How to change stacking order in stacked bar chart in R?
- How can I count the number of NAs per group?