小编Atw*_*p67的帖子

Quanteda kwic将数据附加到输出

我想在kwic输出中附加一些元数据,例如客户ID(见下文),这样就可以很容易地查找主文件.我尝试使用cbind附加数据,但没有正确匹配.

如果这是可能的例子将不胜感激.

     docname    position    contextPre      keyword    contextPost          CustID
     text3790     5    nothing at all looks  good   and sounds great           1
     text3801    11    think the offer is a  good   value and has a lot        3
     text3874    10    not so sure thats a   good   word to use                5
Run Code Online (Sandbox Code Playgroud)

原始数据框架

       CustID   Comment
         1      nothing at all looks good and sounds great
         2      did not see anything that was very appealing
         3      I think the offer is a good value and has a lot of …
Run Code Online (Sandbox Code Playgroud)

r

9
推荐指数
1
解决办法
270
查看次数

ggraph - 根据频率增加节点大小

一直在阅读 Julia Silge 和 David Robinson 所著的 Tidytext Mining with R - https://www.tidytextmining.com/nasa.html - 并且对如何根据频率 (n) 调整节点大小感到困惑。尝试了以下代码...

 library(widyr)
 set.seed(1234)
 title_word_pairs %>%
 filter(n >= 250) %>%
 graph_from_data_frame() %>%
 ggraph(layout = "fr") +
 geom_edge_link(aes(edge_alpha = n, edge_width = n), edge_colour = 
 "royalblue") +
 geom_node_point(aes(size = n)) + scale_size(range = c(2,10)) +
 geom_node_text(aes(label = name), repel = TRUE,
            point.padding = unit(0.2, "lines")) +
 theme_void()
Run Code Online (Sandbox Code Playgroud)

...并收到此错误...

 Error: Column `size` must be a 1d atomic vector or a list
 Call `rlang::last_error()` to see a backtrace …
Run Code Online (Sandbox Code Playgroud)

r ggplot2 ggraph

3
推荐指数
1
解决办法
3360
查看次数

找不到运行时错误1004

我认为这是一个非常简单的代码,用于在工作表中放置所有活动单元格的边框(数据将始终驻留在单元格(1,1)中).但我得到臭名昭着的"运行时错误1004",我很难过.

任何帮助,将不胜感激.

Sub test()
Dim myrange As Range
Dim x, y As Integer
x = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
MsgBox x
'------------------------------'
y = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByColumns).Column
MsgBox y
Set myrange = ActiveSheet.Range(Cells(1, 1), Cells(x, y))
   With ActiveSheet '<-- erroring here'
    .Range(myrange).Select
        With Selection.Borders
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
        End With
    End With
End Sub
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

0
推荐指数
1
解决办法
637
查看次数

标签 统计

r ×2

excel ×1

excel-vba ×1

ggplot2 ×1

ggraph ×1

vba ×1