Re: [R] quadratic model with plateau

2012-04-07 Thread Gabor Grothendieck
On Sat, Apr 7, 2012 at 3:58 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Fri, Apr 6, 2012 at 9:42 PM, help ly help.ly2...@gmail.com wrote: Dear All, I would like to make a quadratic with a plateau model in R. Is there a package in R doing this? The bentcableAR package seems won't

Re: [R] assigment operator question

2012-04-07 Thread Gabor Grothendieck
On Sat, Apr 7, 2012 at 5:01 PM, Mark Heckmann mark.heckm...@gmx.de wrote: Thanks! I'll try to stick to that advice! Maybe there is a better way... Here is what I want: I want to save some default settings for a package. The user can change these using a function similar to par(). I do not

Re: [R] quadratic model with plateau

2012-04-07 Thread Gabor Grothendieck
) should read    x - seq_along(y)    cheers,        Rolf On 08/04/12 10:08, Gabor Grothendieck wrote: On Sat, Apr 7, 2012 at 3:58 PM, Gabor Grothendieck ggrothendi...@gmail.com  wrote: On Fri, Apr 6, 2012 at 9:42 PM, help lyhelp.ly2...@gmail.com  wrote: Dear All, I would like to make

Re: [R] is parallel computing possible for 'rollapplyr' job?

2012-04-05 Thread Gabor Grothendieck
On Thu, Apr 5, 2012 at 9:18 AM, Pam fkira...@yahoo.com wrote: Hi, The code below does exactly what I want in sequential mode. But, it is slow and I want to run it in parallel mode. I examined some windows version packages (parallel, snow, snowfall,..) but could not solve my specific

Re: [R] Trying to merge new data set to bottom of old data set. Both are zoo objects.

2012-04-04 Thread Gabor Grothendieck
On Wed, Apr 4, 2012 at 1:47 AM, knavero knav...@gmail.com wrote: Here's a case where it doesn't work. Again, the problem is that when I use the rbind or concatenate functions, the 2012 data set seems to go ahead of the 2010 and 2011 portions of the data set. The problem seems dependent on the

Re: [R] regression for poisson distributed data

2012-04-03 Thread Gabor Grothendieck
On Tue, Apr 3, 2012 at 9:58 AM, Joachim Audenaert joachim.audena...@pcsierteelt.be wrote: Hello all, I would like to get parameter estimates for different models. For one of them I give the code in example. I am estimating the parameters (i,j and k) with the nls function, which sees the error

Re: [R] regression for poisson distributed data

2012-04-03 Thread Gabor Grothendieck
On Tue, Apr 3, 2012 at 11:03 AM, David Winsemius dwinsem...@comcast.net wrote: On Apr 3, 2012, at 9:58 AM, Joachim Audenaert wrote: Hello all, I would like to get parameter estimates for different models. For one of them I give the code in example. I am estimating the parameters (i,j and

Re: [R] filling small gaps of N/A

2012-04-03 Thread Gabor Grothendieck
On Tue, Apr 3, 2012 at 4:52 AM, jeff6868 geoffrey_kl...@etu.u-bourgogne.fr wrote: Hi everybody, I'm a new R french user. Sorry if my english is not perfect. Hope you'll understand my problem ;) I have to work on temperature data (35000 lines in one file) containing some missing data (N/A).

Re: [R] summaryBy: transformed variable on RHS of formula?

2012-04-02 Thread Gabor Grothendieck
On Mon, Apr 2, 2012 at 11:58 AM, Alexander Shenkin ashen...@ufl.edu wrote: Hi Folks, I'm trying to cut my data inside the summaryBy function.  Perhaps formulas don't work that way?  I'd like to avoid adding another column if possible, but if I have to, I have to.  Any ideas? Thanks, Allie

Re: [R] clear console

2012-03-31 Thread Gabor Grothendieck
On Sat, Mar 31, 2012 at 8:09 AM, mrzung mrzun...@gmail.com wrote: hi, I use  R - 2.15(32bit), and want to make a code to clear a console. Actually, I used to run following code to do that but after update the version of R from 2.14 to 2.15, it doesn't work. cls - function (t) {        

Re: [R] clear console

2012-03-31 Thread Gabor Grothendieck
On Sat, Mar 31, 2012 at 9:53 AM, Rui Barradas rui1...@sapo.pt wrote: Hello, Try cls2 - function(lines=25) cat(rep(\n, lines)) cls2() It's simpler, and doesn't need any special package. (In my system, R 2.14.1/Windows 7, i386 or x64,  '\f' didn't work.) This may or may not be important

Re: [R] subtract a list of vectors from a list of data.frames in an elegant way

2012-03-31 Thread Gabor Grothendieck
On Thu, Mar 29, 2012 at 4:28 AM, Eric Fail eric.f...@gmx.us wrote: Dear R experts, I've realized that it might not be possible to define a negative SELCET statement in a SQL call so now I'm looking for the smoothest way to generate a list of what I would like from my large database by first

Re: [R] list assignment syntax?

2012-03-30 Thread Gabor Grothendieck
On Fri, Mar 30, 2012 at 6:40 PM, ivo welch ivo...@gmail.com wrote: Dear R wizards:  is there a clean way to assign to elements in a list?  what I would like to do, in pseudo R+perl notation is  f - function(a,b) list(a+b,a-b)  (c,d) - f(1,2) and have c be assigned 1+2 and d be assigned 1-2.

Re: [R] Handling functions as objects

2012-03-29 Thread Gabor Grothendieck
On Thu, Mar 29, 2012 at 1:02 PM, Julio Sergio julioser...@gmail.com wrote: I learnt that functions can be handled as objects, the same way the variables are. So, the following is perfectly valid: f = function(a, b) { +    print(a) +    print(b) + } f1 = function(foo) { +    foo(1,2) + }

Re: [R] plot points using circles filled half in red and half in blue.

2012-03-28 Thread Gabor Grothendieck
On Tue, Mar 27, 2012 at 10:49 PM, alan alan.wu2...@gmail.com wrote: I want to plot many points and want to use circles. The filling color depends on variable a. if a=1, then not fill if a=2 then fill with red, if a=3 then fill with blue, if a=4, fill half with red and half with blue. Can

Re: [R] Struggling with zoo and aggregate

2012-03-26 Thread Gabor Grothendieck
/%Y,aggregate = mean) or some variation of this. Regards, Tom On Sat, Mar 24, 2012 at 10:58 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Sat, Mar 24, 2012 at 10:44 PM, Thomas Adams thomas.ad...@noaa.gov wrote: All: I have a SQlite database where I have stored some

Re: [R] output by(...)

2012-03-25 Thread Gabor Grothendieck
2012/3/25 Skála, Zdeněk (INCOMA GfK) zdenek.sk...@gfk.com: Dear all, I have a question that is probably pretty stupid, so apologies in advance... I do a simple mydata.tab - by(my.data.frame, my.data.frame$category, colMeans) ...works fine, but I need to output the results to some flat

Re: [R] How to test omitted level from a multiple level factor against overall mean in regression models?

2012-03-25 Thread Gabor Grothendieck
2012/3/25 Biedermann, Jürgen juergen.biederm...@charite.de: Hi there, I have a linear model with one factor having three levels. I want to check if the different levels significantly differ from the overall mean (using contr.sum). However one level (the last) is omitted in the standard

Re: [R] Struggling with zoo and aggregate

2012-03-24 Thread Gabor Grothendieck
On Sat, Mar 24, 2012 at 10:44 PM, Thomas Adams thomas.ad...@noaa.gov wrote: All: I have a SQlite database where I have stored some verification data by date time (cycle Z/UTC), lead_time as well as type, duration, etc. I would like to analyze plot the data as monthly averages. I have looked

Re: [R] Questions on plotting using zoo toolbox: (1) dual axes (2)legend

