实例 R 语言 创建一个复数

x
 
x <- 3+5i
y <- 5i
# Print values of x and y
x
y
# Print the class name of x and y
class(x)
class(y)
                    

输出结果

[1] 3+5i
[1] 0+5i
[1] "complex"
[1] "complex"