Contact Your Name: Your Email Address: Your Message: 2 Comments Hi Marco, Nice articles on pivots using melt and cast functions! Thanks for sharing :). I need your help in creating multiple pivots using melt and cast function. In the example of your blog, country wise filter is used. How to create different pivots for (eg, USA, UK). ? Need to use any for loops? Please guide me. Need your help. Waiting for reply! Thanks, Prajkta Reply Hi Prajkta, you could be using apply() and variants, but this is a bit of an advanced way to do it. More linearly (but also less efficiently) you can use a for loop on the countries like for (s in unique(dat$Country)) and use the value of s as filtering condition (use subset=) to cast. This should do it. Cheers, Marco. Reply Leave a Reply Cancel reply Your email address will not be published. Required fields are marked * Name * Email * Website Save my name, email, and website in this browser for the next time I comment. This site uses Akismet to reduce spam. Learn how your comment data is processed.