Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: ista
See also: readlist writelist

Quantlet: readmatrix
Description: Reads a matrix with mixed text and number columns as ASCII data from a file.

Usage: l = readmatrix (filename{, separator})
Input:
filename string
separator string (optional)
Output:
l.ctype type of column vectors in the file (0 = numeric, 10 = text)
l.number number matrix (optional)
l.text text matrix (optional)

Example:

; loads the library util

library ("util")

x = readmatrix("bank2")

x

Result:

Content of object x.ctype

[1,] 0.000000 

[2,] 0.000000 

[3,] 0.000000 

[4,] 0.000000 

[5,] 0.000000 

[6,] 0.000000 

Content of object x.number

[  1,] 214.800000 131.000000 131.100000 9.000000 9.700000 141.000000 

[  2,] 214.600000 129.700000 129.700000 8.100000 9.500000 141.700000 

[  3,] 214.800000 129.700000 129.700000 8.700000 9.600000 142.200000 

...

[198,] 214.800000 130.300000 130.400000 10.600000 11.100000 140.000000 

[199,] 214.700000 130.700000 130.800000 11.200000 11.200000 139.400000 

[200,] 214.300000 129.900000 129.900000 10.200000 11.500000 139.600000 

Example:

x = read("car")

x

Result:



Content of object x.ctype

[ 1,] 10.000000 

[ 2,] 0.000000 

[ 3,] 0.000000 

[ 4,] 0.000000 

[ 5,] 0.000000 

[ 6,] 0.000000 

[ 7,] 0.000000 

[ 8,] 0.000000 

[ 9,] 0.000000 

[10,] 0.000000 

[11,] 0.000000 

[12,] 0.000000 

[13,] 0.000000 

Content of object x.number

[ 1,] 4099.000000 22.000000 3.000000 2.000000 2.500000 27.500000 11.000000 2930.000000 186.000000 40.000000 121.000000 3.580000 

[ 2,] 4749.000000 17.000000 3.000000 1.000000 3.000000 25.500000 11.000000 3350.000000 173.000000 40.000000 258.000000 2.530000 

[ 3,] 3799.000000 22.000000 NaN NaN 3.000000 18.500000 12.000000 2640.000000 168.000000 35.000000 121.000000 3.080000 

...

[72,] 6850.000000 25.000000 4.000000 3.000000 2.000000 23.500000 16.000000 1990.000000 156.000000 36.000000 97.000000 3.780000 

[73,] 7140.000000 23.000000 4.000000 3.000000 2.500000 37.500000 12.000000 2160.000000 172.000000 36.000000 97.000000 3.740000 

[74,] 11995.000000 17.000000 5.000000 3.000000 2.500000 29.500000 14.000000 3170.000000 193.000000 37.000000 163.000000 2.980000 

Content of object x.text

[ 1,] AMC_Concord 

[ 2,] AMC_Pacer 

[ 3,] AMC_Spirit

... 

[72,] VW_Scirocco 

[73,] VW_Dasher 

[74,] Volvo_260 


Library: ista
See also: readlist writelist

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: Sigbert Klinke, 971123
(C) MD*TECH Method and Data Technologies, 21.9.2000