2012-03-22 Thread Gabor Grothendieck
On Thu, Mar 22, 2012 at 4:38 AM, jpm miao miao...@gmail.com wrote: Hi,   I have three time series and I would like to plot them on the same graph such that two of them share left y-axis and the third uses right y-axis. rm(list=ls()) library(zoo) x1 - read.csv(file=120322DBCdata.csv,

Re: [R] read.zoo - combining two columns with date and time respectively into one index column?

2012-03-22 Thread Gabor Grothendieck
On Thu, Mar 22, 2012 at 8:24 AM, knavero knav...@gmail.com wrote: I have three columns in my raw data: date, time, and dry bulb temperature: http://r.789695.n4.nabble.com/file/n4495326/weathDataSDCoron.txt weathDataSDCoron.txt The date format is %Y%m%d and the time format is %H:%M. Any ideas

Re: [R] Using extract function for dates in sqldf

2012-03-21 Thread Gabor Grothendieck
On Wed, Mar 21, 2012 at 11:31 AM, michael.laviole...@dhhs.state.nh.us wrote: I'm trying to use sqldf to query for the earliest date of a blood test when patients have had multiple tests in a given year. My query looks like this: test11 - sqldf(select CHILD_ID, min(SAMP_DATE)                

Re: [R] Wrong output due to what I think might be a data type issue (zoo read in problem)

2012-03-20 Thread Gabor Grothendieck
On Tue, Mar 20, 2012 at 1:24 AM, knavero knav...@gmail.com wrote: found a temporary fix (I'm sure it's redundant and not as elegant, but here it is): require(zoo) require(chron) setwd(/home/knavero/Desktop/) fmt = %m/%d/%Y %H:%M tail1 = function(x) tail(x, 1) rawData =

Re: [R] Constraint Linear regression

2012-03-20 Thread Gabor Grothendieck
On Tue, Mar 20, 2012 at 12:54 AM, priya fernandes priyyafernan...@gmail.com wrote: Hi there, I am trying to use linear regression to solve the following equation - y - c(0.2525, 0.3448, 0.2358, 0.3696, 0.2708, 0.1667, 0.2941, 0.2333, 0.1500, 0.3077, 0.3462, 0.1667, 0.2500, 0.3214, 0.1364)

Re: [R] Lag based on Date objects with non-consecutive values

2012-03-19 Thread Gabor Grothendieck
On Mon, Mar 19, 2012 at 8:03 PM, Sam Albers tonightstheni...@gmail.comwrote: Hello R-ers, I just wanted to update this post. I've made some progress on this but am still not quite where I need to be. I feel like I am close so I just wanted to share my work so far. Try this: Lines - Date

Re: [R] Reshape from long to wide

2012-03-19 Thread Gabor Grothendieck
On Mon, Mar 19, 2012 at 7:01 PM, aly alyaba...@gmil.com wrote: Hi, I'm a total beginner in R and this question is probably very simple but I've spent hours reading about it and can't find the answer. I'm trying to reshape a data table from long to wide format. I've tried reshape() and

Re: [R] how to bind uneven column (not equal length) into matrix without recycling values

2012-03-15 Thread Gabor Grothendieck
On Thu, Mar 15, 2012 at 5:08 AM, sagarnikam123 sagarnikam...@gmail.com wrote: i have x [1] 1 2 3 4 5 6 y [1] 34  5  6 z-cbind(x,y) z     x  y [1,] 1 34 [2,] 2  5 [3,] 3  6 [4,] 4 34 [5,] 5  5 [6,] 6  6 i don't want recycling, instead can we put NA /0 like below z     x  y [1,] 1

Re: [R] Equation as a character string

2012-03-15 Thread Gabor Grothendieck
On Thu, Mar 15, 2012 at 12:58 PM, Rui Barradas rui1...@sapo.pt wrote: Hello, Hi Emily, Yes (see below), but you might be better off by writing a simple function.  Here are examples both ways (usually eval parse is highly discouraged). Cheers, Josh Yes, eval/parse is discouraged but

Re: [R] eigenvalues of matrices of partial derivatives with ryacas

2012-03-15 Thread Gabor Grothendieck
On Thu, Mar 15, 2012 at 7:51 PM, Adam Zeilinger zeil0...@umn.edu wrote: Hello, I am trying to construct two matrices, F and V, composed of partial derivatives and then find the eigenvalues of F*Inverse(V).  I have the following equations in ryacas notation: library(Ryacas) FIh -

Re: [R] variable values in plotmath expressions

2012-03-15 Thread Gabor Grothendieck
On Thu, Mar 15, 2012 at 10:25 PM, Richard M. Heiberger r...@temple.edu wrote: ## I would like help in using variable values in plotmath expressions ## in lattice x - 1:10 y - 1:10 pval - .95 plot(y ~ x, ## works as I want in base graphics     main=substitute(list(alpha * = *

Re: [R] Problem installing RMySQL package!

2012-03-14 Thread Gabor Grothendieck
On Wed, Mar 14, 2012 at 1:14 AM, AGGARWAL, NEERAJ (NEERAJ) neeraj.aggar...@alcatel-lucent.com wrote: I am facing issues while installing RMySQL package on windows(32 bit) installation of R-Project. I am getting the following warning messages. Warning messages: 1: running command

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread Gabor Grothendieck
On Wed, Mar 14, 2012 at 12:43 PM, knavero knav...@gmail.com wrote: attached http://r.789695.n4.nabble.com/file/n4472408/dataout_2471_843.csv dataout_2471_843.csv Here is how the problem can be presented in a self contained, minimal, reproducible fashion (as per last two lines on every message

Re: [R] Help: problem converting character to numeric

2012-03-14 Thread Gabor Grothendieck
On Wed, Mar 14, 2012 at 6:07 PM, Aurélien PHILIPPOT aurelien.philip...@gmail.com wrote: Dear R experts, I have a dataframe imported from a csv file (with read.csv). Here is an example: mm- c(19860228, 19860331,19860430,19860531) id-c(1,1,1,1) re- c(C,0.25, 0.98, 1.34)

Re: [R] Converting factor data into Date-time format

2012-03-13 Thread Gabor Grothendieck
On Tue, Mar 13, 2012 at 12:20 PM, Haojie Yan yhj...@googlemail.com wrote: Dear R-user, I have read a dataset from .csv file into R. This dataset includes one column containing some data in 'date and time' format, e.g. 'dd/mm/ hh:mm'. These data were automatically read and saved as

Re: [R] sort dates

2012-03-09 Thread Gabor Grothendieck
On Fri, Mar 9, 2012 at 8:35 AM, carol white wht_...@yahoo.com wrote: Hello, How is it possible to sort dates in R? Your question has already been answered but note that if your data is a time series and you represent it using zoo it will automatically be sorted. Here dates is in reverse

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread Gabor Grothendieck
On Thu, Mar 8, 2012 at 1:19 PM, RHelpPlease rrum...@trghcsolutions.com wrote: Hi there, I wish to read a 9.6GB .DAT file into R (64-bit R on 64-bit Windows machine) - to then delete a substantial number of rows then convert to a .csv file. Upon the first attempt the computer crashed (at some

Re: [R] Aggregate with Function List ?

2012-03-07 Thread Gabor Grothendieck
On Wed, Mar 7, 2012 at 10:36 AM, Michael Karol mka...@syntapharma.com wrote: All: It now appears to be working; however, I have a new problem.  The format of the output is not what I need.  Currently it produces an output as three columns; Group.1, Group.2, and x whereas I need a data

Re: [R] GPS handling libraries or (String manipulation)

2012-03-07 Thread Gabor Grothendieck
On Wed, Mar 7, 2012 at 11:28 AM, Alaios ala...@yahoo.com wrote: Dear all, I would like to ask you if R has a library that can work with different GPS formats For example I have a string of this format N50° 47.513 E006° 03.985 and I would like to convert to GPS decimal format. that

Re: [R] transfer local function objects to other environment - how?

2012-03-07 Thread Gabor Grothendieck
On Wed, Mar 7, 2012 at 11:51 AM, Mark Heckmann mark.heckm...@gmx.de wrote: Hello, I have an empty environment named env. Now I want the locally created objects in some function (foo) to appear in env. Within the function I want to have straight forward code, no assign operation or env$x

Re: [R] GPS handling libraries or (String manipulation)

2012-03-07 Thread Gabor Grothendieck
On Wed, Mar 7, 2012 at 2:29 PM, Daniel Nordlund djnordl...@frontier.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gabor Grothendieck Sent: Wednesday, March 07, 2012 8:52 AM To: Alaios Cc: R help Subject: Re: [R

Re: [R] times series trellis plot

2012-03-06 Thread Gabor Grothendieck
On Tue, Mar 6, 2012 at 4:20 AM, Stefan Luedtke slued...@gfz-potsdam.de wrote: I managed to solve a part of my problem. Anyway, I still do not understand how to use the lattice package the right way. An example: I do have multiple stations (say, with climatological data) and I want to plot

Re: [R] Extracting data from a zoo by date

2012-03-06 Thread Gabor Grothendieck
On Tue, Mar 6, 2012 at 3:06 PM, Mago84 davidquia...@gmail.com wrote: Dear all, I know that it is a silly question, but I have a zoo object like this:                    valor1  valor2 01/02/08 36.7381 17.0097 01/03/08 36.9296 16.8331 01/04/08 35.6934 16.3539 01/07/08 35.3539 16.3791

Re: [R] times series trellis plot

2012-03-06 Thread Gabor Grothendieck
On Tue, Mar 6, 2012 at 11:14 AM, Stefan Luedtke slued...@gfz-potsdam.de wrote: I spent some more time to understand the examples .. it helped a bit. But there is still one issue. Taking example data (my first on, hope it is not confusing ;-)  ) like: library(latticeExtra) library(zoo)

Re: [R] Filter/Ceiling for unwanted data - zoo

2012-03-05 Thread Gabor Grothendieck
On Mon, Mar 5, 2012 at 3:33 PM, knavero knav...@gmail.com wrote: Here's my script: http://pastebin.com/zx3TCtXg I want to draw attention to the code block where the read in of the raw data is located. Is there a function that filters out unwanted data with respect to a ceiling limit. For

Re: [R] Sliding a Window in R

2012-03-03 Thread Gabor Grothendieck
On Sat, Mar 3, 2012 at 8:31 AM, Alaios ala...@yahoo.com wrote: Dear all, I am having a vector of around 300.000 elements and I Want to slide fast a window from the first element until the last-Windowsize what I have so far is the following for statement:  for (i in 1:(length(data[,1]) -

Re: [R] times series trellis plot

2012-03-02 Thread Gabor Grothendieck
On Fri, Mar 2, 2012 at 5:15 PM, sluedtke slued...@gfz-potsdam.de wrote: Dear List, I am struggling with the trellis graphic. A similar problem was mentioned here: http://r.789695.n4.nabble.com/R-How-can-you-get-N-replicates-of-a-multi-screen-multivariate-time-series-plot-td811850.html I

Re: [R] Database

2012-02-29 Thread Gabor Grothendieck
On Tue, Feb 28, 2012 at 6:06 PM, Trying To learn again tryingtolearnag...@gmail.com wrote: Hi all, I´m new using Access. I see that many things that you can do on Access you can do on CRAN R but not on contrary. My question is: Is there any manual with examples comparing how to do data base

Re: [R] regular expression

2012-02-29 Thread Gabor Grothendieck
On Wed, Feb 29, 2012 at 2:24 PM, Fred G bayespoker...@gmail.com wrote: Computer Friends, with the following example lines: [107] 98-610: Cell type: S; Surv(months): 6; STATUS(0=alive, 1=dead): 1 [108] 99-625: Cell type: S; Surv(months): 21; STATUS(0=alive, 1=dead): 1 i want to be able to

Re: [R] aggregating specific parts in zoo index column to perform sliding average

2012-02-28 Thread Gabor Grothendieck
On Mon, Feb 27, 2012 at 10:17 PM, knavero knav...@gmail.com wrote: Here's my code: http://pastebin.com/0yRxEVtm The important parts are uncommented and should be easy to find using the link above. For the following line of code, I plan on looking for a way to offset it up 7 rows so that the

Re: [R] question about user written function (newb question)

2012-02-26 Thread Gabor Grothendieck
On Sun, Feb 26, 2012 at 9:06 AM, knavero knav...@gmail.com wrote: Quick newb question about R relating to the line of code below: rawCool = read.zoo(cooling.txt, FUN = as.chron, format = %m/%d/%Y %H:%M, sep = \t, aggregate = function(x) tail(x, 1)) I'm wondering what the specifics are for

Re: [R] read separate columns from an Excel sheet

2012-02-26 Thread Gabor Grothendieck
On Sun, Feb 26, 2012 at 2:58 PM, Ivette iva_mihayl...@mail.ru wrote: Hello, Lets suppose I have an Excel sheet with 9 columns of data. How to tell R to read for example column 1 and 7 of this sheet? I know only the usual code without specifying columns: library(gdata) a -

Re: [R] tapply for enormous (2^31 row) matrices

2012-02-26 Thread Gabor Grothendieck
On Thu, Feb 23, 2012 at 11:39 AM, Matthew Keller mckellerc...@gmail.com wrote: Thank you all very much for your help (on both the r-help and the bioconductor listserves). Benilton - I couldn't get sqldf to install on the server I'm using (error is: Error : package 'gsubfn' does not have a

Re: [R] multiple gsub

2012-02-23 Thread Gabor Grothendieck
On Thu, Feb 23, 2012 at 5:28 AM, TwistedSkies david.vic...@talbotuw.com wrote: Hi Guys, I am relatively new to R and was wondering if I could next my gsub command in identifying one object I have data which looks like this:  nameTaiwan_250km/name I want it to look like this:                

Re: [R] changing time span

2012-02-23 Thread Gabor Grothendieck
On Thu, Feb 23, 2012 at 7:09 AM, phillen phlent...@gmail.com wrote: hi there! i am desperately in need for help. i have read in data: qthm=read.csv(qthm.csv,sep=;,header=TRUE)  then created time series ie m2=ts(log(qthm$m2), start=c(1959, 1), frequency=4) transformed these time series in

Re: [R] convert zoo object to standard R object so I can plot and output to csv file

2012-02-23 Thread Gabor Grothendieck
On Thu, Feb 23, 2012 at 3:06 PM, Henry hcco...@lbl.gov wrote: Another simple question - trying to specify xlim in a zoo plot and getting error my plot line is plot(z1, ylim=c(-100,3000),xlim=c(chron(10/30/2011,00:00:00),chron(10/30/2011,00:20:00)),type=b,xlab=,ylab=1 Minute Fit,cex.lab=1.3)

Re: [R] Week number from a date

2012-02-22 Thread Gabor Grothendieck
On Wed, Feb 22, 2012 at 8:09 AM, arunkumar akpbond...@gmail.com wrote: Hi My data looks like this startDate=2008-06-01 dateRange =c( 2008-10-01,2008-12-01) Is there any method to find the week number from the startDate range Is the question how many weeks are from the startDate to

Re: [R] convert zoo object to standard R object so I can plot and output to csv file

2012-02-22 Thread Gabor Grothendieck
On Wed, Feb 22, 2012 at 9:54 PM, Henry hcco...@lbl.gov wrote: Gabor, Thanks very much. I have all the zoo functions to get 1 minute aggregation and 15 min. means working and now able to write out to a file/etc. One question on the 15 min. mean results. m1 - times(00:01:00) g -

Re: [R] Questions on Data reading using zoo package

2012-02-21 Thread Gabor Grothendieck
On Tue, Feb 21, 2012 at 2:25 AM, jpm miao miao...@gmail.com wrote: Hello,   I try to handle the data using read.csv , zoo and aggregate functions. The data contains NA values. After aggregating monthly data into quarterly data, all data become NA. Is it because I don't properly aggregate the

Re: [R] proto: make a parameter persist

2012-02-21 Thread Gabor Grothendieck
On Tue, Feb 21, 2012 at 12:15 AM, Ben quant ccqu...@gmail.com wrote: Thanks again for your so far on proto. I have another question. What is the best way to do stuff based on data prior to calling a function? I tried the code below without expr (and including commas after data member

Re: [R] still need read.zoo command help

2012-02-17 Thread Gabor Grothendieck
On Fri, Feb 17, 2012 at 7:54 PM, Henry hcco...@lbl.gov wrote: The problem now is it looks like my read.zoo isn't working. Sorry for sort of double posting. Someone please assist if you have time with my read.zoo command line. my data is as just below this line, a time stamp and a real number

Re: [R] convert zoo object to standard R object so I can plot and output to csv file

2012-02-17 Thread Gabor Grothendieck
On Fri, Feb 17, 2012 at 2:56 PM, Henry hcco...@lbl.gov wrote: Another newbie question I got the 1 minute spine interpolation and 15 mean aggregation working with many thanks to Gabor Grothendieck using Zoo functions.  I got a tip from Hasan Diwan to look at xts but it seemed I would make

Re: [R] still need read.zoo command help

2012-02-17 Thread Gabor Grothendieck
On Fri, Feb 17, 2012 at 8:16 PM, Hasan Diwan hasan.di...@gmail.com wrote: Henry, You're reading a CSV with read.zoo. This is not likely to work. The way I'd do this is: data - read.csv('/tmp/Kevin-0-comma-ITPower.txt', header=FALSE) z - zoo(data[,2], order.by=as.POSIXct(data[,1],

Re: [R] proto: make a parameter persist

2012-02-17 Thread Gabor Grothendieck
On Sat, Feb 18, 2012 at 12:44 AM, Ben quant ccqu...@gmail.com wrote: The code below works as expected but: Using the proto package, is this the best way to 1) make a parameter persist if the parameter is passed in with a value, 2) allow for calling the bias() function without a parameter

Re: [R] Reading Text Files with RODBC

2012-02-16 Thread Gabor Grothendieck
On Thu, Feb 16, 2012 at 10:12 AM, Nutter, Benjamin nutt...@ccf.org wrote: I'm thoroughly stumped.  I've been playing with RODBC and wanted to see if I could retrieve data from text files using this package as well (for the most part, this is an intellectual exercise, but occasionally I do get

Re: [R] time series manipulation what functions are best

2012-02-16 Thread Gabor Grothendieck
On Thu, Feb 16, 2012 at 7:31 PM, Henry hcco...@lbl.gov wrote: Newbie question - mechanical engineer trying to learn R I've had success with plotting time series data and even made a heat map using R Graphs Cookbook by Mittal. I have a new problem - I need to align a number of time series data

Re: [R] Passing date as parameter while retrieving data from database using dbGetQuery

2012-02-15 Thread Gabor Grothendieck
On Wed, Feb 15, 2012 at 7:24 AM, aajit75 aaji...@yahoo.co.in wrote: Hi All, This might be simple question, I need to retrive data for modelling from the databases. Eveytime date values changes so I countnot fix date value in the code, it is required to pass as parameter. When I pass the date

Re: [R] matching a sequence in a vector?

2012-02-15 Thread Gabor Grothendieck
On Tue, Feb 14, 2012 at 11:17 PM, Redding, Matthew matthew.redd...@deedi.qld.gov.au wrote: I've been trawling through the documentation and listserv archives on this topic -- but as yet have not found a solution.  I'm sure this is pretty simple with R, but I cannot work out how without

Re: [R] Converting ts into xts and subsetting

2012-02-15 Thread Gabor Grothendieck
On Wed, Feb 15, 2012 at 10:25 PM, P.B. Lecavalier p.bar...@gmail.com wrote: Greetings, I would like to subset observations in a time series using xts, after converting from ts to xts. X=ts(1:100, frequency=12, start=c(1976)) X2=as.xts(X) X2[1984] The output: Feb 1984   98 Mar 1984  

Re: [R] sequencing environments

2012-02-15 Thread Gabor Grothendieck
On Wed, Feb 15, 2012 at 11:58 PM, Ben quant ccqu...@gmail.com wrote: Thank you Duncan. Interesting. I find it strange that you can't get a list of the environments. But I'll deal with it... Anyway, I'm about to start a new R dev project for my company. I'm thinking about architecture,

Re: [R] How to import time-series data

2012-02-13 Thread Gabor Grothendieck
On Mon, Feb 13, 2012 at 8:23 AM, RichardSmith richardsmith...@gmail.com wrote: Gabor Grothendieck wrote Try this xyplot.zoo lattice graph.   Time series are represented in columns so we transpose the data and convert it to zoo.  The screen= argument available in xyplot.zoo groups series

Re: [R] Change dataframe-structure

2012-02-13 Thread Gabor Grothendieck
On Mon, Feb 13, 2012 at 5:07 PM, David Studer stude...@gmail.com wrote: Hello everybody, I have the following problem and have no idea how to solve it: In my dataframe I have six columns representing six societal problems (p1, p2, ..., p6). The values are ranks between 1 (worst problem) and

Re: [R] readLines vs scan

2012-02-12 Thread Gabor Grothendieck
On Sun, Feb 12, 2012 at 10:35 AM, Bert Gunter gunter.ber...@gene.com wrote: Folks: Suppose I wish to input a text file with variable length lines and possible whitespace as is and then parse the resulting character vector in R. Each line of text is terminated with \n (newline character).

Re: [R] How to import time-series data

2012-02-12 Thread Gabor Grothendieck
On Sun, Feb 12, 2012 at 10:52 AM, RichardSmith richardsmith...@gmail.com wrote: Sorry for this very basic question. I have time-series data, laid out as a table (in csv) like this: That is, the first column is the sample ID, and subsequent columns are the data at time interval in days since

Re: [R] How to import time-series data

2012-02-12 Thread Gabor Grothendieck
On Sun, Feb 12, 2012 at 12:35 PM, RichardSmith richardsmith...@gmail.com wrote: Gabor Grothendieck wrote Something seems to have gone wrong in the posting since we can't see the sample data that seems to be intended to be part of the post. Sorry, I posted via Nabble using the 'raw' command

Re: [R] Split matrix into square submatices

2012-02-10 Thread Gabor Grothendieck
On Fri, Feb 10, 2012 at 3:02 AM, xiddw xid...@gmail.com wrote: Hi everybody, I'm looking for an optimal way to split  a big matrix  (e.g. ncol = 8, nrow=8)  into small square submatrices  (e.g. ncol=2, nrow=2) For example If I have  h     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,]    

Re: [R] calling the function which is stored in a list

2012-02-09 Thread Gabor Grothendieck
On Thu, Feb 9, 2012 at 2:54 AM, arunkumar akpbond...@gmail.com wrote: Hi I'm storing two functions in a list # creating two function  function1 - function(n) {  return(sum(n)) } function2 - function(n) {  return(mean(n)) } #storing the function function3 =c(function1,function2)

Re: [R] decimal number format as quarter

2012-02-08 Thread Gabor Grothendieck
On Wed, Feb 8, 2012 at 9:12 AM, Arnaud Gaboury arnaud.gabo...@a2ct2.com wrote: Hello, I have to deal with numbers with a decimal part as quarter, coming from two systems with different way to show decimals. I need to tell R these are in fact the same number. On one side my number are

Re: [R] Problems reading tab-delim files using read.table and read.delim

2012-02-08 Thread Gabor Grothendieck
On Wed, Feb 8, 2012 at 7:09 AM, mails mails00...@gmail.com wrote: Hello, I used read.xlsx to read in Excel files but for large files it turned out to be not very efficient. For that reason I use a programme which writes each sheet in an Excel file into tab-delim txt files. Note that that is

Re: [R] String position character replacement

2012-02-08 Thread Gabor Grothendieck
On Wed, Feb 8, 2012 at 12:33 PM, Yang, Joy (NIH/NHGRI) [F] joy.y...@nih.gov wrote: Hi, Is there a way to efficiently replace specified indices in a string with another character? For example, if I had a vector of strings such as [1] hellohowareyoudoing [2] imgoodhowareyou [3] goodandyou

Re: [R] evaluate one variable in an expression with two variables

2012-02-08 Thread Gabor Grothendieck
On Wed, Feb 8, 2012 at 4:02 PM, moli nird...@gmail.com wrote: I want to evaluate f with the mean=7  mean=7  f -  expression(-(x-mean)^2/2) then get a new expression:  -(x-7)^2/2 How could I do it? Thanks. You can leave out the initial as.expression if you don't mind having a call object

Re: [R] Zoomable time series plots

2012-02-07 Thread Gabor Grothendieck
On Tue, Feb 7, 2012 at 8:02 PM, Hasan Diwan hasan.di...@gmail.com wrote: Not sure if the question is appropos, but I have multiple csv's which are read into an xts object, corresponding to telemetry data (accelerometer, magnetometer/compass, and gyroscope). For examination, it would be über

Re: [R] debugging R

2012-02-05 Thread Gabor Grothendieck
On Sun, Feb 5, 2012 at 3:01 AM, Alaios ala...@yahoo.com wrote: Dear all, I am using browse() to debug my R applications. My problem is that I need a bit more control of the debugging process. For example 'I want R to stop at the 7th iteration and check. One can do think that I can put the

Re: [R] creating R package

2012-02-04 Thread Gabor Grothendieck
On Fri, Feb 3, 2012 at 12:25 PM, ql16717 ql16...@gmail.com wrote: Hi, I never acutally made a package before. I have a folder, say called john that has everything it needs to be in a R package. Some instruction says I need Rtools from R mirror site. I installed the Rtools, but under DOS, the

Re: [R] sqldf for Very Large Tab Delimited Files

2012-02-03 Thread Gabor Grothendieck
On Fri, Feb 3, 2012 at 6:03 AM, HC hca...@yahoo.co.in wrote: Thank you for indicating that SQLite may not handle a file as big as 160 GB. Would you know of any utility for *physically splitting *the 160 GB text file into pieces. And if one can control the splitting at the  end of a record.

Re: [R] how to plot several curves in the same frame

2012-02-03 Thread Gabor Grothendieck
On Fri, Feb 3, 2012 at 5:05 AM, ikuzar raz...@hotmail.fr wrote: Hello, I'd like to know how to plot several curves in the same frame (1curve = 1line=1day). For instance (csv file): 2012-02-01 01:00:00; 2100 2012-02-01 02:00:00; 2200 ... 2012-02-01 23:00:00; 2500 2012-02-02 01:00:00; 1000

Re: [R] sqldf for Very Large Tab Delimited Files

2012-02-03 Thread Gabor Grothendieck
On Fri, Feb 3, 2012 at 8:08 AM, HC hca...@yahoo.co.in wrote: This is a 160 GB tab-separated .txt file. It has 9 columns and 3.25x10^9 rows. Can R handle it? You can process a file N lines at time like this: con - file(myfile.dat, r) while(length(Lines - readLines(con, n = N)) 0) { ...

Re: [R] sqldf for Very Large Tab Delimited Files

2012-02-02 Thread Gabor Grothendieck
On Wed, Feb 1, 2012 at 11:57 PM, HC hca...@yahoo.co.in wrote: Hi All, I have a very (very) large tab-delimited text file without headers. There are only 8 columns and millions of rows. I want to make numerous pieces of this file by sub-setting it for individual stations. Station is given as

Re: [R] sqldf for Very Large Tab Delimited Files

2012-02-02 Thread Gabor Grothendieck
On Thu, Feb 2, 2012 at 3:11 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Feb 1, 2012 at 11:57 PM, HC hca...@yahoo.co.in wrote: Hi All, I have a very (very) large tab-delimited text file without headers. There are only 8 columns and millions of rows. I want to make numerous

Re: [R] sqldf for Very Large Tab Delimited Files

2012-02-02 Thread Gabor Grothendieck
On Thu, Feb 2, 2012 at 8:07 PM, HC hca...@yahoo.co.in wrote: Hi Gabor, Thank you very much for your guidance and help. I could run the following code successfully on a 500 mb test data file. A snapshot of the data file is attached herewith. code start*** library(sqldf)

Re: [R] Combining month and year into a single variable

2012-02-01 Thread Gabor Grothendieck
On Wed, Feb 1, 2012 at 5:26 PM, Sam Albers tonightstheni...@gmail.com wrote: Hello all, ## I am trying to convert some year and month data into a single variable that has a date format so I can plot a proper x axis. ## I've made a few tries at this and search around but I haven't found

Re: [R] replacing characters in matrix. substitute, delayedAssign, huh?

2012-01-30 Thread Gabor Grothendieck
On Mon, Jan 30, 2012 at 1:26 PM, Paul Johnson pauljoh...@gmail.com wrote: A user question today has me stumped.  Can you advise me, please? User wants a matrix that has some numbers, some variables, possibly even some function names.  So that has to be a character matrix. Consider: BM -

Re: [R] timeseries highlighting

2012-01-30 Thread Gabor Grothendieck
On Mon, Jan 30, 2012 at 2:12 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: library(zoo) demo(zoo-overplot) Also: library(zoo) example(xblocks) -- Statistics Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com

Re: [R] Data Structure to Code

2012-01-29 Thread Gabor Grothendieck
On Sun, Jan 29, 2012 at 11:36 AM, Ajay Askoolum aa2e...@yahoo.co.uk wrote: Thank you. I need some clarification. dput(AirPassengers) gives: structure(c(112, 118, 132, 129, 121, 135, 148, 148, 136, 119, 104, 118, 115, 126, 141, 135, 125, 149, 170, 170, 158, 133, 114, 140, 145, 150, 178,

Re: [R] Subsetting for the ten highest values by group in a dataframe

2012-01-28 Thread Gabor Grothendieck
On Fri, Jan 27, 2012 at 2:26 PM, Sam Albers tonightstheni...@gmail.com wrote: Hello, I am looking for a way to subset a data frame by choosing the top ten maximum values from that dataframe. As well this occurs within some factor levels. ## I've used plyr here but I'm not married to this

Re: [R] R-help

2012-01-27 Thread Gabor Grothendieck
On Fri, Jan 27, 2012 at 6:35 AM, Christopher Kelvin chris_kelvin2...@yahoo.com wrote: Hello, How can i do simulation with a weibull distribution after i have generated data with the distribution, for example; if i generate x=rweibull(50,shape=0.8,scale=2) and i want to simulate this data

Re: [R] R-help

2012-01-27 Thread Gabor Grothendieck
On Fri, Jan 27, 2012 at 9:49 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Another way, which I believe will be a little more memory efficient and time inefficient, though that might vary by machine, would be to use replicate: library(MASS) set.seed(123) m - replicate(1000,

Re: [R] Checking for invalid dates: Code works but needs improvement

2012-01-26 Thread Gabor Grothendieck
On Tue, Jan 24, 2012 at 11:54 AM, Paul Miller pjmiller...@yahoo.com wrote: Hello Everyone, Still new to R. Wrote some code that finds and prints invalid dates (see below). This code works but I suspect it's not very good. If someone could show me a better way, I'd greatly appreciate it.

Re: [R] Calculate a function repeatedly over sections of a ts object

2012-01-26 Thread Gabor Grothendieck
On Thu, Jan 26, 2012 at 4:00 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: I'm not sure if it's easily doable with a ts class, but the rollapply function in the zoo package will do this easily. (Also, I find zoo to be a much more natural time-series workflow than ts so it might make

Re: [R] help to slip a file name using strsplit function

2012-01-25 Thread Gabor Grothendieck
On Wed, Jan 25, 2012 at 10:26 AM, gianni lavaredo gianni.lavar...@gmail.com wrote: Dear Researchers, I have several files as this example: Myfile_MyArea1_sample1.txt i wish to split in Myfile, MyArea1, sample1, and txt, becasue i need to use sample1 label. I try to use strsplit but I am able

Re: [R] help to slip a file name using strsplit function

2012-01-25 Thread Gabor Grothendieck
On Wed, Jan 25, 2012 at 10:51 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Jan 25, 2012 at 10:26 AM, gianni lavaredo gianni.lavar...@gmail.com wrote: Dear Researchers, I have several files as this example: Myfile_MyArea1_sample1.txt i wish to split in Myfile, MyArea1

<    1   2   3   4   5   6   7   8   9   10   >