Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

generate random integer matrix in r

Ads

 
 

Share on Google+Share on Google+

Java Coder
generate random integer matrix in r
1 Answer(s)      6 days ago
Posted in : Big Data

Hi,

I want to generate random integer matrix in r. What is easy code to generate random integer matrix in r?

Thanks

Ads
View Answers

July 15, 2017 at 11:37 AM


Hi,

Following is the code for generating random integer matrix in r:

> matris=matrix(rnorm(10),5,20)
> matris
            [,1]        [,2]        [,3]        [,4]        [,5]        [,6]        [,7]        [,8]
[1,] -0.17799498  0.52392041 -0.17799498  0.52392041 -0.17799498  0.52392041 -0.17799498  0.52392041
[2,]  0.61320533 -0.91478734  0.61320533 -0.91478734  0.61320533 -0.91478734  0.61320533 -0.91478734
[3,]  0.27800008  0.34493587  0.27800008  0.34493587  0.27800008  0.34493587  0.27800008  0.34493587
[4,] -0.56614955  0.05737407 -0.56614955  0.05737407 -0.56614955  0.05737407 -0.56614955  0.05737407
[5,] -0.08075231 -0.72216461 -0.08075231 -0.72216461 -0.08075231 -0.72216461 -0.08075231 -0.72216461
            [,9]       [,10]       [,11]       [,12]       [,13]       [,14]       [,15]       [,16]
[1,] -0.17799498  0.52392041 -0.17799498  0.52392041 -0.17799498  0.52392041 -0.17799498  0.52392041
[2,]  0.61320533 -0.91478734  0.61320533 -0.91478734  0.61320533 -0.91478734  0.61320533 -0.91478734
[3,]  0.27800008  0.34493587  0.27800008  0.34493587  0.27800008  0.34493587  0.27800008  0.34493587
[4,] -0.56614955  0.05737407 -0.56614955  0.05737407 -0.56614955  0.05737407 -0.56614955  0.05737407
[5,] -0.08075231 -0.72216461 -0.08075231 -0.72216461 -0.08075231 -0.72216461 -0.08075231 -0.72216461
           [,17]       [,18]       [,19]       [,20]
[1,] -0.17799498  0.52392041 -0.17799498  0.52392041
[2,]  0.61320533 -0.91478734  0.61320533 -0.91478734
[3,]  0.27800008  0.34493587  0.27800008  0.34493587
[4,] -0.56614955  0.05737407 -0.56614955  0.05737407
[5,] -0.08075231 -0.72216461 -0.08075231 -0.72216461
>

Tutorial: R Programming tutorial


Ads









Related Tutorials/Questions & Answers:
generate random integer matrix in r
generate random integer matrix in r  Hi, I want to generate random integer matrix in r. What is easy code to generate random integer matrix in r? Thanks   Hi, Following is the code for generating random integer
How to create a random matrix in r?
How to create a random matrix in r?  Hi, I want to create random matrix in R programming language. How to create a random matrix in r? Explain me with the good example code. Thanks   Hi, In R Programming language
Advertisements
Generate Random Numbers
Generate Random Numbers  hi,,, Please give me answer with example How do you generate random numbers within a given limit with actionscript... This function generate random numbers with in given limit
generate random numbers and display the largest
generate random numbers and display the largest  Hi, I am using... ArrayRandom{ public static void main(String args[]){ Random r = new Random... creates an array and fills it with random ints, prints the contents
How to generate random number in java
How to generate random number in java In this section you will learn how to generate random number in java. Java API  provide a random class in java.util.Random package which generate random number within a range. The random
how to generate random questions - Java Beginners
how to generate random questions  i am designing a test engine, i..."; Random generator = new Random(); int r = generator.nextInt(questionAr.length); System.out.println(questionAr[r]); } } Thanks
Generate random numbers from 1 to 100
Generate random numbers from 1 to 100  1)A class Called: RandomNumberGenerator that generate random numbers from 1 to 100 2)A class Test that tests... an object from the Random NumberGenerator class to generate your input test data
Generate random numbers in Java
Generate random numbers in Java - How to use the java.util.Random class to generate desired random number in Java program? In this tutorial I will teach you... the randomGenerator.nextInt(num) method to generate the random number. The java.util.Random class
How do I generate random number?
How do I generate random number?  In my Java program..., The java.util.Random class can be used to generate the random numbers. Check the tutorial: Generate random numbers in Java. Thanks
Generate array of random numbers without repetition
Generate array of random numbers without repetition In the previous section, you have learnt how to generate an array of random numbers from the given array... created an application that will generate the array of random numbers without
Default constructor generate two random equations
Default constructor generate two random equations  Need to create a default constructor in a programmer defined class that generates a random question, addition or subtraction. And when adding the numbers must be random from 0-12
J2ME Random Number
J2ME Random Number       In this application we are going to generate the random number using Random class. The Random class within the java.util package and we can use
random number
random number   Please How do I generate a program that gives me random integer from 115 to 250? Using java.util.random. Thank you very much!  ...[] args){ int min = 115; int max = 250; Random random = new Random
Generate shuffling in the specified list
list1 = Arrays.asList(employee); // create object of Random class to generate number randomly. Random num = new Random(); // shuffle and print the list according to the generated random number
CROSSFIRE O/R
CROSSFIRE O/R       ?CROSSFIRE O/R? is a product to generate Java Program instead of human. We can generate Java Program executing SQL by using JDBC with this product
transpose matrix
integers into the matrix and print the transpose of it. for this program u r given answer but if i entered 2 by 3 matrix it will not give answer ple check it once
Generating Random Number
for your application. Random Number is the frequently used to generate numbers... understand and use the code to generate random numbers in your java application. The Random class of java.util package can be used to generate a random
matrix addition
matrix addition  hai
matrix addition
matrix addition  hai
matrix substraction
matrix substraction  hai
matrix substraction
matrix substraction  hai
using random number
using random number  generate a 10 digit number using random number and display the length of longest increasing series
matrix adddition
matrix adddition   how to write a program matrix addition in java
random numbers
random numbers  hi.. i am creating a website and on feedback form to authenticate user i want to generate a random number on label.if user types that number correctly in textbox then he is allowed to submit feedback otherwise
Generate array of random numbers
Generate array of random numbers You can generate a random number either by using the Random class or by using the static method Math.random() but it is better to use Random class. If you want to generate a series of random numbers
column matrix
column matrix  columan wise total matrix
column matrix
column matrix  columan wise total matrix
Matrix multiplication
Matrix multiplication  program to read the elements of the given two matrices of order n*n and to perform the matrix multiplication
using random number
using random number  generate 10 number and display the length of longest incresing series
using random number
using random number  generate 10 digit number and display the length of longest incresing swries
understanding buttons :JSP random no program
[]){ Random r = new Random(); int start = 100, end = 200... to generate 1 random no public class TestRandom { public static void main(String args[]){ Random r = new Random(); int start = 100, end = 200