Learn R Programming

isingLenzMC (version 0.2.5)

genConfig1D_R: Generate one dimensional spin sites randomly

Description

The function uses default RNG (Marsienne-Twister) unless changed by the user, within R, to generate a vector that contains 1 or -1. This reflects spin sites. This function is pure R implementation.

Usage

genConfig1D_R(n)

Arguments

n
The number of spin sites on the lattice.

Value

Returns vector that contains 1s or -1s.

Examples

Run this code
  n <- 10 # 10 spin sites
  genConfig1D_R(n)

Run the code above in your browser using DataLab