Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在R中打印有效/非缺失数据时获取Inf/-Inf错误_R_Plot - Fatal编程技术网

在R中打印有效/非缺失数据时获取Inf/-Inf错误

在R中打印有效/非缺失数据时获取Inf/-Inf错误,r,plot,R,Plot,我想画四分之一的圆 N = 1E1 # set of radiuses r = c(1,2,3,4) # plot quarter-circles plot(0,0) for (i in 1:length(r)) { quadX <- seq(from = 0,to = r[i],length.out = N) # print(quadX) quadY <- sqrt(r[i]^2 - quadX^2) print(quadY) p1 <- po

我想画四分之一的圆

N = 1E1
# set of radiuses 
r = c(1,2,3,4)

# plot quarter-circles
plot(0,0)
for (i in 1:length(r)) {

  quadX <- seq(from = 0,to = r[i],length.out = N) # 
  print(quadX)
  quadY <- sqrt(r[i]^2 - quadX^2) 
  print(quadY)

  p1 <- points(quadX,quadY)
}
plot(p1)

在圣诞节前我发疯之前,任何帮助都将被感谢…

更改初始绘图的边界以查看发生了什么:
plot(0,0,xlim=c(-5,5),ylim=c(-5,5))
@ErrorJordan就在这里。另外,
p1
NULL
,因此无论是
plot(p1)
还是
print(p1)
都不会帮助您,如果您注意到@ErrorJordan这样的绘图限制,您所需要的只是您拥有的代码,减去最后一行
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf