I have to create a data base,
for that i have my values and their occurences in a dataframe made of 2 columns..
For instance i have the figure 1.44 and i know that it appears 10 times; then i have the figure 1.95 and i know that it appears 14 times.. So i have to create a database where they will be 1.44 appearing ten times, 1.95 appearing 14 times... But i have no idea of how i can do that ..
And do you know (to go faster) if we can directly name our columns to create the dataframe :
DF <- data.frame(Size = c(column A), Occurence = c(column B)) ?
And a last question, if i have a third column the code would be like :
DF <- data.frame(Size = c(column A), Occurence = c(column B); c(column A), Occurence = c(column C)) ?
You don't need to do that, that part of the code is just to provide some made up sample data to work with for reproducibility purposes, you can simply use your own data frame instead. The key to solve your problem is the uncount() function.
To better understand why the solution given to you includes code to create a dataframe, please read the guide on this link