Comments (3)
Thanks for the suggestion, @drmowinckels :)
We created the function to work with one base path for multiple outputs. Coming from a social sciences background, you might want to generate overview tables for multiple subsets of your data set. Creating a file path upfront in the script and adding the file_path
object in the overview_latex
function (thanks so much for suggesting the new name, I love it! 🥰 ) allows us to avoid path copying.
file_path <- 'some/file_path/'
overview_latex(
obj = overview_table1,
path = file_path,
file = 'plot1.tex'
)
overview_latex(
obj = overview_table2,
path = file_path,
file = 'plot2.tex'
)
An alternative that I can think of, on the top of my head, would be to rewrite the function as follows:
file_path <- 'some/file_path/'
overview_latex(
obj = overview_table1,
path = paste0(file_path, 'plot1.tex')
)
overview_latex(
obj = overview_table2,
path = paste0(file_path, 'plot2.tex')
)
I agree that it makes it shorter, but I'm not sure if it makes it cleaner. But I'm curious what you think 😊
from overviewr.
I think there are pros and cons for each, and having created a package that does indeed take a folder as a destination I understand what you are thinking. I too am from social science (psychology), so I totally get where you are coming from.
At the same time, I think a folder makes sense if the function it self creates multiple files. But if a single call to the function creates a single file, then giving the full (or relative) path makes more sense. And then its up to the user to do as you do.
Think of how other writing functions work, where they take a single path for a single file. write.table, readr::write_tsv, etc. We are used to having to provide a single path for a single function call already. As a user, if I were just writing a single file, I'd find it strange to provide both a path and destination folder, I'd for sure do it incorrectly at the first try because of this. From an R point of view, I think a single path makes sense.
That being said. I am not going to force a change on this at all, I merely wanted a discussion around it, as I found it odd. It is not a big deal at all, and if you are happy with it, then go for it. If you, after reading this comment, still want to keep it as is, then you can close the comment, and I'll finish my review.
from overviewr.
Thanks for your response and for sharing your thoughts. We find the reasoning very convincing and highly appreciate getting an outside perspective on our package's functionality :)
We changed the argument from file
and path
to a single argument file_path
in PR #30 and #32 :)
from overviewr.
Related Issues (20)
- overview_overlap HOT 1
- overview_plot Function Does not Plot Correctly HOT 6
- Add More Arguments to Improve the overview_crossplot Function HOT 3
- Add workflow description website `ggplot2`
- Add check for missing months/days in overview_na HOT 1
- Add new overview_cross plot functions to vignette and README
- Add overview_na row wise functionality to vignette and README
- mention and compare package to other similar packages HOT 1
- add community guidelines HOT 1
- avoid using forward pipe HOT 2
- dont reiterate devtools installs in code sections HOT 1
- object 'toyota_red' is not created in a visible part of the readme HOT 1
- object 'toydata_with_na' not created in visible code HOT 1
- recommendation: rename _print to _latex HOT 1
- Add feature for backward compatibility with file_path
- Make Venn diagram proportional to size
- Change to new cran checks badge URL HOT 1
- Feature: overview_markdown
- Update cheat sheet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from overviewr.