不用sqrt实现平方根
Getting a square root of the values in R is easy with the function sqrt() in R. Let’s find how.
使用R中的sqrt()函数可以很容易地在R中获得值的平方根 。 让我们看看如何。
sqrt() is a mathematical function in R, which is helpful to find the square root of the values of a vector. In this tutorial, we will see how to find the square root of the number or a vector in various aspects.
sqrt()是R中的数学函数,有助于查找向量值的平方根。 在本教程中,我们将了解如何在各个方面找到数字或向量的平方根。
The syntax of the R square root function is – sqrt()
R平方根函数的语法为– sqrt()
R中sqrt()的基本用法 (Basic Usage of sqrt() in R)
In this section, we will calculate the square root of a number using the function, sqrt() in R studio.
在本节中,我们将使用R studio中的函数sqrt()计算数字的平方根 。
#assigns a number to 'x'
x<-225
#claculates the square root of the number
sqrt(x)
Output -> 15
输出-> 15
在Vector上的R中使用sqrt() (Using sqrt() in R on Vectors)
Here we will calculate the square root of the values present in a vector. A vector is simply a collection of multiple values. Execute the below code to get the square root of the vector.
在这里,我们将计算向量中存在的值的平方根。 向量只是多个值的集合 。 执行以下代码以获得向量的平方根。