简体   繁体   English

R的新手。我正在尝试从mlbench软件包的Glass $ Fe中将0.00值添加.01。

[英]New to R. I am trying add .01 the 0.00 values in the Glass$Fe from the mlbench package

I don't what to assign the 0.00 as NA but by simply adding .01 to all values that are 0.00. 我没有将0.00分配为NA的方法,而只是将.01添加到所有0.00值中。 I need this to eliminate an error using symbox from the car package. 我需要这样做来消除在汽车包装中使用symbox引起的错误。

symbox(Glass$Fe, data=Glass, powers=c(3,2,1,0,-0.5,-1,-2)) Error in bc1(out, lambda) : First argument must be strictly positive. symbox(Glass $ Fe,data = Glass,powers = c(3,2,1,0,-0.5,-1,-2))bc1(out,lambda)中的错误:第一个参数必须严格为正。

My instructor recommended not to remove the 0.00 values just make them slightly positive. 我的教练建议不要删除0.00值,只是使它们稍微偏正即可。

Thanks, 谢谢,

一个更完整的问题将包括代码,以加载任何包含symbox程序包以及示例数据集,但是如果唯一的愿望是将Glass $ Fe .01的值移向正值,则尝试:

symbox(Glass$Fe+0.01, data=Glass, powers=c(3,2,1,0,-0.5,-1,-2))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我是 r 的新手。我试图通过使用 for 循环使我的代码不那么复杂 - I am new to r. I am trying to make my code less complicated by using a for loop R。 我正在尝试将我的数据框子集几十年。 因此,我想通过使用列的值进行子集化 - R. I am trying to subset my data frame by decades. Therefore I want to subset by using values of a column 如何根据 2 个条件 R 将 2 行中的值相加? - How to add values from 2 rows together based on 2 conditions R.? 我是 r 的新手。 如何将数据框变量值从数字转换为名称? 请参阅下面的代码 - I am new to r. How can I convert a data frame variable value from a number to a name? See code below 我正在尝试使用 R 获取矩阵中列的乘积。 我究竟做错了什么? - I'm trying to take the product of the columns in a matrix using R. What am I doing wrong? 我正在尝试在 R 中创建一个带有 while 循环的 Collat​​z 序列。我在这个 while 循环中做错了什么? - I am trying to create a Collatz sequence with while loop in R. What am i doing wrong in this while loop here? R.从插值中获取值 - R. Taking values from interpolation R 的新手。我有一组来自 Stata 的代码,我想在 R 中重现 - New to R. I have a set of codes from Stata that I wanted to reproduce in R 如何使用基于现有数据框的值创建新数据框,并使用R中的数字向量创建范围。 - How to create a new dataframe with values based on existing data frame and range from numeric vectors in R. R中的IF语句 满足条件时在新列中添加新元素 - IF statement in R. Add new elements in new column if conditions met
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM