Accounting for cost of material issued for R&D - but not in Cost of Goods Sold

As the title says, I need to account for the cost of material that I issue from stock (using the Stock Entry function) for R&D purposes. In the General Ledger I can see that ERPnext automatically assign a material issue to Cost of Goods Sold, but I would like it to be assigned to an indirect expense account instead. Where can I change this?

I have already created a project assigned to the Research & Development Department, that project has a newly created Research & Development Cost Center connected to it based on what I read here. In the Stock Entry tool I’m assigning the material issue to that project, but I currently can’t get it to show up anywhere but in the Cost of Goods Sold account.

Ah I think I may have figured it out. When I do a Stock Entry → Material Issue and then add an item, I can click on the arrow to the right of that line, where I can now change the Difference Account and Cost Center.