@@ -18,7 +18,7 @@ Its main advantages are:
18
18
- It is a pure Python implementation, with no dependencies on the R language or
19
19
related libraries.
20
20
Thus, it can be used anywhere where Python is supported, including the web
21
- using `Pyodide <https://pyodide.org/ >`_ .
21
+ using `Pyodide <https://pyodide.org/ >`__ .
22
22
- It attempt to support all R objects that can be meaningfully translated.
23
23
As opposed to other solutions, you are no limited to import dataframes or
24
24
data with a particular structure.
@@ -101,14 +101,14 @@ Under the hood, this is equivalent to the following code:
101
101
This consists on two steps:
102
102
103
103
#. First, the file is parsed using the function
104
- `rdata.parser.parse_file <https://rdata.readthedocs.io/en/latest/modules/rdata.parser.parse_file.html >`_ .
104
+ `rdata.parser.parse_file <https://rdata.readthedocs.io/en/latest/modules/rdata.parser.parse_file.html >`__ .
105
105
This provides a literal description of the
106
106
file contents as a hierarchy of Python objects representing the basic R
107
107
objects. This step is unambiguous and always the same.
108
108
#. Then, each object must be converted to an appropriate Python object. In this
109
109
step there are several choices on which Python type is the most appropriate
110
110
as the conversion for a given R object. Thus, we provide a default
111
- `rdata.conversion.convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.convert.html >`_
111
+ `rdata.conversion.convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.convert.html >`__
112
112
routine, which tries to select Python objects that preserve most information
113
113
of the original R object. For custom R classes, it is also possible to
114
114
specify conversion routines to Python objects.
@@ -117,40 +117,40 @@ Convert custom R classes
117
117
------------------------
118
118
119
119
The basic
120
- `convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.convert.html >`_
120
+ `convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.convert.html >`__
121
121
routine only constructs a
122
- `SimpleConverter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html >`_
122
+ `SimpleConverter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html >`__
123
123
object and calls its
124
- `convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html#rdata.conversion.SimpleConverter.convert >`_
124
+ `convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html#rdata.conversion.SimpleConverter.convert >`__
125
125
method. All arguments of
126
- `convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.convert.html >`_
126
+ `convert <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.convert.html >`__
127
127
are directly passed to the
128
- `SimpleConverter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html >`_
128
+ `SimpleConverter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html >`__
129
129
initialization method.
130
130
131
131
It is possible, although not trivial, to make a custom
132
- `Converter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.Converter.html >`_
132
+ `Converter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.Converter.html >`__
133
133
object to change the way in which the
134
134
basic R objects are transformed to Python objects. However, a more common
135
135
situation is that one does not want to change how basic R objects are
136
136
converted, but instead wants to provide conversions for specific R classes.
137
137
This can be done by passing a dictionary to the
138
- `SimpleConverter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html >`_
138
+ `SimpleConverter <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.SimpleConverter.html >`__
139
139
initialization method, containing
140
140
as keys the names of R classes and as values, callables that convert a
141
141
R object of that class to a Python object. By default, the dictionary used
142
142
is
143
- `DEFAULT_CLASS_MAP <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.DEFAULT_CLASS_MAP.html >`_ ,
143
+ `DEFAULT_CLASS_MAP <https://rdata.readthedocs.io/en/latest/modules/rdata.conversion.DEFAULT_CLASS_MAP.html >`__ ,
144
144
which can convert commonly used R classes such as
145
- `data.frame <https://www.rdocumentation.org/packages/base/topics/data.frame >`_
146
- and `factor <https://www.rdocumentation.org/packages/base/topics/factor >`_ .
145
+ `data.frame <https://www.rdocumentation.org/packages/base/topics/data.frame >`__
146
+ and `factor <https://www.rdocumentation.org/packages/base/topics/factor >`__ .
147
147
148
148
As an example, here is how we would implement a conversion routine for the
149
149
factor class to
150
- `bytes <https://docs.python.org/3/library/stdtypes.html#bytes >`_
150
+ `bytes <https://docs.python.org/3/library/stdtypes.html#bytes >`__
151
151
objects, instead of the default conversion to
152
152
Pandas
153
- `Categorical <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Categorical.html#pandas.Categorical >`_ objects:
153
+ `Categorical <https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Categorical.html#pandas.Categorical >`__ objects:
154
154
155
155
.. code :: python
156
156
@@ -187,7 +187,7 @@ Additional examples
187
187
188
188
Additional examples illustrating the functionalities of this package can be
189
189
found in the
190
- `ReadTheDocs documentation <https://rdata.readthedocs.io/en/latest/auto_examples/index.html >`_ .
190
+ `ReadTheDocs documentation <https://rdata.readthedocs.io/en/latest/auto_examples/index.html >`__ .
191
191
192
192
193
193
.. |build-status | image :: https://github.com/vnmabus/rdata/actions/workflows/main.yml/badge.svg?branch=master
0 commit comments