如何增加 R 中 max.print 的限制

我在 R 中使用 Graph软件包对5461个项目进行 maxclique 分析。

我得到的最终输出项非常长,因此我得到了以下警告:

达到 getOption("max.print")-省略475569行

有没有人能给我指点一下如何提高极限 max.print.

261261 次浏览

See ?options:

options(max.print=999999)

Use the options command, e.g. options(max.print=1000000).

See ?options:

 ‘max.print’: integer, defaulting to ‘99999’.  ‘print’ or ‘show’
methods can make use of this option, to limit the amount of
information that is printed, to something in the order of
(and typically slightly less than) ‘max.print’ _entries_.

set the function options(max.print=10000) in top of your program. since you want intialize this before it works. It is working for me.

I fixed it just now. But it looks busty. Anyone make it simple please?

def list_by_tag_post(request):


# get POST
all_tag = request.POST.getlist('tag_list')


arr_query = list(all_tag)


for index in range(len(all_tag)):
tag_result = Tag.objects.get(id=all_tag[index])


all_english_text = tag_result.notes.all().values('english_text', 'id')


arr_query[index] = all_english_text






for index in range(len(arr_query)):


all_english_text = all_english_text | arr_query[index]




# Remove replicated items
all_english_text = all_english_text.order_by('id').distinct()




# render
context = {'all_english_text': all_english_text, 'all_tag': all_tag}
return render(request, 'list_by_tag.html', context)

You can use the options command to change the max.print value for the value limit you want to reach. For example:

options(max.print = 1000000)

There you can change the value of the max.print in R.