首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RQDA -导出项目中每个文件的类别

RQDA -导出项目中每个文件的类别
EN

Stack Overflow用户
提问于 2020-02-12 19:30:36
回答 1查看 87关注 0票数 0

我已经在RQDA中编写了许多文本,我正在尝试导出数据库中的类别。我希望最终的结果是一个数据帧,如下所示:

代码语言:javascript
复制
Files   Categories
File1   Category1
File2   Category2
File3   Category3
File4   Category2
File5   Category1

我尝试了下面的代码,它是我从这里改编的Rblogger

代码语言:javascript
复制
categories <- RQDAQuery("select filecat.name as category, source.name as filename 
                         from treefile, filecat, source 
                         where treefile.catid=filecat.catid and treefile.fid=source.id and treefile.status=1")

但到目前为止,它已经产生了一个空文件:

代码语言:javascript
复制
str(categories)
'data.frame':   0 obs. of  2 variables:
 $ category: chr 
 $ filename: chr 

> dim(categories)
[1] 0 2
> summarise(categories)
data frame with 0 columns and 1 row

欢迎任何帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-19 21:56:12

一个旧电子邮件列表中的一些朋友非常友好地帮助了我,所以答案如下:

代码语言:javascript
复制
codings <-RQDAQuery("select s.name as 'filename', f.name as 'codes' from source s, 
                   coding c, 
                   freecode f where s.id = c.fid and c.cid = f.id and s.status = 1 order by s.name")

categories <- RQDAQuery("select s.name as 'filename', 
                    co.name as 'categories' from source s, 
                    coding c, freecode f, codecat co, 
                    treecode tr where s.id = 
                    c.fid and c.cid = f.id and co.catid = 
                    tr.catid and tr.cid = f.id and s.status = 1 and c.status = 1 and 
                    f.status = 1 order by s.name")

万事如意

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60187383

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档