Import Locations

From Anatrack Ranges Support
Jump to navigation Jump to search

The window for importing a location files has four main sections : Summary table displaying the first ten rows of the file, Option boxes for range variables, Option boxes for location-qualifying variables (LQVs) and Location file attributes.

Location files are organised as a number of ranges that are usually identified by a description of the animal and when tracking began (i.e. ID number, Age, Sex, Month and Year).

Summary table

The table at the top of the window displays the first 10 lines of the file. If it detects that the first value in the first column is not a number it assumes that the first row is a header row and uses it to add titles to each column. The header row can be switched on and off using the tick box at the top right. The data in this table is not editable, but allows you to check what values are in which columns.

Options boxes for range variables

On the middle left of the window there are 9 choice boxes with titles E, N, ID, Age, Sex, Month, Year, FocalE, FocalN (location coordinates followed by the seven range attribute variables). The selections you make in these boxes will determine which columns in the input file the data will be obtained from. If the file has a header row the choice boxes will contain the column titles, if not they will contain the column numbers. Using an input file with a header row reduces the risk of importing the wrong columns.

All of the choice boxes, with the exception of E and N, have absent as the last option. This is used to indicate that the file does not contain any data for that attribute. The ‘absent’ option is not available for E and N as it would be meaningless to create a location file lacking one or both coordinates. If the last seven choice boxes (ID to FocalN) are all set to ‘absent’ the data will be read in as a single range with no attribute information.

The ID determines which range that row of data will be read into. Data for the same range need not be adjacent, so it will read in data that has been collected for multiple individuals in sequence. e.g. if the following column file was imported:

* * 1
* * 2
* * 3
* * 1
* * 2
* * 3

where columns 1 and 2 contain data values, and column 3 is specified as the ID, the result would be two locations in each of three ranges. If the ID choice box is set to ‘absent’ all of the locations will be assigned to the same range. This provides one method of amalgamating all of the ranges in a multi-range file. Using different ID field can also be used to sub-divide your data.

ID number, Age, Sex, Month, Year, FocalE and FocalN are all range attributes. Thus there is only one value stored for each range. The program imports the value obtained from the first location in each range. It does NOT check whether the values for subsequent locations in the same range are the same as this. Thus it is important that range attributes are correct for the first location in a range, subsequent locations could contain any character in the range attribute columns (but the columns cannot be left empty because then the column structure of the file would be lost).

Age, Sex, Month and Year need to be imported as integers. ID can contain letters as well as numeric characters. Age and Sex values have corresponding labels which are defined in the Age Labels and Sex Labels sections lower in the table. FocalE and FocalN coordinates can be integers or decimals.

The choice boxes automatically detect certain default location column file formats and are set up accordingly, but they can then be changed.

Option boxes for location qualifying variables (LQVs)

On the middle right of the window (to the right of where it says Location Qualifying Variables) there is a choice box with the title No.. This determines the number of LQVs that will be in the location file to be created. Beneath this will appear two components for each LQV. The first is a choice box allowing you to select the column that contains the values for that LQV. The second is a text box allowing you to type a label for that LQV; this defaults to the column title (which is just the column number if the input file has no header).

The components automatically detect certain default location column file formats and are set up accordingly, but they can then be changed.

Location file attributes

The lower portion of the window contains five other components that allow you to alter the file attributes of the location file to be created.

Default location column file formats

On importing location column files, the import procedure makes assumptions about the location of data elements, dependent upon the number of columns in the file. The initial set up in the import window is based upon these assumptions, as shown below. If you set up your import file in these ways you should just need to press OK to accept the default settings.

No. columns Assumed contents of data columns
2 E, N
3 E, N, ID
4 E, N, ID, lqv1
5 E, N, ID, lqv1, lqv2
6 E, N, ID, lqv1, lqv2, lqv3
7 E, N, ID, lqv1, lqv2, lqv3, lqv4
8 E, N, ID, lqv1, lqv2, lqv3, lqv4, lqv5
9 ID, age, sex, month, year, focalE, focalN, E, N
10+ ID, age, sex, month, year, focalE, focalN, E, N, lqv1+

Location files are exported from Ranges in the same format as the last of these, i.e. with nine columns containing the range and coordinate data followed by 1 extra column for each location-qualifying variable.

Using different ID fields to sub-divide your data

Importing a file specifying a different ID column provides a means of subdividing the data in different ways. For example if you have data for multiple animals over multiple years you could create columns that specify a) year and animal, and b) year, month and animal, in order to look at how use of space changes over different time intervals. These identifier columns can be set up easily in Excel, for example for a) ‘=year*100+animal_id’ would give you space for 100 different animals, and the ID 200107 would indicate animal 7 in 2001. The lion data in the sample file lion\lions.loc was subdivided in this way, the identifiers were set up as ‘year*1000 + month*10 + animal_id’, so 2001101 is animal 1 in October 2001.

Note that the maximum value allowed for an integer value in Ranges is 2,147,483,647.