python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
R: Turning row into columns with NA entries (error using tidyr: spread)
I've the following dataset
Pet Shop
Item
Price
A
dog
300
A
fish
20
A
turtle
50
A
dog
250
A
cat
280
A
rabbit
180
A
cat
270
B
dog
350
B
fish
70
B
cat
220
B
turtle
80
B
fish...
Luther_Proton
Votes: 0
Answers: 1
How to expand dataframe based on two columns?
I am not sure how to solve the following. I am having a dataframe which looks like this:
df <- structure(list(category = c(1, 2, 3, 4, 5), f1 = c(2, 3, 2, 3, 1),
f2 = c(1, 2, 4 ,1, 2)),...
user13069688
Votes: 0
Answers: 2