[R] showing the image
Hi everyone, I have a matrix containing color values of an image same as following, [1,] #44 #44 #434343 #404040 #3D3D3D #3D3D3D #3E3E3E [2,] #414141 #414141 #414141 #404040 #3F3F3F #3F3F3F #3F3F3F [3,] #3E3E3E #3E3E3E #3F3F3F #404040 #404040 #404040 #404040 [4,] #3E3E3E #3D3D3D #3E3E3E #404040 #414141 #414141 #404040 [5,] #3E3E3E #3E3E3E #3F3F3F #3F3F3F #3F3F3F #3F3F3F #3E3E3E [6,] #3E3E3E #3F3F3F #3E3E3E #3D3D3D #3B3B3B #3C3C3C #3B3B3B I wonder if there is any function that helps me to show the image. Thanks, Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] bmp
Hi R users, I already had post this question under the title of bmp header, there was a mistake in my post. The following is the same post without the mistake. Thanks Rostam I have a xml file. A value of one of the nodes of the xml file is a bmp image encoded in base64. I would like to read this image by R. I think I should do the following steps: 1. Decoding it from base64 to binary. 2. Removing the header of the image file 3. building the matrix So I wonder if you know how to do the following using R functions: 1. decode from base64 to binary. base64decode does not decode to binary. The binary file should be an openable bmp file. 2. Remove the header of bmp image and produce a matrix which has the color values. My main goal is producing the matrix which has the color values, if the aforementioned steps don't look plausible, what is your suggested steps. Right now I produce the matrix, using the following steps, but I wonder if I can avoid using Image Magic and python. 1. Decoding from base64 to binary using a python function. After decoding I have a openable image file. 2. Converting bmp format to pnm using Image Magic program 3. Reading pnm format using pixmap library in R. The function read.pnm produces a pixmap object 4. Producing matrices using pixmap object Thanks for your help, Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] bmp header
Hi R users, I have a xml file. A value of one of the nodes of the xml file is a bmp image(RAW format) encoded in base64. I would like to read this image by R. I think I should do the following steps: 1. Decoding it from base64 to binary. 2. Removing the header of the image file 3. building the matrix So I wonder if you know how to do the following using R functions: 1. decode from base64 to binary. base64decode does not decode to binary. The binary file is an openable bmp file. 2. Remove the header of bmp image and produce a matrix which has the color values. My main goal is producing the matrix which has the color values, if the aforementioned steps don't look plausible, what is your suggested steps. Right now I produce the matrix, using the following steps, but I wonder if I can avoid using Image Magic and python. 1. Decoding from base64 to binary using a python function. After decoding I have a openable image file. 2. Converting bmp format to pnm using Image Magic program 3. Reading pnm format using pixmap library in R. The function read.pnm produces a pixmap object 4. Producing matrices using pixmap object Thanks for your help, Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] converting rgb() output to 0-255
Hi, I have three matrices, Red, Green and Blue. I would like to produce a matrix which is the combined values of Red, Green and Blue matrices. I know rgb() does the job, but the values are not between 0-255, they are in the following format: #2C312C I would like to have the values between 0-255. I wonder if you could tell me what I can do... Thanks for your help, Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] number of an element in a matrix
Hi, I wonder if there is any function which gives the number of times which an element is repeated in the matrix. Let say there is a matrix, I would like to find out how many times number 2 has been repeated in the matrix, or in other words, how many elements of the matrix are equal 2. Thanks for your help, Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] max size of a matrix
Hi R users, I am trying to create a matrix, but R has problem with the size of dim, wondering if there is anything that I can do? a - diag(147456) Error in array(0, c(n, p)) : 'dim' specifies too large an array Thanks for your help Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] creating image using RGB values
Hi R users, I would like to create an image using three matrices which contain the values of Red, Green, and Blue of each pixel, i.e. one matrix which has values of red, one which has values of green, and one which has values of blue. The values are between 0 and 1 instead of 0-255. I have obtained the matrices using the getChannels of pixmap library. I wonder if anyone knows how to create the image using RGB matrices. Thanks for your help. Thanks, Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Running external python script
Hi R users, I have a python script. Assume that I would like to run this external python script when executing a R script or command line R. I don't know how to this using R code. I really appreciate if you could help me. Thanks for your help Rostam [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Running external python script
mac os X On Sun, May 11, 2008 at 8:24 PM, Rolf Turner [EMAIL PROTECTED] wrote: On 12/05/2008, at 11:17 AM, rostam shahname wrote: Hi R users, I have a python script. Assume that I would like to run this external python script when executing a R script or command line R. I don't know how to this using R code. I really appreciate if you could help me. Thanks for your help ?system ## Attention:This e-mail message is privileged and confidential. If you are not theintended recipient please delete the message and notify the sender.Any views or opinions presented are solely those of the author. This e-mail has been scanned and cleared by MailMarshal www.marshalsoftware.com ## [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.