我想写一个循环来在ggplot中生成多个图。但是,当ggplot接受对象名称时,循环将列名称作为字符串进行迭代。
例如:
select Title
, max(case when FieldName = 'Creator Contact Name' then FieldValue end) as CreatorContactName
, max(case when FieldName = 'Supplier Name' then FieldValue end) as SupplierName
, max(case when FieldName = 'Legal Agreement Name' then FieldValue end) as LegalAgreementName
from PCM_MultiItems_Metadata
WHERE PROFILEID = 254
and fieldname in ('Creator Contact Name','Supplier Name','Legal Agreement Name')
group by Title
知道如何才能正确运行此循环吗?