Page 203 - Data Science class 11
P. 203

class(x)
                class(y)
            Run to see the following in the console panel:

























            6.2.3 complex

            A complex number is the sum of a real number and an imaginary number. A complex number is expressed in standard
            form when  written as a + bi, where a is the real part and bi is the imaginary part. Complex numbers (the sum of
            real and imaginary numbers) occur quite naturally in the study of quantum physics and in electrical engineering
            techniques most of the time.
            Example
            Enter the following code snippet in the script panel:

                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)
            Run to see the following in the console panel:


























                                                                                         Programming with R    201
   198   199   200   201   202   203   204   205   206   207   208