Is it possible to add comments inside the string in sqldf?
Something like:
sqldf(\'select ProductID, count(distinct SalePrice) as num_regPz
Comments in SQL use this format:
/* Comment goes here */
If you change your code to the following then it should work
sqldf('select ProductID, count(distinct SalePrice) as num_regPz from MYDF where SalesFlag=0 /* coded value to identify regular prizes */ group by ProductID')