Package export.RExport
Class RDataUnitExport<T extends PamDataUnit<?,?>>
java.lang.Object
export.RExport.RDataUnitExport<T>
- Type Parameters:
T
- - the data unit type.
- Direct Known Subclasses:
RCPODExport
,RNoiseExport
,RRawExport
,RSuperDetectionExport
,RWhistleExport
Exports a data unit to a List in R. Specific data units should subclass this.
- Author:
- Jamie Macaulay
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.renjin.sexp.ListVector.NamedBuilder
addDetectionSpecificFields
(org.renjin.sexp.ListVector.NamedBuilder rData, T dataUnit, int index) Add detection specific fields to a structure.protected org.renjin.sexp.ListVector.NamedBuilder
detectionHeader
(PamDataBlock pamDataBlock) Get the header for a data unit.org.renjin.sexp.ListVector.NamedBuilder
detectionToStruct
(T dataUnit, int index) Create a R data frame which contains all information for a data unit.static org.renjin.sexp.Vector
doubleArr2R
(double[][] arr) Convert a 2D double array to a vector which can be added to an RData frame.abstract String
getName()
Get the name of the structureabstract Class
<?> Get the unit class
-
Constructor Details
-
Method Details
-
detectionToStruct
Create a R data frame which contains all information for a data unit.- Parameters:
dataUnit
- - the data unit to convert to a R structure- Returns:
- detection data R structure ready to be exported to a .mat file or added to a ArrayList
.
-
addDetectionSpecificFields
public abstract org.renjin.sexp.ListVector.NamedBuilder addDetectionSpecificFields(org.renjin.sexp.ListVector.NamedBuilder rData, T dataUnit, int index) Add detection specific fields to a structure.- Parameters:
structure
- containing all generic info from PamDataUnitthe
- data unit.
-
getUnitClass
Get the unit class- Returns:
-
getName
Get the name of the structure- Returns:
-
doubleArr2R
public static org.renjin.sexp.Vector doubleArr2R(double[][] arr) Convert a 2D double array to a vector which can be added to an RData frame.- Parameters:
arr
- - the array- Returns:
- Vector containing the array data.
-
detectionHeader
Get the header for a data unit. This is used to store information about the data unit which is not specific to a detection.- Parameters:
pamDataBlock
- - the data block- Returns:
- - a structure containing the header information.
-