I'm trying to study times in which flow was operating at a given level or
greater. To do so I have created a way to see how long the series has
operated at a high level. But for some reason the data is calculating the
runs one hour to long. Any ideas on why?
Code:
I'm trying to create a custom function to return a chart object. This
function seems to be having an error with calculating min/max/etc in the
ggplot object.
If I run the code for the ggplot not inside a custom function it works.
To reproduce this error after I need to clear the memory with
I'm trying to create a map of transmission lines in Alberta. In addition, I'm
very new to creating maps.
The data can be found at: http://geogratis.gc.ca/site/eng/download
http://ftp2.cits.rncan.gc.ca/pub/canvec/doc/CanVec_distribution_formats_en.pdf
Would someone be able to point me in the
I'm trying to have two legends on a chart, with two sets of data with
subgroups. Currently ggplot is are merging the to sets of data together.
I would like to have the vertical lines in there own legend and not affect
the colour shading or show up in the type legend.
How would I go about doing
I'm getting this error: Error in MOPrice$Date : $ operator is invalid for
atomic vectors
The cost is: subset(MOPrice,
as.Date(MOPrice$Date,%Y-%m-%d)==as.Date(2013-11-28,%Y-%m-%d))
The date column looks like:
2013-12-31 2013-12-31 2013-12-31 2013-12-31 2013-12-31
--
View this message in
, Col3SomeMadeupnumbers)
Also, Nov. 2, 2008 02 is when there was a time change.
David Winsemius wrote
On Mar 24, 2014, at 3:35 PM, jcrosbie wrote:
I'm having a problem working with daylight savings dates in R.
I'm downloading data in two formats.
Format One Col 1: a date such as 11/03
I'm having a problem working with daylight savings dates in R.
I'm downloading data in two formats.
Format One Col 1: a date such as 11/03/2013 col 2: Hour ending = 02*
Col1-c(11/02/2008*, 11/02/2008, 11/02/2008, 11/02/2008)
Col1-c(02*, 02, 03, 04)
Another data set is something like this:
I'm trying to figure out how to import data into a dataframe in R.
The table I'm trying to import is:
HistoricalTradingReportServlet.csv
http://r.789695.n4.nabble.com/file/n4687246/HistoricalTradingReportServlet.csv
I would like to add two more column for each block of data to have the
I'm trying to create a function to return the date x months in the past.
With the code below I'm getting the warning message:
Warning message:
In if (MonthsBack = CurrentMonth) { :
the condition has length 1 and only the first element will be used
##
DateBack -
Why am I know getting hours after I convert the date?
dates - c('31/12/2013 0:00', '31/12/2013 1:00', '31/12/2013 2:00',
'31/12/2013 3:00', '31/12/2013 4:00', '31/12/2013 5:00', '31/12/2013
6:00', '31/12/2013 7:00', '31/12/2013 8:00', '31/12/2013 9:00',
'31/12/2013 10:00', '31/12/2013
This function returns date/times without timezone
strptime(dates,format=%d/%m/%Y %H:%M)
--
View this message in context:
http://r.789695.n4.nabble.com/why-is-as-date-function-not-working-for-me-dd-mm--h-mm-tp4684874p4684895.html
Sent from the R help mailing list archive at Nabble.com.
Thanks. as.POSIXct works for the most part. The only problem is part of data
I'm working has it's own time zone. Is there a way to not have a time zone
displayed? My times do not change with Daylight saving.
--
View this message in context:
Thank you for all your help. I'm still not able to figure out how automate
downloads from online websites.
This is a daily function to download the needed data. I would also like to
be able to do this on other websites such as:
There are some CSV file from the link below.
I'm having trouble installing the package. Is this the package I have to use
or is there another one I need to use? If so how do I get this one loaded.
https://www.enmax.com/Power/Energy+Retailers/Settlement+Reports/Profile+settlement+report.htm
Hi, I'm trying to download data from:
http://www.ngx.com/settlehistory.html
Is it possible to fetch the data with R?
Thank you
--
View this message in context:
http://r.789695.n4.nabble.com/Download-data-tp4668138.html
Sent from the R help mailing list archive at Nabble.com.
How to I go about adding a legend to the following plot?
ggplot() + geom_line(aes(x=df2010$Price,y=df2010$percentCapacity), colour =
red)
+ geom_line(aes(x=df2011$Price,y=df2011$percentCapacity), colour = green)
+geom_line(aes(x=df2012$Price,y=df2012$percentCapacity), colour = blue)
I can't figure out why this function wont work.
#Custom Function used
fallInBand - function(x){
#Assume the bands fall go up form 0 to 100 in intervals of 5 then from 100
to 1000 in intervals of 100.
#returns the location (band number)
if (is.na(x) == FALSE) {
if(x 100) {#bands of 5
I would like to create a subtotal table with custom bands.
seq1 = seq(0, 100, by = 5)
seq2 = seq(100, 1000, by = 100)
Bands = c(seq1, seq2)
#Prices
Prices = sample(1:1000, 200, replace=F)
#corresponding size for the given price above.
size = sample(1:1000, 200, replace=F)
How would I
to 2040
Thank you
From: arun kirshna [via R] ml-node+s789695n4646484...@n4.nabble.com
To: jcrosbie ja...@crosb.ie
Sent: Wednesday, October 17, 2012 10:32 AM
Subject: Re: subtotals based on price bands?
Hi,
May be this helps:
seq1 = seq(0, 100, by = 5
The aggregate function for some reason will now work for me.
The error I'm getting is:
Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?
agPriceList=aggregate(PriceList$Size, list(PriceList$bandNum),sum)
*Price list dataframe:*
dput(PriceList)
I would like to create a frequency table with custom bands.
seq1 = seq(0, 100, by = 5)
seq2 = seq(100, 1000, by = 100)
Bands = c(seq1, seq2)
Prices = sample(1:1000, 200, replace=F)
How would I go about find the frequency of prices within each band?
--
View this message in context:
I have two data frames. One with a matrix of months and the other with a
matrix of values. The two dataframes correspond to each other. I would like
to sum up all the values in by month.
What would be an efficient way to do this?
a=C(2,3,5,2,3,5)
b=c(2,6,3,2,6,3)
c=c(2,6,7,2,6,5)
months -
I would like to output a nicely formatted data frame to a bitmap.
Is this possible in R?
--
View this message in context:
http://r.789695.n4.nabble.com/Table-Frame-output-tp4636790.html
Sent from the R help mailing list archive at Nabble.com.
__
Thank you, That was very helpful.
I do have another problem along the same lines. But I can not think of a way
to do this with a function like ddply or aggregate.
Example:
x = sample(0:1,42,TRUE)
[1] 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 1 1 0 1
1 1 0 0 0 0
I want to
Thank you,
I am sorry but I am still trying to figure out how to make the function
work.
I have a column called tUnitsort$BlockNumber which can range from 0 to 6.
I have another two columns with the date and the hour ending for the given
day.
Example
DateHour BlockNumber MyTo
To: jcrosbie ja...@crosb.ie
Sent: Thursday, July 12, 2012 3:12 PM
Subject: Re: remove loop which compares row i to row i-1
Hello,
I've not been following this thread but this seems ndependent from
previous posts. Try the following.
url - http://r.789695.n4.nabble.com/file/n4636337/BR3_2011_New.csv
Thank you,
I tired
ifelse(tUnitsort[length(tUnitsort$Hour),4]=tUnitsort[-1,4],(tempMC
=tUnitsort[length(tUnitsort$Hour),7]),tempMC )
But this doesn't seem to work.
Where am I going wrong?
--
View this message in context:
I would like to remove a loop to speed up my code.
I want to remove a loop which references the last row.
In general I want to a remove a loop which looks something like this:
for 2 to number of rows in a matrix do{
if indextrow-1 is currentIndexRow then do something.
}
My R code:
I have a number of different figures I wish to create with a gradient
background. In addition to the two examples I've uploaded I need a boxplot,
histogram, etc.
http://r.789695.n4.nabble.com/file/n4634932/fig1.png fig1.png
http://r.789695.n4.nabble.com/file/n4634932/fig2.png fig2.png
--
Thank you, that was very helpful.
Would it be possible to rename the legend values as well. Example 1 as
Biomass, 2 as coal, 4 as gas, 5 as hydro?
ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat,
fill=as.factor(FuelTypeNum))) +
geom_bar(position=stack, stat=identity)+
How would I find the Percent of FuelTypeNum within the Band given
AvailableMW?
example:
type 1 is 1% of PB0
type 2 is 54% of PB0
type 4 is 4% of PB0
type 5 is 42% of PB0
Note: the Bands and fuel types are not always constant.
Data:
FuelTypeNum Bands AvailableMW
For a given hour I want to be able to add a new column called flag. The
flag column will flag the highest price in a given hour. Is there a way to
do this without a loop?
matrix:
Unit, Day,Hour, Price, Flag
afd11/2/20031 1 N
afd11/2/20031 2
I'm expecting the legend to be 1,2,4,5,10 not 2,4,6,8,10.
Is there away I can set my own colour and legend tittles?
--
View this message in context:
http://r.789695.n4.nabble.com/ggplot-incorrect-legend-tp4632471p4632529.html
Sent from the R help mailing list archive at Nabble.com.
Thank you for your help.
I would expect FuelTypeNum to make up the legend. But in the legend there
is an extra value of called '3' and in the chart there is an extra
FuelTypeNum.
code:
ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat,
fill=FuelTypeNum)) +
geom_bar(position=stack,
I'm not the one who is choosing to use gradient background. It's our company
policy.
--
View this message in context:
http://r.789695.n4.nabble.com/plot-background-excel-gradient-style-background-tp4632138p4632409.html
Sent from the R help mailing list archive at Nabble.com.
How do I create a legend with ggplot?
I think should be getting the FuelTypeNum in the legend.
Plot:
http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg
My code is:
ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) +
geom_bar(position=stack, stat=identity) +
Is there away of putting an excel style gradient background? I want to have
dark blue in the middle and shad to white on the top and bottom.
--
View this message in context:
http://r.789695.n4.nabble.com/plot-background-excel-gradient-style-background-tp4632138.html
Sent from the R help mailing
I can not get the point function to work with in my code.
The code:
AggOfTempMatrix$CumSumPercentSize-c(
0.05265450, 0.05738490, 0.05865403, 0.05911553, 0.05957703, 0.06003854,
0.06058368,
0.06098750, 0.06147208, 0.06187589, 0.06291427, 0.06331808, 0.06354884,
0.06408533,
0.06489296,
38 matches
Mail list logo