幂BI中的R:plot.window(…)中出错:需要有限的“xlim”值
在powerbi中使用R可视化 错误: 只有当我尝试对数据进行子集划分时,才会出现上述错误 通过阅读其他类似的问题,我检查了我的数据类型,它们分别是整数和双精度 我还使用anyis.nadataset检查了数据中的NA值,结果显示没有NA值 当我输入xlim和ylim值时,我的绘图将变为空白 代码:幂BI中的R:plot.window(…)中出错:需要有限的“xlim”值,r,powerbi,R,Powerbi,在powerbi中使用R可视化 错误: 只有当我尝试对数据进行子集划分时,才会出现上述错误 通过阅读其他类似的问题,我检查了我的数据类型,它们分别是整数和双精度 我还使用anyis.nadataset检查了数据中的NA值,结果显示没有NA值 当我输入xlim和ylim值时,我的绘图将变为空白 代码: 我通过使用power bi filtering方法添加我想要的筛选器来修复此错误,而不是像在R中通常那样尝试创建我的数据子集。要完成此操作,请单击图表,在右下角,您将看到一个名为Filters的部分
我通过使用power bi filtering方法添加我想要的筛选器来修复此错误,而不是像在R中通常那样尝试创建我的数据子集。要完成此操作,请单击图表,在右下角,您将看到一个名为Filters的部分,您可以在其中添加列和约束。这很有效!似乎我们不必使用Rscript执行过滤。相反,使用Power Bi过滤器过滤并最终导入数据。
Stack Trace:
Microsoft.PowerBI.ExploreServiceCommon.ScriptHandlerException: R script error.
Error in plot.window(...) : need finite 'xlim' values
Calls: plot -> plot.default -> localWindow -> plot.window
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
Execution halted
---> Microsoft.PowerBI.Radio.RScriptRuntimeException: R script error.
Error in plot.window(...) : need finite 'xlim' values
Calls: plot -> plot.default -> localWindow -> plot.window
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
Execution halted
dataset <- dataset[dataset$Column1=="T1",] #Subset of data I want. All rows where Column1 is equal to T1.
x <- as.numeric(dataset$`Height`) # Integer
y <- as.numeric(dataset$`Pct Pop`) # Double
plot(x, y,
xlim = c(0, 45000),
ylim = c(0, 1.5)
)