Home » DataWarrior » Functionality » R group count
R group count [message #241] Sat, 11 March 2017 09:00 Go to next message
Messages: 3
Registered: March 2016
Junior Member
Hi Thomas,
First of all let me say what a great bit of software to release for everyone to use.

My question relates to calculating the count of R-groups. I've found the frequency expression in the add calculate value drop down, but this only works by supplying an R-group to calculate for. Is it possible to calculate the frequency of all R-groups in a particular column which I can then use for filtering, e.g. remove all R-groups that only appear once.


Re: R group count [message #249 is a reply to message #241] Tue, 21 March 2017 21:17 Go to previous message
thomas is currently offline  thomas
Messages: 119
Registered: June 2014
Senior Member
Hi Angus, if I understand correctly you could actually use the frequency function: frequency(value, column-name)

If you have a column called 'R-Group', then the two parameters passed to the function are:
frequency(rGroup, "R-Group")

The first parameter is the variable name that refers to the actual R-group in the respective row, while the second
is the column in which this R-Group's occurence is counted. If you for instance have a column that contains 'methyl'
five times and 'ethyl' two times, the a new column is created that has a '5' in every 'methy' row and a '2' in every
row of which the R-group is 'ethyl'.

The trick is to pass a variable as the first parameter and not a static value.

Does this answer your question?

Previous Topic: Option to hyperlink data.
Next Topic: Why is clustering limited up to 10000 molecules?
Goto Forum:

Current Time: Tue Jan 23 12:33:31 CET 2018

Total time taken to generate the page: 0.00267 seconds