Learn R Programming

calibrate (version 1.7.7)

ones: Generates a matrix of ones

Description

ones generates a matrix of ones.

Usage

ones(n, p = n)

Arguments

n

number of rows

p

number of columns

Value

a matrix filled with ones.

Details

if only n is specified, the resulting matrix will be square.

See Also

matrix

Examples

Run this code
# NOT RUN {
Id <- ones(3)
print(Id)
# }

Run the code above in your browser using DataLab