将列表中的文本转换为数据框

时间:2016-09-20 17:50:58

标签: r list dataframe

我有一个列表,例如它的第二个元素是:

SELECT IssuerLS, Issuer, Ticker, SUM (GLPeriod) As [PNL], ReportDate, 
    CAST(SUM (GLPeriod)/(SELECT Nav AS NavBOM
    FROM Portfolio.DailyStats ds
    WHERE Date = (SELECT CONVERT(CHAR(10),DATEADD(dd,-(DAY(GetDate())-1),GetDate()), 120))) 
    AS Decimal (7,4)) AS[%ofNAV]

FROM Portfolio.DailyPortfolioIssuerLS

WHERE ReportDate BETWEEN 
    (SELECT CONVERT(CHAR(10),DATEADD(dd,-(DAY(GetDate())-1),GetDate()),120)) 
    AND  
    (SELECT CONVERT(CHAR(10),(getdate()),120))
GROUP BY Issuer, Ticker, IssuerLS, ReportDate

我尝试将列表的第二个元素转换为代码datf[2] [[1]] topicML gender "0" "male" sentiment topicV "0" "0" 的数据框,但它不起作用,因为列表不正确,因此代码可以工作。

因此,正如我们所见,列表的每个元素都是文本,我想将其转换为具有以下结构的数据框:

a <- as.data.frame(datf[2])

我该怎么做?

1 个答案:

答案 0 :(得分:0)

您可以尝试以下方法:

public FeedAdapter(Context context, List<ParseObject> yeets) {
        super();

        mYeets = yeets;
        mContext = context;
        this.adapter = this;

        profilePictureImageLoader = new ImageLoader(new ProfilePictureFileCache(mContext));
    }