2

Is there a way to increase the number of words appearing before and after the keyword in Quanteda kwic function?

I've tried by changing the numeric value in:

options(width = 200)

but it didn't work. @KenBenoit

4

1 回答 1

3

options(width)影响 R 解释器显示的文本列数。您希望window参数kwic()

>  kwic(data_corpus_inaugural, "war against")
                                               contextPre     keyword                         contextPost
 [1857-Buchanan, 2933:2934] advantage of the fortune of [ war against ] a sister republic, we
 [1901-McKinley, 2284:2285]         . We are not waging [ war against ] the inhabitants of the Philippine
 [1901-McKinley, 2299:2300]  portion of them are making [ war against ] the United States. By
 [1901-McKinley, 2413:2414]    used when those who make [ war against ] us shall make it no
[1933-Roosevelt, 1851:1852]   Executive power to wage a [ war against ] the emergency, as great
>  kwic(data_corpus_inaugural, "war against", window=7)
                                                       contextPre     keyword                                  contextPost
 [1857-Buchanan, 2933:2934] to take advantage of the fortune of [ war against ] a sister republic, we purchased these
 [1901-McKinley, 2284:2285]      be deceived. We are not waging [ war against ] the inhabitants of the Philippine Islands.
 [1901-McKinley, 2299:2300]      . A portion of them are making [ war against ] the United States. By far the
 [1901-McKinley, 2413:2414]  needed or used when those who make [ war against ] us shall make it no more.
[1933-Roosevelt, 1851:1852]   - broad Executive power to wage a [ war against ] the emergency, as great as the
于 2016-05-25T13:17:30.343 回答