You can use facets. It seems you cannot stack and dodge at the same time (see related posts below). You can add another factor to your data for the x variable and facet on your names variable to come up with something like this:
Edit: Adjusted width of bars to have bars touching as per comments. See here: Remove space between bars ggplot2.
library(ggplot2)
p <- ggplot(data = df, aes(x = place, y = values, colour = num, fill = num))
p <- p + geom_bar(stat = "identity", width = 1, position = "stack")
p <- p + facet_grid(. ~ names)
p
It looks like you can adjust the margins of the facets to make the ABC groups look closer together if you're interested. For some examples, see these related posts:
ggplot2 - bar plot with both stack and dodge
ggplot2 geom_bar position = "dodge" does not dodge
Plotting a stacked bar plot?
Edited data with added "place" factor:
df <- structure(list(names = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 3L, 3L, 3L, 3L), .Label = c("A", "B", "C"), class = "factor"),
num = structure(c(1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L,
3L, 4L), .Label = c("aaa", "bbb", "ccc", "total"), class = "factor"),
values = c(1, 2, 3, 7, 2, 2, 5, 10, 3, 4, 2, 9), position = structure(c(1L,
1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 2L), .Label = c("nums",
"total"), class = "factor")), .Names = c("names", "num",
"values", "place"), row.names = c(NA, -12L), class = "data.frame")