The data_set function sets a value within a nested array or object using "dot" notation:
<?php $data = ['products' => ['desk' => ['price' => 100]]];

data_set($data, 'products.desk.price', 200);