Announcing the new Datavyu v1.4.0 with enhanced features, bug fixes, and a new video player for Windows!

We are in the process of migrating away from this forum—feel free to browse existing help topics. For new support inquiries, please reach out to us via email at [email protected]

I want to write a script that will automatically add a reliability column for every other cell based on the codes for a pass I've already coded. How do I go about doing this?

In this case, the output should look like:

column1        column2
|cell1|
|cell2|        |cell2|
|cell3|
|cell4|        |cell4|
...

asked 16 Jan '12, 16:03

Jesse's gravatar image

Jesse ♦
11181015
accept rate: 53%


This is really easy to do in a script. To do this we use the function make_rel.

make_rel takes several arguments:

make_rel(relname, var_to_copy, multiple_to_keep, *args_to_keep)
where relname is the name of the reliability column (e.g., "rel.trial")

var_to_copy is the name of the column to base the rel column off of (e.g., "trial")

multiple_to_keep is how many cells you want to skip between each cell. A value of 2 gives every other cell, 4 gives every fourth cell, 1 gives every cell, etc.

*args_to_keep is the list of arguments to carry over from the coded column to the rel column. For example, if I wanted to copy over the onset and offset because I didn't want the rel coder to have to code those, I would use:

make_rel("rel.trial", "trial", 2, "onset", "offset")

The * for args_to_keep simply means you can have as many as you want.

permanent link

answered 27 Jan '12, 08:32

Jesse's gravatar image

Jesse ♦
11181015
accept rate: 53%

edited 27 Jan '12, 08:33

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×11
×11

question asked: 16 Jan '12, 16:03

question was seen: 3,717 times

last updated: 27 Jan '12, 08:33

powered by OSQA