PIquadrant: Preference Index calculator

Description Usage Arguments Details Value


Calculates preference indices for alternating quadrant sections of optogenetic protocol (section 4 and 5).


PIquadrant(trx, by.fly = F)



input track data frame (must include preference, sectiontimer and rept). Realistically it also requires the usual trx columns (in particular id)


boolean to decide whether you calculate PI by section (of the 4 in the standard protocol, arranged by section id x repeat) or by fly id (collating all sections together for each fly)


Frankly I can't remember what happens in this function and that is why you should document this shit when you write it. I think it picks out the last 5s of each quadrant section and averages the distribution for each fly (by.fly=T) or each repeat of the protocol (by.fly=F). However I see a lot of weird NA-based analysis in the code and I can't remember what it's for.


A data frame with the PI for each fly (if by.fly is true) or by section and repeat (if by.fly is false).

PaolaCognigni/CTraxHelper documentation built on May 7, 2019, 11:57 p.m.