kandi X-RAY | iiht Summary
kandi X-RAY | iiht Summary
Log your 'If I have time I'll ****' wishes and:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of iiht
iiht Key Features
iiht Examples and Code Snippets
Community Discussions
Trending Discussions on iiht
QUESTION
I've got a cross-tab frequency table where the measure is CAG and columns A01, A02 etc are frequency counts. i.e. 6485 counts of 13 CAG, 35 counts of CAG 14.
I'm trying to:
- Set all values in A01, A02 etc that are <0.2 the size of the highest value in that column (i.e. exclude those not meeting a 20% threshold).
- Normalise each value in A01, A02 etc by dividing each value in that column by the sum of all values in that column. This will give a value between 0-1 for each row in the column.
- Multiply each value in A01, A02 etc by the change in CAG. Change in CAG is the value in the CAG column minus the modal CAG value.
- I then need to sum all the values in each column.
I've had a stab at it here, but unfortunately I'm not sure how to progress further. Would appreciate any help!
...ANSWER
Answered 2017-Jun-26 at 19:53Hi I would not go with base R for data manipulation, although this is possible. I would use either data.table or dplyr packages for that.
I have to note that this is not the only way to go and the overhead of data table has to be taken into account and then decide between the two aforementioned packages.
Since you have n
number of columns, I think that the use of .SD
along with .SDcols
is what you need in data.table terms.
For example let say you have A01 to A0n columns. Then you can have:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install iiht
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page