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

Clarify difference between "find" and "fix" functions in vignette #9

Closed
krlmlr opened this issue Feb 5, 2016 · 4 comments
Closed

Comments

@krlmlr
Copy link
Member

krlmlr commented Feb 5, 2016

Basically, the ...find...() functions look at the current working directory, while the ...fix...() functions don't.

@egouldo: Look at the result of rprojroot::is_r_package$make_fix_file(). How to make this clear in the vignette?

@egouldo
Copy link

egouldo commented Feb 8, 2016

Okay, I've just updated my version of the package so I can run the suggested code above. I can see that rprojroot::is_r_package$find_file() returns the path of the root dir. of my package, whereas rprojroot::is_r_package$make_fix_file() returns a function that appends any arguments I supply to the root dir file path. Cool. So as per your documentation, I can define my own function and use it as a wrapper where needed. Is that the main difference, or am I missing something still?

Also, not sure if intended or not, but the functions make_find_root_file and make_fix_root_file no longer seem to be exported in the rprojroot namespace (but there is still reference to these functions within the 'Details' section of the ?find_root_file page).

@krlmlr
Copy link
Member Author

krlmlr commented Feb 8, 2016

$find_file() also takes an arbitrary number of arguments. If you define your own function, it's one of the two below:

root <- rprojroot::is_r_package$find_file
root <- rprojroot::is_r_package$make_fix_file()

The make_() functions are gone and replaced by their object-oriented counterpart, this is intended. Thanks for the hint, I'll update the documentation.

@krlmlr
Copy link
Member Author

krlmlr commented Feb 8, 2016

There is a subtle difference between the two options above, too. The first version (find_file) will search for a project root from the current directory every time. The second version (make_fix_file()) looks for the project root once (when defining root), and then keeps that root no matter what the current working directory is.

@krlmlr krlmlr closed this as completed in 218ac37 May 12, 2016
krlmlr pushed a commit that referenced this issue May 13, 2016
- New root criterion , useful for creating accessors to a known path (#11).
- Clarify difference between `find_file()` and `make_fix_file()` in vignette (#9).
- Remove unexported functions from documentation and examples (#10).
krlmlr added a commit that referenced this issue Nov 6, 2016
- Compatibility
    - Compatible with R >= 3.0.0 with the help of the `backports` package.

- New root criteria
    - `is_remake_project` and `find_remake_root_file()` look for [remake](https://github.com/richfitz/remake) project (#17).
    - `is_testthat` and `find_testthat_root_file()` that looks for `tests/testthat` root (#14).
    - `from_wd`, useful for creating accessors to a known path (#11).

- Minor enhancement
    - Criteria can be combined with the `|` operator (#15).

- Documentation
    - Add package documentation with a few examples (#13).
    - Clarify difference between `find_file()` and `make_fix_file()` in vignette (#9).
    - Remove unexported functions from documentation and examples (#10).
    - Use `pkgdown` to create website.

- Testing
    - Use Travis instead of wercker. Travis tests three R versions, and OS X.
    - Improve AppVeyor testing.
@github-actions
Copy link

github-actions bot commented Dec 8, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants