red <- apply(red, 2, jitter)
The above is my current code. After applying it to my data frame, I noticed the strength of it to be quite small.
If I try the following, it doesn't work:
red <- apply(red, 2, jitter(red, factor = 5))
red <- apply(red, 2, jitter)
The above is my current code. After applying it to my data frame, I noticed the strength of it to be quite small.
If I try the following, it doesn't work:
red <- apply(red, 2, jitter(red, factor = 5))
Copyright © 2021 Jogjafile Inc.
I don't think you need
apply()for this at all, at least, not if I understand your intention. Here's an example using theamountparameter and someirisdata.From the docs,
amountis described as:First I use
apply()as your example, then I increase the jitter without it.Increasing
factoralso does work, but it's just potentially less apparent dependent on the distribution of the data.Yet another approach is to take the difference of your data's values with and without jitter to get the components that's pure jitter and multiple that by any number you like and add it back to the original data.