[R-sig-eco] Display or save very long matrix

Sarah Goslee sarah.goslee at gmail.com
Wed Sep 21 23:16:58 CEST 2011


Hi,

I'm not sure why you want to display a matrix of that size to the screen, but
why not use write.table() to save it to a file?

>Mat1 <- RasterToColonne(adresse)

If that isn't enough, then we might need to know what the function
RasterToColonne() does. Or is that the function that you only included
half of in your email?

Sarah

On Wed, Sep 21, 2011 at 5:06 PM, momadou sow <momadou at yahoo.fr> wrote:
> Hi,
>
> I extract the coordinates and pixel values on my image. Thus I want to
> display all my matrix and save it in a (. txt) file.
> I used this code:
>
>>library(raster)
>>adresse<-"C:\\Users\\Documents\\DISC D\\\Images282"
>>a <- raster(adresse)
>>CentreRaster <- rasterToPoints(a)
>>PixelColonne <- as.data.frame(CentreRaster)
>>PixelColonne <- cbind(PixelColonne,coordonnee =
> paste(PixelColonne[,1],PixelColonne[,2],sep=" "))
>>colnames(PixelColonne) <-
> c("Longitude","Latitude","ValeurPixel","Coordonnees")
>>return(PixelColonne)
>>}
>>Mat1 <- RasterToColonne(adresse)
>>Mat1[1:5168101,]  # number of rows = 5168101
>
> In the result, I have not all the matrix. Only a part of the matrix
> appears.
> How can I save the entire matrix to a file (. txt)?
>
> Thank you in advance
> Momadou
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>



-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org



More information about the R-sig-ecology mailing list