Skip to content

Commit

Permalink
add rfile docs
Browse files Browse the repository at this point in the history
  • Loading branch information
drizk1 committed Aug 21, 2024
1 parent 92db3a4 commit 6994a70
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
15 changes: 15 additions & 0 deletions docs/examples/UserGuide/r_files.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Reading .rds and .rdata files is made possible via RData.jl. There is currently no write support, nor is there url support.

# To read the file, simply pass the path to `read_rdata` or `read_file`. There is a small difference between .rds and .rdata files.
# .rdata files will contain a dict of the table name and the data frame. There can be multiple entries in one .rdata file. To access the data frame, you must pass the name of the dict to the object.

# ```julia
# using TidierFiles
# file = read_rdata("path.rdata) # or read_file("path.rdata)
# df = file["entry_name"]
# ```

# This is in contrast to .rds files which will contain one data frame.
# ```julia
# df = read_rdata("path.rds)
# ```
4 changes: 2 additions & 2 deletions docs/examples/UserGuide/xl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

# ## Writing to a specific sheet
# The example below demonstrates how to write to specific sheets in a file.
# THe string in the Dict is the sheet name, it can be new or preexisting. The second component is the dataframe to be written to that sheet.

# The string in the `Dict` is the sheet name, it can be new or preexisting. The second component is the dataframe to be written to that sheet.
# In this example, two sheets, "REPORT_A" and "REPORT_C" are being written to with `df` and `df2` respectively.
# ```julia
# write_xlsx(("REPORT_A" => df, "REPORT_C" => df2); path = "/Users/danielrizk/Downloads/xlsxtest2.xlsx", overwrite = true)
# ```
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,5 @@ nav:
- "Stats Files": "examples/generated/UserGuide/stats.md"
- "Arrow Files": "examples/generated/UserGuide/Arrow.md"
- "Parquet Files": "examples/generated/UserGuide/parquet.md"
- "R Data Files": "examples/generated/UserGuide/r_files.md"
- "Reference" : "reference.md"
2 changes: 1 addition & 1 deletion src/docstrings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ julia> read_file("test.parquet")
const docstring_read_rdata =
"""
read_rdata(path)
Read `.rdata` and `.rds` files as DataFrame. `.rdata` files will result in a `Dict`. Dataframes can then be selected with `result["name"]``
Read `.rdata` and `.rds` files as DataFrame. `.rdata` files will result in a `Dict`. Dataframes can then be selected with `result["name"]`
# Arguments
- `path`: A string with the file location. This does not yet support reading from URLs.
Expand Down

0 comments on commit 6994a70

Please sign in to comment.