I would like to create a heatmap of this sample data. I am using this code to generate the graph. The x and y represent the coordinates of an image. I need the heatmap to show the avarge time for each machine_name. Any advise please?
ggplot(df, aes(x, y), fill = n ) + geom_tile()
Sample Data
data.frame(stringsAsFactors=FALSE,
machine_name = c("A",
"B",
"C",
"A",
"D",
"H",
"L",
"O",
"E",
"Q"),
x = c("4",
"4",
"2",
"56",
"2",
"87",
"45",
"89",
"4",
"5"),
y = c("",
"8",
"8",
"63",
"85",
"44",
"5",
"5",
"85",
"56"),
averge_time = c("2.3",
"2.3",
"50",
"6.0",
"56",
"2.5",
"8.9",
"8.9",
"8.9",
"10.5"),