R: randomize order of one column of a data.frame

I have a dataframe like this:

df1 <- data.frame(A=c("xx", "be", "zz", "jj"), B=c("xyx", "bea", "cce", "ggg"), C=c("ges", "xyz", "cce", "edga"))

I want to generate TWO random dataframe based on df1. For each of the random dataframe, I expect the column A and column B remains the same. But only the order of column C can be altered.

Can I do it with R? If yes, could you teach me how to do so?

Thanks a lot.

5
задан Prasad Chalasani 31 May 2011 в 17:08
поделиться