diff --git a/docs/examples/UserGuide/r_files.jl b/docs/examples/UserGuide/r_files.jl new file mode 100644 index 0000000..ec4b112 --- /dev/null +++ b/docs/examples/UserGuide/r_files.jl @@ -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) +# ``` \ No newline at end of file diff --git a/docs/examples/UserGuide/xl.jl b/docs/examples/UserGuide/xl.jl index b495c8e..ef74633 100644 --- a/docs/examples/UserGuide/xl.jl +++ b/docs/examples/UserGuide/xl.jl @@ -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) # ``` \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index a1db7a1..7774286 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -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" \ No newline at end of file diff --git a/src/docstrings.jl b/src/docstrings.jl index 1db15e0..b6e3426 100644 --- a/src/docstrings.jl +++ b/src/docstrings.jl @@ -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.