1

I have a dataframe with 67 items that looks like this:

df <- data.frame("item"= c("item1", "item2", "item3", "item4", "item5"), "variable1"=c(10.51, 16.54, 12.35, 9.44, 20.11), "variable2"=c(15.65, 25.68, 14.48, 19.87, 30.21), "variable3"=c(19.35, 45.86, 39.25, 39.43, 34.08))

Now I want an even subsample of items, where, if it was only one variable, I would want every 7th item, but since I have three variables I want a subsample which comes closes to all three variables being evenly spread out over the value frame for each variable.

I was thinking of creating 'bins' of data where I cluster items with similiar values for each variable, but I would still not know how to execute this in R Somebody?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.