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

Add one print example #184

Merged
merged 4 commits into from
Nov 26, 2021
Merged

Add one print example #184

merged 4 commits into from
Nov 26, 2021

Conversation

agila5
Copy link
Collaborator

@agila5 agila5 commented Nov 26, 2021

Added one example in ?sfnetwork showing the sfn_max_print_active/inactive options. Refs: #157

agila5 and others added 3 commits November 26, 2021 12:14
If I am not mistaken it is required by CRAN that you reset options back to defaults in any example, vignette, etc
@luukvdmeer
Copy link
Owner

I resetted the changed options after running the example. I think CRAN requires this.

One note: should we not at least print 1 row per component in the example? I think that now with zero rows printed it might be a bit confusing :p

@agila5
Copy link
Collaborator Author

agila5 commented Nov 26, 2021

Hi!

I resetted the changed options after running the example. I think CRAN requires this.

Thanks. Sorry, I forgot about that. I just pushed a new commit with a (slightly) less verbose example (more readable IMO). AFAIK, you can also set the old options by saving the value returned by option. Something like:

options(a = 1)
old <- options(a = 2)
getOption("a")
#> [1] 2
options(old)
getOption("a")
#> [1] 1

Created on 2021-11-26 by the reprex package (v2.0.1)

Feel free to revert that.

One note: should we not at least print 1 row per component in the example? I think that now with zero rows printed it might be a bit confusing :p

IMO it was a nice example showing that, if you want, you can just print the "structure" of the sfnetwork object (i.e. ecount, vcount, CRS, description and "headers" for nodes and edges tables) but you are right that it might be confusing. I just set sfn_max_print_active = 1L and sfn_max_print_inactive = 2L. Feel free to adjust that.

@luukvdmeer luukvdmeer merged commit bbdcc35 into develop Nov 26, 2021
@luukvdmeer luukvdmeer deleted the add-print-example branch November 26, 2021 16:06
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

Successfully merging this pull request may close these issues.

2 participants