49L, 1701L, 1380L, 2153L, 1321L)), .Names = c("X", "Jan", "Feb",
"Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
"Dec"), row.names = c(NA, 6L), class = &q
Dear Jim,
I am asking the sum of malaria cases from Sep to Dec. I am also getting the
plot but which has false values.
After going through them, I found that the script is giving the right
results.
Thanks alot.
Frederic Ntirenganya
Nyanza District,
Data Mnager.
Mobile:(+250)788757619
Email: fr
Hi Guys,
I am trying to sample 100 numbers from 1:100
i did it like this:
sample(1:100,100, replace= TRUE)
but i want again include a constraint that their sum must be equal to 50
How could I do it?
Cheers
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254
remove the zero value.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Tue, Jul 19, 2016 at 9:11 PM, wrote:
> N <- 100
> C <- 50
> x <- numeric(N)
> fo
Hi,
I suggest you use* ts* function which can create timeseries object of your
data. You can also use* subset* function to subset the data for some
particular months. I am not sure whether this can help since I don't have
your data to try.
All the best!
Frederic Ntirenganya
Maseno Unive
Hi All,
I want to compute Mean rain per rain day from rainfall data but i don't
know how to go about that. Anyone who understand the approach I can use can
help me. In addition, I would like to have RScript which can help me to
compute it. thanks.
Regards,
Frederic.
Frederic Ntirenganya
M
Dear All,
Is there a way to not include the row names when creating the list? Thanks!
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
[[alternative
t;- dcast(chick_m, time ~ variable, mean)
i = i + 1
print(table)
}
test(chick_m )
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Wed, Jul 29, 2015 at 5:12 PM, John Kane wro
I want to remove the rownames after incrementation. Thanks
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Wed, Jul 29, 2015 at 7:04 PM, Bert Gunter wrote:
> Is this what
Hi All,
i would like to write a srcipt which ruturn the random numbers which are
binary numbers.
Example: The first group : 1
second : 0
third : 1010111100
in such away that i can make iterartions.
Frederic Ntirenganya
Maseno University
p$Month,
data =BUTemp , type = "b", pch=19)
regn=lm(BUTemp$Tmin + BUTemp$Tmax ~ BUTemp$Year)
abline(regn,col='red',lwd=1.5)
summary(regn)
Thanks for your help.
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)7184928
Thanks Jeff for the Help. it works correctly.
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Sun, Dec 14, 2014 at 11:13 AM, Jeff Newmiller
wrote:
>
&g
If you are reading the data frame using for instance read.csv, you can put
in the argument na.string ="".
Another way to do that is data[data ==] <- NA.
It should be good to tell us how you are reading your dataset.
On Feb 21, 2015 6:49 AM, "Jeff Newmiller" wrote:
> You did not say how y
Hi Steve,
Can you please explain to us your date column? thanks.
Regards,
Fredo.
On Mar 8, 2015 7:32 PM, "Steve Archambault" wrote:
> Hi all,
>
> I am trying in vain to create a new object "Year" in my data frame from
> existing Date data. I have tried many different approaches, but can't seem
to one and print 0
otherwise.
bi <= Aij, print 1 and 0 otherwise.
Any help is appreciated.
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fr
’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.327 on 15115 degrees of freedom
(72 observations deleted due to missingness)
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims
Thanks for the help.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Wed, Mar 25, 2015 at 4:48 PM, S Ellison wrote:
>
> > Call:
> > lm(formula = curr
df1
df2 <- melt(df1 , id = 'Date', variable_name = 'start of Rains')
df2
ggplot(df2, aes(Date,value)) + geom_line(aes(colour ="red"),type = "h")
Kindly any help is welcome. Thanks
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African M
100
100 125 174
5 1956-01-01 123 1266.44492
92 119 119
6 1957-01-01 124 1235.96492
92 112 112
Frederic Ntirenganya
Maseno Univ
problem.
df1 <-data.frame(data)
df1
df2 <- melt(df1 , id = 'Date', variable_name = 'start of Rains')
df2
ggplot(df2, aes(Date,value)) + geom_line(aes(colour ="red"),type = "h")
Kindly any help is welcome. Thanks
Regards,
Frederic.
Frederic Ntirengan
92
> 92 11
> 1957-01-01 124 1235.96492
> 92 11"
>
> library(reshape)
> library(ggplot2)
>
> Data <- read.table(text=zz, header = TRUE)
>
> df1 <-data.frame(Data)
>
> df
ot;, "Tmin"), row.names = c(NA, 6L), class = "data.frame")
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Tue, Mar 31, 2015 at 4:46 PM, Fre
[2]==mon,c(1,4)] # rain just for a specific month
for (yr in 1979:2009) {
month_tot[yr-1978,mon]=sum(rain[rain[,1]==yr,2])
raindays[yr-1978,mon]=sum(rain[rain[,1]==yr,2]>threshold)
}
}
month_tot
}
Regards,
Frederic.
Frederic Ntirenganya
Maseno U
i = 3
for (i in 1:ncol(month_tot)){
quarter[i] = sum(month_tot[,i])
}
quarter
}
total(kitale)
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On
Dear All,
I am getting this error: Error in boxplot$Month : object of type 'closure'
is not subsettable
The following is the codes i am using to produce the boxplot I need for
this daily rainfall data.
## reading the data
rm(list=ls(all=TRUE))
Bungoma=read.csv("/home/fredo/Documents/Maseno/Data/
are/Embedded Controllers) .OO#. .OO#. rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> On August 5, 2014 4:33:33 AM PDT, Frederic Ntirenganya
> wrote:
> >Dear All,
Month))
title(main="Boxplot of Rain for each month")
#
The error is :
> boxplot(bungoma_rain,
> names=c("J","F","M","A","M","J","J","A&q
Dear All,
Thanks for your help.
My problem is solved.
I was using the boxplot as a name and function at the same time.
Beast wishes,
Fredo.
On Wed, Aug 6, 2014 at 9:39 AM, Frederic Ntirenganya
wrote:
> The major problem is that I am using the same code in another dataset and
>
180
4 1933 156 294138
5 1934 116 291175
6 1935 134 288154
Any idea is welcome. Thanks!!!
Cheers.
--
Frederic Ntirenganya
Maseno University,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
[[alternative
Thanks All. Your idea is useful!!!
On Tue, Oct 7, 2014 at 1:01 PM, Jim Lemon wrote:
> On Tue, 7 Oct 2014 11:51:34 AM Göran Broström wrote:
> > On 2014-10-07 11:27, Jim Lemon wrote:
> > > On Tue, 7 Oct 2014 10:32:42 AM Frederic Ntirenganya wrote:
> > >> Dear All,
Oct 15
Any idea is welcome. Thamks
--
Frederic Ntirenganya
Maseno University,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
[[alternative HTML version deleted]]
__
R-help@r-project.org mail
Apr 28 Oct 15
3 1932 115 295180 Apr 24 Oct 21
4 1933 156 294138 Jun 05 Oct 21
5 1934 116 291175 Apr 26 Oct 18
6 1935 134 288154 May 14 Oct 15
Is there a way to that in R?
On Tue, Oct 7, 2014 at 3:25 PM, Frederic Ntirenganya
wrote:
> Thanks All. Your idea is useful!!!
But 60% of the dates in your data.frame will then be wrong.
>
>
> From: Frederic Ntirenganya
> Reply: Frederic Ntirenganya >
> Date: October 8, 2014 at 9:38:34 AM
> To: r-help@r-project.org >
> Subject: [R] Data formart
>
> Dear All,
>
> Change the format
11:54 AM, Jim Lemon wrote:
> On Wed, 8 Oct 2014 04:49:02 PM Frederic Ntirenganya wrote:
> > The idea is that I want the non-leap years to be 366 days instead of
> being
> > 365 days. ie. Each year must have 366 days.
> >
> > for example: in the column Start2, Apr 18 wi
Lemon wrote:
> On Thu, 9 Oct 2014 12:30:57 PM Frederic Ntirenganya wrote:
> > Hi Lemon,
> >
> > I am using the code you sent. It's correct for the leap years.
> > What I want to do is to have both leap and no-leap years to have 366
> days.
> > that means
; http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Frederic Ntirenganya
Maseno University,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
[[alternative HTML version d
Hi Pikal,
I am not talking about changing calender, I need this in my analysis.
On Thu, Oct 9, 2014 at 3:27 PM, PIKAL Petr wrote:
> Hi
>
> > -Original Message-
> > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> > project.org] On Behalf Of Frede
=
On Thu, Oct 9, 2014 at 3:48 PM, Duncan Murdoch
wrote:
> On 09/10/2014, 8:27 AM, PIKAL Petr wrote:
> > Hi
> >
> >> -Original Message-
> >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> >> project.org] On Behalf Of Frederic Ntireng
ay=j
break
}
Samaru56$year=Samaru56$Year[sow_day]
Samaru56$Day=Samaru56$Day[sow_day]
Samaru56$Rain=Samaru56$Rain[sow_day]
}
sow_day
Any idea is welcome on how I can solve this problem. Thanks
--
Frederic Ntirenganya
Maseno University,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://
results in
> >TRUE value
> >
> >Samaru56[sel,]
> >
> >selects these rows
> >
> >Regards
> >Petr
> >
> >> -Original Message-
> >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> >> project.org] O
tive 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-c
ore than 20 mm on a single day, or
totalled
over 2 consecutive days with the additional condition that there is no 10
day (or longer) dry spell in the next 30 days.
Any help is appreciated. Thanks!!!
Regards,
Frederic.
--
Frederic Ntirenganya
Maseno University,
Kenya.
Mobile:(+254)718492836
Em
weer en binden het INBO onder geen enkel beding, zolang dit bericht niet
> bevestigd is door een geldig ondertekend document.
> The views expressed in this message and any annex are purely those of the
> writer and may not be regarded as stating an official position of INBO, as
>
fo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg,
ainfall)){
for (j in 1:length(Wb30$Evaporation)){
}
}
wb<-Wb30$Water_Balance[w] + Wb30$Rainfall[i+1]-Wb30$Evaporation[j+1]
}
wb
Any suggest of what I am missing for it to work correctly is welcome.
Regards,
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mob
f(w<0){
w=0
}
wb=Wb30$Water_Balance[w-1] + Wb30$Rainfall[w]-Wb30$Evaporation[w]
}
wb
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Thu, Oct 23, 2014
0 5 0
2 8 10 5NA
3 90 5NA
4 100 5NA
5 112 5NA
6 12 23 5NA
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African
er_Balance[iday] <- Wb30$Water_Balance[iday-1] +
Wb30$Rainfall[iday] - Wb30$Evaporation[iday]
if (Wb30$Water_Balance[iday]<0){
Wb30$Water_Balance[iday]=0
}else if(Wb30$Water_Balance[iday]>100){
Wb30$Water_Balance[iday]=100
}
}
Regards,
Frederic.
Frederic Ntirenganya
Hi All,
I wrote this script to calculate the water balance using the following
formula:
Water_Balance = Water_Balance yesterday + Rainfall - Evaporation.
The code works well and I want to put into a function.
conditions: Water_Balance<0 is equal to 0.
Water_Balance>100 is equal
2 0 4.2 11
.. . . . . .
.. . . . . .
.. . . . . .
Any ideal on how I can make this function is welcome. thanks!
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...
of how I can make this function is welcome. Thanks
Regards,
frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
[[alternative HTM
Hi Daniel,
How can I add an if conditiopn or for loop to implement this in my
function?
ex: option1 : single date
option2: date in 3 columns (year,moth,day)
yday(Sys.Date())
yday(as.Date(paste(y,m,d,sep="-")))
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
Afr
Dear All,
I would like to Write a function that creates a Date column stored as a
factor given a date column stored as string in a dataframe. Any idea is
more helpful.
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr
12 27 13.6 362
11317 200912 28 42.2 363
11318 200912 29 53.6 364
11319 200912 30 19.8 365
11320 2009 12 31 0.5 366
Thanks for the help.
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@
vailable (for R version 3.0.2)
I tryied to download it's zip file but not get it.
Anyone help me on how I can do it. Thanks
Regrads,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.g
; \usepackage{adjustbox}
Error: unexpected input in "\"
> \usepackage{listings}
Error: unexpected input in "\"
I am using ubuntu 14.04.
I don't understand the input it is talking about.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mob
I got it. I should use compile not run option.
Thanks All.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Tue, Nov 11, 2014 at 4:08 PM, Frederic Ntirenganya
wrote:
> Tha
cified then all climate_data objects will be taken by
default
climate_data_objs = get_climate_data_objects(climate_data_objs_str,
climate_data_objs_ind)
})
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.c
=year)
out[[year -(min(unique(data[[year_col]]))-1)]] <- dcast(dat,
dat[[day_col]]~dat[[month_col]], value.var="Water_Balance")
#add column names as month
colnames(out[[year
-(min(unique(data[[year_col]]))-1)]])[2:13]<-month.abb[1:12]
}
out
}
Any help is appreciated!!!
Regards
() # NAs due to non recording values
for (i_NA in indicNAs ){
if(data$Rain[i_NA] == 60){
ind_nonleap <- append(ind_nonleap,i_NA)
}
else {
ind_nonrecord<-append(ind_nonrecord,i_NA)
}
#cat(ind_nonrecord)
#cat( ind_nonleap)
}
ind_nonleap
Regards,
Frede
As
[1] 426 792 1158 1890 2256 2622 3354 3720 4086 4818 5184
5550 6282 6648 7014 7746 8112
[18] 8478 9210 9576 9942 10674 11040 11406 12138 12504 12870 13602
13968 14334 15066 15432 15798 16530
[35] 16896 17262 17994 18360 18726 19458 19824 20190
Regards,
Frederic.
Frederic
Hi,
If you are using Rstudio, why not using sweave function! I think this can
fix your problem since you don't have miktex on your window machine.
Cheers.
On Feb 26, 2016 6:37 AM, "Ulrik Stervbo" wrote:
> This message tells you what is wrong and the solution:
>
> No TeX installation detected (T
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=oa-2115-c>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr..
de = c(30.11, 30.11, 30.11, 30.11, 30.11, 30.11),
Latitude = c(-1.95, -1.95, -1.95, -1.95, -1.95, -1.95)), .Names = c("Year",
"Month", "Day", "WindSpeed", "Sunshine", "Tmax", "Tmin", "Hmax",
"Hmin", &qu
Thanks. It is helpful!
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Fri, Dec 30, 2016 at 5:58 PM, Achim Zeileis
wrote:
> On Fri, 30 Dec 2016, Frederic Ntirenganya wr
Dear All,
Could you please give me a hint on how to overcome this error?
Here is the code:
data("constants")
constant1<-constants
constant1$lat<-dat1$Latitude[1]
constant1$lat_rad<-0.10123
dat1<-omit(dat1)
# ReadInputs climate data
data <- ReadInputs(dat1, constant1,
stopmis
4, 5115, 5116, 5117, 5118), class = "Date")), .Names = c("Year",
"Month", "Day", "Wind.Speed", "n.daily", "Tmax.daily", "Tmin.daily",
"RHmax.daily", "RHmin.daily", "Station.Name", "Elevat
It seems like it is from sirad packages.
Thanks for the help.
Cheers
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fr...@aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
On Fri, Mar 24, 2017 at 4:28 PM, PIKAL Petr wrote:
>
ily = c(2.57222, 2.057776,
2.057776, 1.543332, 2.57222, 3.086664), Date = structure(c(5113,
5114, 5115, 5116, 5117, 5118), class = "Date"), DOY = c(1,
2, 3, 4, 5, 6)), .Names = c("Year", "Month", "Day", "Wind.Speed",
"n.daily", &
69 matches
Mail list logo