Musicnotation: Function Musicnotation

Description Usage Arguments Value Author(s) References Examples

View source: R/Musicnotation.R

Description

A function to visualize interaction wit a musicnotation graph.

Usage

1
Musicnotation(data_sheet, ...)

Arguments

data_sheet

either a data.frame f.e imported from a data sheet containing
"Name","item.number"
"action.from.","action.to","kind.of.action"
"name.of.action","action.number","classification","weighting"

or only "action.from.","action.to","kind.of.action"if exists actions and items

actions: with "name.of.action","action.number","classification","weighting
items: with "Name","item.number"
Setting a behaviour to 2 means it is count double

...

Additional parameters:

colors

a factor of colors as much as actions

lwd

line width if lwd_arrows is not used also for line width arrows

# TODO check this it not working -> no show_items all items will be shown

show_items

items to be shown

angel_arrows

The angel aof the arrow head default 20

length_arrows

the length of the arrow default 0.05

lwd_arrows

the line width of the arrows default 1

actions_colors

a vector of colors for actions f.e to show one special action

starting_time

builds the graph with data between starting and ending time

ending_time

builds the graph with data between starting and ending time

user_colors

a vector of colors as much as items to show different colors for items

color_bits

a vector of colors as much as items 1 shows the horse colored 0 in black (defined with actions_colors)

#'

Value

returns a list with
ADI - the Average Dominance index

Author(s)

Knut Krueger, Knut.Krueger@equine-science.de

References

Chase, I. D. (2006). Music notation: a new method for visualizing social interaction in animals and humans. Front Zool, 3, 18. doi: 10.1186/1742-9994-3-18

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ #you can eihter use:
data_sheet=data.frame   ("action.from"=c(1,4,2,3,4,3,4,3,4,3,4,3,4,3,4),
                         "action.to"=c(4,1,1,4,3,4,3,4,3,4,3,4,3,4,3),
                         "kind.of.action"= c(4,1,1,4,3,4,3,4,3,4,3,4,3,4,3),
                         "Time"=c('03:15:00','03:17:30','03:20:00','03:20:30','03:21:00',
                                  '03:21:30','03:22:00','03:22:30','03:23:00','03:23:30',
                                  '03:25:00','03:25:30','03:26:00','03:26:30','03:27:00'),
                         stringsAsFactors=FALSE)
items= data.frame ("Name"=c("item1","item2","item3","item4","item5","item6") ,
                   "item.number"=c(1:6),stringsAsFactors=FALSE)
actions=data.frame("name.of.action"= c("leading","following","approach","bite","threat to bite",
                                      "kick","threat to kick", "chase","retreat"),
                  "action.number"=c(1:9),
                  "classification"=c(1,2,1,1,1,1,1,1,2) ,
                  "weighting"=c(1,-1,1,1,1,1,1,1,-1),stringsAsFactors=FALSE)
# set colors for special encounters
color= c("green","green","red","red","red","red","red","red")    

Musicnotation(data_sheet=data_sheet,actions=actions,items=items,sort_dominance=TRUE)
#or you can use a complete f.e Excel sheet
#you can save this data as basic excel sheet to work with
data(data_Musicnotation)
Musicnotation(data_sheet=data_Musicnotation,sort_dominance=TRUE) }

Dominance documentation built on Feb. 23, 2021, 5:13 p.m.