2%> This is the abstract
class for generating instances of objects
3%> that can contain basic attributes required
for tabular read-only
4%> access to a MATLAB table-compatible data stored externally.<br>
7%> This
class is merely a convenience read-only wrapper
8%> to reference external tabular data as table.<br>
9%> This
class primarily exist to facilitate bypassing
10%> the lack of references and pointers in MATLAB.<br>
13%> See the constructor documentation
for example usage.<br>
21%> \JoshuaOsborne, May 21 2024, 4:45 PM, University of Texas at Arlington<br>
22%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
23%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
26 methods(Access =
public)
28 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 %> Generate an
return an
object of
class [pm.data.DataFrame](@ref
DataFrame)
32 %> from the input dataframe or its specified input reference.<br>
35 %> This is the constructor of the
class [pm.data.DataFrame](@ref
DataFrame).<br>
37 %> \param[in] dfref : The input MATLAB 2D matrix or table containing the target dataset
38 %> or function handle that takes no arguments and returns the dataset.<br>
39 %> Specifying a function handle is superior to specifying the dataset
40 %> directly, because the function handle will always allow the use of
41 %> the most updated
version of the user table or matrix.<br>
42 %> (**optional**.
default = ``table(zeros(0, 0))``)
45 %> ``self`` : The output scalar
object of
class [pm.data.DataFrame](@ref
DataFrame).<br>
55 %> \include{lineno} example/data/
DataFrame/main.m
57 %> \include{lineno} example/data/
DataFrame/main.out.m
62 %> \JoshuaOsborne, May 21 2024, 4:54 PM, University of Texas at Arlington<br>
63 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
64 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
70 dfref = table(zeros(0, 0));
72 self = self@pm.data.DataRef(dfref);
75 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78 %> Generate and
return a table
copy of the dataframe contained in the
79 %> user-specified input ``dfref`` to the constructor of the parent
object.<br>
82 %> This
class method offers the only way to access the user-specified dataframe.<br>
83 %> The underlying logic behind the use of function to access the dataframe
84 %> originates from the lack of the
concept of references (pointers)
85 %> in the MATLAB computing language.<br>
88 %> ``df`` : The output scalar MATLAB table a full
copy of the dataframe
89 %> contained in the user-specified input ``dfref`` passed
90 %> to the constructor of the parent object.<br>
96 %> df = pm.data.DataFrame.copy()
101 %> See the constructor documentation
for example usage.<br>
106 %> \JoshuaOsborne, May 21 2024, 4:54 PM, University of Texas at Arlington<br>
107 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
108 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
109 function df =
copy(self)
110 df =
copy@pm.data.DataRef(self);
112 df = array2table(df);
116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
119 %> Generate and
return the number of columns in the user-specified
120 %> dataframe ``dfref`` at the time of constructing the parent
object.<br>
123 %> This
class method is a handy shorthand for ``size(self.dfref, 2)``, particularly
124 %> useful
for specifying a range of indices of columns in visualization tasks.<br>
127 %> ``count`` : The output scalar MATLAB whole-number representing the number
128 %> of columns in the ``dfref`` component of the parent
object.
134 %> count = pm.data.DataFrame.ncol()
139 %> See the constructor documentation
for example usage.<br>
144 %> \JoshuaOsborne, May 21 2024, 5:00 PM, University of Texas at Arlington<br>
145 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
146 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
147 function count = ncol(self)
148 count = size(self.copy(), 2);
151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 %> Generate and
return the number of rows in the user-specified
155 %> dataframe ``dfref`` at the time of constructing the parent
object.<br>
158 %> This
class method is a handy shorthand for ``size(self.dfref, 2)``,
159 %> particularly useful
for specifying a range of indices of rows to visualize.<br>
164 %> ``count`` : The output scalar MATLAB whole-number representing the number
165 %> of rows in the ``dfref`` component of the parent
object.<br>
170 %> count = pm.data.DataFrame.nrow()
175 %> See the constructor documentation
for example usage.<br>
180 %> \JoshuaOsborne, May 21 2024, 5:04 PM, University of Texas at Arlington<br>
181 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
182 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
183 function count = nrow(self)
184 count = size(self.copy(), 1);
187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190 %> Generate and
return a natural logarithmically-spaced
191 %> range of indices from the row indices of the input
192 %> dataframe ``dfref`` to the parent
object.<br>
195 %> This method is a convenience wrapper
196 %> around function [pm.array.logrange](@ref
logrange).<br>
199 %> Beware of the different order of the input arguments
200 %> between
this method and [pm.array.logrange](@ref
logrange).<br>
202 %> \param[in] count : The input scalar MATLAB whole-number (integer)
203 %> representing the maximum size of the output range.<br>
204 %> Due to rounding operation involved in creating the
205 %> output range, it is impossible to prespecify the
206 %> output range size, only the maximum.<br>
207 %> (**optional**,
default = ``1000``)
209 %> \param[in] start : The input scalar MATLAB whole-number (integer)
210 %> representing the starting point of the output range.<br>
211 %> It must be a number in the range ``[1, size(self.dfref, 1)]``.
212 %> Otherwise, the value ``max(1, min(start, self.nrow()))`` will be used.<br>
213 %> (**optional**,
default = ``1``)
215 %> \param[in] stop : The input scalar MATLAB whole-number (integer)
216 %> representing the stopping point of the output range.<br>
217 %> It must be a number in the range ``[1, size(self.dfref, 1)]``.
218 %> Otherwise, the value ``max(start, min(stop, self.nrow()))`` will be used.<br>
219 %> (**optional**,
default = ``1``)
222 %> ``indices`` : The output vector of MATLAB real values containing
223 %> the set of naturally logarithmically-spaced integer
224 %> values in the specified input range.<br>
226 %> \interface{rowslog}
229 %> indices = pm.data.DataFrame()
230 %> indices = pm.data.DataFrame([])
232 %> indices = pm.data.DataFrame([], [])
233 %> indices = pm.data.DataFrame([], start)
234 %> indices = pm.data.DataFrame(count, [])
235 %> indices = pm.data.DataFrame(count, start)
237 %> indices = pm.data.DataFrame([], [], [])
238 %> indices = pm.data.DataFrame(count, [], [])
239 %> indices = pm.data.DataFrame([], start, [])
240 %> indices = pm.data.DataFrame([], [], stop)
241 %> indices = pm.data.DataFrame([], start, stop)
242 %> indices = pm.data.DataFrame(count, [], stop)
243 %> indices = pm.data.DataFrame(count, start, [])
244 %> indices = pm.data.DataFrame(count, start, stop)
249 %> See the constructor documentation
for example usage.<br>
254 %> \JoshuaOsborne, May 21 2024, 5:10 PM, University of Texas at Arlington<br>
255 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
256 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
257 function indices = rowslog(self, count, start, stop)
276 indices = pm.array.logrange(max(1, min(start, self.nrow())), max(start, min(stop, self.nrow())), count);
279 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
This is the abstract class for generating instances of objects that can contain basic attributes requ...
function copy(in self)
Generate and return a table copy of the dataframe contained in the user-specified input dfref to the ...
function DataFrame(in dfref)
Generate an return an object of class pm.data.DataFrame from the input dataframe or its specified inp...
function nrow(in self)
Generate and return the number of rows in the user-specified dataframe dfref at the time of construct...
function rowslog(in self, in count, in start, in stop)
Generate and return a natural logarithmically-spaced range of indices from the row indices of the inp...
function ncol(in self)
Generate and return the number of columns in the user-specified dataframe dfref at the time of constr...
This is the abstract class for generating instances of objects that can contain basic attributes requ...
function copy(in from, in to, in fields)
Copy the contents of the struct/object from to the struct/object to recursively and without destroyin...
function logrange(in start, in stop, in sizemax)
Return a set of maximum sizemax unique integer spacings almost linearly spaced in the natural logarit...