RdsFile.ReadMatrix Method

Definition

Namespace: Numerics.NET.Data.R
Assembly: Numerics.NET.Data (in Numerics.NET.Data.dll) Version: 4.0.1

Overload List

ReadMatrix<T>(Stream, Boolean) Reads a matrix from a stream in R's RDS format.
ReadMatrix<T>(String, Boolean) Reads a matrix from an R file in RDS format.

ReadMatrix<T>(Stream, Boolean)

Reads a matrix from a stream in R's RDS format.
C#
public static Matrix<T> ReadMatrix<T>(
	Stream stream,
	bool strict = true
)

Parameters

stream  Stream
A stream.
strict  Boolean  (Optional)
Specifies whether the element type should be matched exactly (true, the default), or whether conversions are allowed (false).

Type Parameters

T
The element type of the matrix.

Return Value

Matrix<T>
The matrix that was read from the stream pointed to by stream.

Remarks

The element type of the stored matrix does not have to match the element type of the returned matrix. However, casting values from this type to type T must succeed.

ReadMatrix<T>(String, Boolean)

Reads a matrix from an R file in RDS format.
C#
public static Matrix<T> ReadMatrix<T>(
	string path,
	bool strict = true
)

Parameters

path  String
The path to the file.
strict  Boolean  (Optional)
Specifies whether the element type should be matched exactly (true, the default), or whether conversions are allowed (false).

Type Parameters

T
The element type of the matrix.

Return Value

Matrix<T>
The data frame that was read from the file pointed to by path.

Remarks

The element type of the stored matrix does not have to match the element type of the returned matrix. However, casting values from this type to type T must succeed.

Exceptions

FileNotFoundException The specified file does not exist.

See Also