Re: [R] How to read a file with two data sets in text format

2013-01-21 Thread Janesh Devkota
I was able to read the data using the following code: jd1 - read.table('Practicedata.dat',header=T,sep=\t,nrow=6240) jd2 - read.table('Practicedata.dat',header=T,sep=\t,skip=6241) colnames(jd1) - c(Date,Mod) colnames(jd2) - c(Date, Obs) p - ggplot(jd1,aes(x=Date,y=Mod))+geom_line() p - p +

[R] Very slow in processing the equation in the scatter plot ggplot

2013-01-21 Thread Janesh Devkota
://www.dropbox.com/s/1xrgvnge0prf0a6/dataset.csv Thank you so much. Best Regards, Janesh Devkota [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Very slow in processing the equation in the scatter plot ggplot

2013-01-21 Thread Janesh Devkota
Dear Ista, Thank you so much for the prompt reply. Yes, using the annotate instead of the geom_text definitely speed up my graph and look much better. Thanks. Best Regards, Janesh Devkota On Mon, Jan 21, 2013 at 3:46 PM, Ista Zahn istaz...@gmail.com wrote: Hi, One problem is that you

[R] Faceting in ggplot with 3 series in each plot

2013-01-21 Thread Janesh Devkota
me if this question is very naive. Best Regards, Janesh Devkota [[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

[R] How to assign time series to a vector with one leap year

2013-01-22 Thread Janesh Devkota
Hello All, I am trying to do the time series analysis in R and I want to assign a vector as a time series. The data I provided is hourly. The data is from Jan 1 2008 to Dec 31 2009. How can I assign the data such that the first year is leap year and second is not ? airtemp -

[R] Summary of data for each year

2013-01-31 Thread Janesh Devkota
Hello All, I have a data with two columns. In one column it is date and in another column it is flow data. I was able to read the data as date and flow data. I used the following code: creek - read.csv(creek.csv) library(ggplot2) creek[1:10,] colnames(creek) - c(date,flow) creek$date -

[R] low pass filter analysis in R

2013-02-06 Thread Janesh Devkota
Hello R users, I am trying to use R to do the low pass filter analysis for the tidal data. I am a novice in R and so far been doing only simple stuffs on R. I found a package called signal but couldn't find the proper tutorial for the low pass filter. Could anyone point me to the proper tutorial

Re: [R] low pass filter analysis in R

2013-02-07 Thread Janesh Devkota
. Is that correct ? Thank you so much Janesh On Thu, Feb 7, 2013 at 6:07 AM, Bretschneider SIG-R brets...@xs4all.nlwrote: Dear Janesh Devkota, Sorry, I forgot an edit. The last command should read: yfiltered = signal:::filter(myfilter, y) # apply filter Best wishes, Franklin

[R] Clip a contour with shapefile while using contourplot

2013-02-14 Thread Janesh Devkota
Hi, I have done the interpolation for my data and I was able to create the contours in multipanel with the help of Pascal. Now, I want to clip the contour with the shapefile. I want only the portion of contour to be displayed which falls inside the boundary of the shapefile. The data mydata.csv

[R] Interpret R-squared and cor in R

2013-02-15 Thread Janesh Devkota
Hi I am trying to find the relationship between two variables. First I fitted a linear model between two variables and I found the following results: Residual standard error: 0.03253 on 2498 degrees of freedom Multiple R-squared: 0.5551, Adjusted R-squared: 0.5549 F-statistic: 3116 on 1 and 2498

[R] Any R package to do the harmonic analysis

2013-02-19 Thread Janesh Devkota
Hi R Users, I was wondering if there is any R package available to do the harmonic analysis of tide. Any suggestion is highly appreciated. Janesh [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Converting the data in year month day hour and minutes to date

2013-02-19 Thread Janesh Devkota
Hi , I am trying to convert the date as factor to date using as.date function in R. I have the date in the following format 2008-01-01 02:30 I tried to use the following command : as.Date(mydata$Date, format=%y-%m-%d ) Can somebody help me with this ? I was able to convert the

[R] ADCP data processing in R

2013-03-12 Thread Janesh Devkota
Hello R Users, I have ADCP (Acoustic Doppler Current Profiler) data measurements for a river and I want to process these data using R. Is there a R package to handle ADCP data ? Any suggestions are highly appreciated. Thanks. Janesh [[alternative HTML version deleted]]

[R] Is it possible to create a html file by using shiny in Windows ?

2013-03-16 Thread Janesh Devkota
Dear R users, I have just started using Shiny in R. I can run the program using R on my local computer but I don't know how can I create the html file on my local server. Can you guys suggest how can I proceed to create a html file on my computer in Windows interface ? Thanks. Janesh

[R] Convert to date and time of the year

2013-03-18 Thread Janesh Devkota
Dear R Users, I have data for more than 3 years. For each year I want to find the day corresponding to Jaunary 1 of that year. For example: x - c('5/5/2007','12/31/2007','1/2/2008') #Convert to day of year (julian date) - strptime(x,%m/%d/%Y)$yday+1 [1] 125 365 2 I want to know how to

[R] Read ADCP data in R

2013-03-19 Thread Janesh Devkota
://www.dropbox.com/sh/owian354auah6h3/379D5spA2X. If anyone could help me how to read this kind of ADCP, I would highly appreciate. Thanks. Janesh Devkota [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Solving tridiagonal matrix in R

2013-04-08 Thread Janesh Devkota
Dear R Users, I am trying to solve a tridiagonal matrix in R. I am wondering if there is an inbuilt R function or package to solve that. I tried looking on google but couldn't find something that would help directly. Any help is highly appreciated. Thanks. Janesh [[alternative HTML

[R] Solving an integral in R gives the error “The integral is probably divergent”

2013-04-08 Thread Janesh Devkota
I am trying to solve an integral in R. However, I am getting an error when I am trying to solve for that integral. The equation that I am trying to solve is as follows: $$ C_m = \frac{{abs{x}}e^{2x}}{\pi^{1/2}}\int_0^t t^{-3/2}e^{-x^2/t-t}dt $$ [image: enter image description here] The code

Re: [R] Plot two separate curves in R Graphics and R Lattice package

2013-04-09 Thread Janesh Devkota
Hi, This should be fairly easy by using base R graphics. Lets suppose your first data is represented by (x1,y1) and second data is represented by (x2,y2) You can use the following command. plot(x1,y1,type=l) points(x2,y2) Hope it helps. On Tue, Apr 9, 2013 at 8:24 PM, jpm miao

[R] Read the data from a text file and reshape the data

2013-04-11 Thread Janesh Devkota
I have a data set for different time intervals. The data has three comment lines before data for each time interval. For each time interval there are 500 data points. I want to change the dataset such that I have the following format: t1t2t3

Re: [R] Read the data from a text file and reshape the data

2013-04-11 Thread Janesh Devkota
Hi Jim, Yes, this is exactly what I was looking for. The code works perfect. Thanks a lot for your time and effort. Best, Janesh Devkota From: jim holtman [mailto:jholt...@gmail.com] Sent: Thursday, April 11, 2013 7:32 PM To: Janesh Devkota Cc: R mailing list Subject: Re: [R] Read

Re: [R] Read the data from a text file and reshape the data

2013-04-12 Thread Janesh Devkota
Hi Arun, Thank you so much for your answer. It surely does help. Having to know different approaches for the same problem has given me more insights on R language. I appreciate your time and effort. Best, Janesh Devkota On Thu, Apr 11, 2013 at 10:00 PM, arun smartpink...@yahoo.com wrote: Hi

Re: [R] Solving an integral in R gives the error The integral is probably divergent

2013-04-12 Thread Janesh Devkota
: Friday, April 12, 2013 1:32 PM To: Thomas Lumley Cc: Janesh Devkota; groep R-help Subject: Re: [R] Solving an integral in R gives the error The integral is probably divergent But is it supposed to be t^{-3/2} or t^{-0.5}?? The formula has the former and the code the latter, and the integral

Re: [R] Change the default resolution for plotting figures?

2013-04-16 Thread Janesh Devkota
I have been using the following so far without having any problems: dev.copy(png,sample.png,width=8, height=10, units=in,res=500) dev.off() On Tue, Apr 16, 2013 at 6:32 PM, jt...@mappi.helsinki.fi wrote: Hi, I want to save a plot in the windows device as png and the default resolution is

Re: [R] Merge

2013-04-17 Thread Janesh Devkota
Hi, I have a quick question here. Lets say he has three data frames and he needs to combine those three data frame using merge. Can we simply use merge to join three data frames ? I remember I had some problem using merge for more than two dataframes. Thanks. On Wed, Apr 17, 2013 at 1:05 AM,

Re: [R] Merge

2013-04-17 Thread Janesh Devkota
0.1328287 0.2467554 A.K. From: Janesh Devkota janesh.devk...@gmail.com To: Farnoosh farnoosh...@yahoo.com Cc: arun smartpink...@yahoo.com; R help r-help@r-project.org Sent: Wednesday, April 17, 2013 1:05 PM Subject: Re: [R] Merge Hi, I have a quick

[R] Subsetting a large number into smaller numbers and find the largest product

2013-04-18 Thread Janesh Devkota
number. Any help is highly appreciated. Best Regards, Janesh Devkota [[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

Re: [R] how to subtotal by rows

2013-04-19 Thread Janesh Devkota
Hello Shyam, This is one way to do it jd1 - read.table(text= fid year rice wheat maize 11995 5NA NA 11995 NA3 NA 11995 NA NA 2 11996 4NA NA 11996

Re: [R] how to subtotal by rows

2013-04-19 Thread Janesh Devkota
You can also use this short command. library(plyr) ddply(jd1,.(fid,year),colSums,na.rm=T) Janesh On Fri, Apr 19, 2013 at 2:30 PM, Janesh Devkota janesh.devk...@gmail.comwrote: Hello Shyam, This is one way to do it jd1 - read.table(text= fid year rice wheat maize 1

Re: [R] how to subtotal by rows

2013-04-19 Thread Janesh Devkota
8 4 #4 2 19967 6 7 A.K. - Original Message - From: Janesh Devkota janesh.devk...@gmail.com To: shyam basnet shyamabc2...@yahoo.com Cc: r-help@R-project.org r-help@r-project.org Sent: Friday, April 19, 2013 3:30 PM Subject: Re: [R] how to subtotal by rows

Re: [R] Spider Plot

2013-04-19 Thread Janesh Devkota
Xing, I cannot open the attachment. Can you attach the png file or pdf or any other format ? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of XINLI LI Sent: Friday, April 19, 2013 3:30 PM To: r-help Subject: [R] Spider Plot Does