RQDA - 项目中每个文件的导出类别
RQDA - Export categories per file in a project
我已经在 RQDA 中编码了一些文本,我正在尝试将类别导出到数据库中。我希望最终结果成为这样的数据框:
Files Categories
File1 Category1
File2 Category2
File3 Category3
File4 Category2
File5 Category1
我尝试了从这里改编的以下代码 Rblogger:
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")
但到目前为止它生成了一个空文件:
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
欢迎任何帮助。
旧电子邮件列表中的一些朋友很友好地帮助了我,所以这里是答案:
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")
祝一切顺利
我已经在 RQDA 中编码了一些文本,我正在尝试将类别导出到数据库中。我希望最终结果成为这样的数据框:
Files Categories
File1 Category1
File2 Category2
File3 Category3
File4 Category2
File5 Category1
我尝试了从这里改编的以下代码 Rblogger:
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")
但到目前为止它生成了一个空文件:
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
欢迎任何帮助。
旧电子邮件列表中的一些朋友很友好地帮助了我,所以这里是答案:
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")
祝一切顺利