// Remove the old recipe
craftingTable.remove(r);

// Add the new recipe
craftingTable.addShaped("n", f, [
    [a, b, c],
    [d, e, f],
    [g, h, i]

]);