Re: [R] Label multiple-line plot

2016-07-19 Thread John Wasige
sc package. There are probably other packages > with tools available now as well, but those are the ones that I am > familiar with. > > > > On Tue, Jul 19, 2016 at 1:36 PM, John Wasige wrote: > > Thanks! It worked for me. > > matplot(for_jhon$ID, for_jhon[,2:

[R] Label multiple-line plot

2016-07-19 Thread John Wasige
d off, so your data did not make it through. > > But try: > > ​​ > matplot(for_jhon$ID, for_jhon[,2:73], type='l') > > > On Tue, Jul 19, 2016 at 12:24 PM, John Wasige > wrote: > > Dear all, > > > > This is to kindly request for your help. I woul

[R] multiple-line plot

2016-07-19 Thread John Wasige
​Dear all, This is to kindly request for your help. I would like to plot my data. The R script below gives some plot that is not clear. How can I get a clear multiple-line plot. The data is attached herewith. ##R Script for_jhon = read.csv("C:/LVM_share/for_ jhon.csv", header=TRUE, sep=";") matp

[R] sub-sample my data in R from two different tables

2015-10-19 Thread John Wasige
​Hi, I need help on how to sub-sample my data in R. I have two tables, one table with global dataset and another with a list of codes for sub sample the global dataset. ​ Download link ​ https://www.wetransfer.com/downloads/a53aa3f722b2d2887b60b09239f7c4e620151018152100/ad852e ​ ​All these tabl

[R] Changing colours for heatmap plot

2015-06-05 Thread John Wasige
​Dear community, Could somebody help on how I can change the colour for this plot in the heatmap plot script below to something like c("green", "green", "black", "green", "green", "black", "black", "green", "green", "black"): ## library(gplots) library(lattice) ### loading data data <- read.

[R] Adding legend

2015-06-03 Thread John Wasige
​Hello community, Could somebody help on how I can ​add ​ a legend to my heatmap plot. I need to know what values from the data do colours ( "red","yellow", "yellowgreen","lightblue4") represent from the data. The script is here below and attached is the test dataset. Thanks for your help. Hohn

[R] Adding legend

2015-06-03 Thread John Wasige
​Hello community, Could somebody help on how I can a legend to my heatmap plot. I need to know what values from the data do colours ( "red","yellow", "yellowgreen","lightblue4") represent from the data. The script is here below and attached is the test dataset. Thanks for your help. Hohn ###

Re: [R] Count number in r

2015-05-19 Thread John Wasige
> > 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] Heatmap

2015-04-28 Thread John Wasige
Dear all, I need to make a heapmap of SPI results for a monthly timeseies of 30 years. Does anybody know to do it? Thanks for your help John [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

[R] regression of values in one stack with another

2015-04-16 Thread John Wasige
D ​ear community, This is to kindly request for your help. I have an error from regression of values in one stack with another # s1 and s2 have 720 layers; coefficients[2] is the slope ### script rstack1 <- stack(s1,s2) s <- stack('D:/Correlation/rstack.tif') fun <- function(x) { lm(x[1:360] ~

[R] Parallel processing

2015-04-11 Thread John Wasige
Dear community, Sory for cross posting. Does anybody have an idea on how I can do parallel in MATLAB? thanks for your help -- John Wasige [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

Re: [R] Aggregating daily rainfall raster data to bimontly data

2015-04-05 Thread John Wasige
Many thanks everybody for your kind help. John​ On Mon, Apr 6, 2015 at 12:11 AM, David Winsemius wrote: > > On Apr 5, 2015, at 2:40 PM, John Wasige wrote: > > > Thanks Jim! > > > > Do you have an idea on how I can go about getting bi-monthly (twice a > > mon

Re: [R] Aggregating daily rainfall raster data to bimontly data

2015-04-05 Thread John Wasige
Live: OO#.. Dead: OO#.. Playing >> Research Engineer (Solar/BatteriesO.O#. #.O#. with >> /Software/Embedded Controllers) .OO#. .OO#. >> rocks...1k >> >> --

Re: [R] Aggregating daily rainfall raster data to bimontly data

2015-04-05 Thread John Wasige
Thanks Bert, The structure of the data is a raster stack with nraw=867, Ncol=995 Rgds John On Sun, Apr 5, 2015 at 6:39 PM, Bert Gunter wrote: > See ?tapply > > However, as John said, without knowing the structure of your data, it > is impossible to provide a guaranteed recipe. For example, do

[R] Aggregating daily rainfall raster data to bimontly ( twice a month) data

2015-04-05 Thread John Wasige
Dear community, I have daily rainfall raster data for 30 years (1982_2011). I would like to aggregate daily to bimonthly (twice a month) raster data. Could somebody kindly help on how to go about it! Thanks for your help JOHN Thanks Kane, bimonthly here means twice a month. [[alternat

[R] Aggregating daily rainfall raster data to bimontly data

2015-04-05 Thread John Wasige
Dear community, I have daily rainfall raster data for 30 years (1982_2011). I would like to aggregate daily to bimonthly raster data. Could somebody kindly help on how to go about it! Thanks for your help -- John [[alternative HTML version deleted]] ___

[R] reprojrecting longitude from 0 - 360 to -180 - 180

2015-02-03 Thread John Wasige
Hello r community, This is to request for help on how to reprojrect longitude from 0 - 360 to -180 - 180 With the following script below, i get output transformed to something like rectangle. Is there a better way of doing it? ### script convert longitude from 0 - 360 to -180 - 180 library(raster)

[R] Reading *.nc4 data

2015-01-26 Thread John Wasige
Dear all, i get the following error when reading *.nc4 data: Error in R_nc_open: No such file or directoryError in open.ncdf("D:/Ag/rst_1980_prate.nc4") : Error in open.ncdf trying to open file D:/Ag/rst_1980_prate.nc4 library("ncdf") prec <- open.ncdf("D:/Ag/rst_1980_prate.nc4") lons <- get.

[R] Error in data.frame

2015-01-21 Thread John Wasige
Hi, Kindly help me out on this error from running SPI package. I am trying to run SPI package with 30 years rainfall data but I get this error: Error in data.frame(dates = dates, spi.plot[, 1:ncolumn]) : arguments imply differing number of rows: 30, 52559 script require("raster") requ

[R] Error in data.frame

2015-01-21 Thread John Wasige
Hi, Kindly help me out on this error from running SPI package. I am trying to run SPI package with 30 years rainfall data but I get this error: Error in data.frame(dates = dates, spi.plot[, 1:ncolumn]) : arguments imply differing number of rows: 30, 52559 script require("raster") requ

[R] Converting ncdf to geoTIFF

2015-01-07 Thread John Wasige
Dear all, This is to request for help on how to convert ncdf data to geoTIFF in R with my script below; my script is: library(raster) library(ncdf) setwd('D:/Lund2015/CRU1982_2011') prec1 <- open.ncdf('D:/Lund2015/CRU1982_2011/ b8_cruts3.20_pre_19820101_20111231_1month_mean.nc') print(prec1) ras

[R] SPI script

2014-12-02 Thread John Wasige
Hello R community, Could somebody kindly help with SPI script for dailly or monthly raster time-series data of rainfall? Thanks for your help Best Rgds John [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUB

[R] PCA on stacked raster (multiple bands/ layers) in R

2014-10-30 Thread John Wasige
Hello community, I need help on how I can perform PCA on stacked raster (multiple bands/ layers) in R. Does any body have an idea or script? Thanks John [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] Putting R script in a function.

2014-10-30 Thread John Wasige
Hello community, I need help on how I can perform PCA on stacked raster (multiple bands/ layers) in R. Does any body have an idea or script? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/m