在R中我们都知道,对于那些我们想要确保处理整数以使用"L"后缀来指定它的方式来说这很方便:
1L
# [1] 1
Run Code Online (Sandbox Code Playgroud)
如果我们没有明确告诉R我们想要一个整数,它会假设我们打算使用numeric数据类型......
str( 1 * 1 )
# num 1
str( 1L * 1L )
# int 1
Run Code Online (Sandbox Code Playgroud)
为什么"L"是首选后缀,为什么不是"我"呢?有历史原因吗?
另外,为什么R允许我做(有警告):
str(1.0L)
# int 1
# Warning message:
# integer literal 1.0L contains unnecessary decimal point
Run Code Online (Sandbox Code Playgroud)
但不是..
str(1.1L)
# num 1.1
#Warning message:
#integer literal 1.1L contains decimal; using numeric value
Run Code Online (Sandbox Code Playgroud)
我希望两者都返回一个错误.
I am currently creating a gif which contains large data. I want it in high resolution.
On my old PC it took hours to render and simply wasn't worth it.
My new PC has a very strong intel i9-9900k core processor which has sped it up to about 30 minutes but R only uses 1 core by default... I have 8 available and it would be great if I could just use them to get the rendering done in under …