LoadData: Data loading and conversion of cartesian coordinates,...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/LoadData.R

Description

This function reads data from a text file containing data of coordinates. Data can be read as cartesian coordinates, incremental data or polar coordinates. This functions returns a matrix with all possible data conversions according to topographical direction (0 grades N clockwise).

Usage

1
LoadData(FileName, Type = 2)

Arguments

FileName

File name to load data

Type

Integer value that indicates the type of data contained in the file. Type 1 = Cartesian, Type 2= Incremental, Type 3 = Polar

Details

Input files must be in a certain format for the data type. By default, the type is incremental data (Type = 2).

The cartesian coordinate type contains four columns, each pair defining the coordinates of a vector node. The columns 1 and 2 are the values of the initial node, while columns 3 and 4 are the coordinates of the final node. If necessary, we can used the inverse order to adapt the direction to our data. The calculations are performed subtracting the coordinates of the final node to the initial node; each row corresponds to one set of data.

The incremental data contains two columns, the first column is the increase of X coordinate, and the second is the increase of Y coordinate; each row corresponds to one set of data.

The polar coordinates contains two columns. The first column represents the module, and the second column represents the azimuth; each row corresponds to one set of data.

Typical usages are

1
2
3
4
    LoadData(FileName, \dots)
    LoadData(FileName, Type=2, \dots)
    ......
   

Value

The function returns a nx9 matrix size, where n is the number of data. Column 1 represents the module; column 2 represents the azimuth; column 3 represents the increase of X coordinate; the column 4 represents the increase of Y coordinate; columns 5 and 6 represent the X and Y coordinates, respectively, of the initial node, and columns 7 and 8 represent the X and Y coordinates, respectively, of the final node.

Columns 5, 6, 7 and 8 will have value only if the input data are of type 1.

Author(s)

Ruiz-Cuetos, J.C., jcruizcue@gmail.com, Felicisimo, A.M., amfeli@unex.es, Cuartero, A., acuartero@unex.es, Polo, M.E., mepolo@unex.es, Rodriguez, P.G. pablogr@unex.es

References

Website http://gim.unex.es/VecStatGraphs2D/

See Also

DrawAzimuthDensity, DrawHistogram, DrawModuleAndAzimuthDistribution, DrawDensityMap, AllAzimuthStatistics, AllModuleStatistics, DrawQQPlot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
   FileName<-system.file("data/RectangularData.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/casiunifor.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/casiuniforpolar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/concentra.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/concentrapolar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/datos1.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/datos1polar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/datos2.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/datos2polar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/datos3.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/datos3polar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/datos4.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/datos4polar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/datos4polardir1.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/datos1050.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/datos1050polar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/mabel51polar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3) 

   FileName<-system.file("data/mabel61polar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/masdatos.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/masdatospolar.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=3)

   FileName<-system.file("data/muchocero.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/muchocero1.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

   FileName<-system.file("data/vient.txt", package="VecStatGraphs2D")
   LoadData(FileName, Type=2)

VecStatGraphs2D documentation built on May 2, 2019, 12:36 p.m.