How to convert image data in matrix form into vector in R?

r
image_processing

#1

I have one data set of a brain image in which Intensity of each pixel is given.In the data set, I have given 50x50 image.So when I have loaded the image in R I am getting 50 columns, so I have transformed into a vector to get the coordinate value of each pixel value but still I am getting same 50 columns.I want to know how I can convert the data into the more readable form.So that I can understand the picture and plot it.

flower = read.csv("flower.csv",header=FALSE)
flowervector2=as.vector(flower)

#2

@sid100158 - You have to first convert into the matrix then you can use the vector command for converting into the vector

flowermatrix = as.matrix(flower)
flowervector2 = as.vector(flowermatrix) 

Hope this helps!

Regards,
Hinduja