Re: [R] find max value in different columns

2014-02-27 Thread PIKAL Petr
Hi if I name your data frame to YDF apply(YDF, 1, max, na.rm=FALSE) shall find row max values. Jyst add them as new column. Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Mat Sent: Thursday, February 27, 2014

Re: [R] how to fit a sine curve to those data

2014-02-27 Thread PIKAL Petr
Maybe this can be of some help. http://r.789695.n4.nabble.com/Fit-a-sine-to-data-td859118.html Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of chiara.maglio...@libero.it Sent: Wednesday, February 26, 2014 5:42

Re: [R] (no subject)

2014-02-27 Thread arun
Hi Dila, Try: transform(melt(dat,id.var=c(Day,Year)),Month=match(variable,month.abb),Amount=value)[,-c(3:4)] A.K. On Thursday, February 27, 2014 1:02 AM, dila radi dilarad...@gmail.com wrote: Dear Arun, Thank you so much for your help..but this command doesn't apply if I have more than

Re: [R] [R 3.0.2] Compilation error in toms708.c during installation on Suse using icc

2014-02-27 Thread Prof Brian Ripley
This is not the correct list: see the posting guide. Two comments: 1) The messages are about C++ constructs, and toms708.c is a C file. Perhaps you need to specify C explicitly (even though for a reasonable compiler -std=c99 does that). 2) The lines highlighted refer to 'L40'. Perhaps some

[R] Finding files matching full path regex

2014-02-27 Thread Alexander Shenkin
Hi folks, I'm interested in finding files by matching both filenames and directories via regex. If I have: dir1_pat1/file1.csv dir2_pat1/file2.csv dir2_pat1/file3.txt dir3_pat2/file4.csv I would like to find, for example, all csv files in directories that have pat1 in their

Re: [R] Finding files matching full path regex

2014-02-27 Thread Duncan Murdoch
On 27/02/2014 7:10 AM, Alexander Shenkin wrote: Hi folks, I'm interested in finding files by matching both filenames and directories via regex. If I have: dir1_pat1/file1.csv dir2_pat1/file2.csv dir2_pat1/file3.txt dir3_pat2/file4.csv I would like to find, for example,

Re: [R] Plots with Y axis split into two scales

2014-02-27 Thread John Kane
Here, here. John Kane Kingston ON Canada -Original Message- From: 538...@gmail.com Sent: Wed, 26 Feb 2014 10:07:12 -0700 To: j...@mail.bitwrit.com.au, achim.zeil...@r-project.org Subject: Re: [R] Plots with Y axis split into two scales I nominate the following for the fortunes

[R] pel fitdistr how to estimate distribution parameters?

2014-02-27 Thread victoryday
I`m using fitdistr() to estimate parameters for different distributions of my data set. Now I have problems to estimate the weibull Distribution and others. I found the recommendation to use the pel…() function. My question is: If I estimate parameters with the pel…() function. How can I use

[R] Basic question for subset of dataframe

2014-02-27 Thread Kapil Shukla
All - firstly apology if this is a very basic question but i tried myself and could not find a satisfied answer. I know that i can subset a dataframe using dataframe[row,column] and if i give dataframe[row,] that specific row is provided and similarly i can do dataframe[,column] to get the entire

[R] Non-negative solution to an underdetermined linear system

2014-02-27 Thread klqmba
Dear R users, I have to find optimal solution of an underdetermined linear system, but only with positive variables. I tried the function from this post https://stat.ethz.ch/pipermail/r-help/2007-October/143408.html , but it's solution includes also negative values. Thanks in advance.

Re: [R] Installing WinBUGS OpenBUGS on OS X 10.8.5

2014-02-27 Thread Agony
Many thanks indeed. But I foud a way. It is worth of trying http://www.davidbaumgold.com/tutorials/wine-mac/ Best, Amir On Monday, February 24, 2014 10:32 AM, jlu...@ria.buffalo.edu jlu...@ria.buffalo.edu wrote: 1. To install and run WBugs or Obugs on OSX you must use Parallels or other

[R] Time Series on Binary Data.

2014-02-27 Thread shilpi harpavat
Hi, I have a dichotomous data where some my independent variables are categorical, some are continuous and some are binary(0/1) My dependent is a binary response (Fail/NoFail,0/1) . The data is some readings collected everyday over a period of time. The goal is to use this data and see if we

[R] Fast linear convolution with R

2014-02-27 Thread Philip Wette
Hello, i am trying to compute the linear convolution of two vectors of length 1e7 each. The code i am using is a = vector(length=1e7) b = vector(length=1e7) #fill a and b with data... c = convolve(a, rev(b), type=o) Unfortunately, this computation goes on now for a very long time (currently

[R] NOTE when checking CRAN income feasibility

2014-02-27 Thread Gunther Schauberger
Hello, recently I submitted a new version of my package EffectStars to CRAN, but I was told that the following note arises: * checking CRAN incoming feasibility ... NOTE Maintainer: ‘Gunther Schauberger gunther.schauber...@stat.uni-muenchen.de’ Can you pls remove the line break in the

Re: [R] Fast linear convolution with R

2014-02-27 Thread Mitchell Maltenfort
Convolve uses the FFT so probably expects powers of 2. You might want to look at using filter Ersatzistician and Chutzpahthologist I can answer any question. I don't know is an answer. I don't know yet is a better answer. On Thu, Feb 27, 2014 at 5:31 AM, Philip

[R] data.frmae : Error: unexpected numeric constant in:

2014-02-27 Thread Beáta Nagy
Dear R-users, I would like to load into R a data.frame which record size is 2000. And I got an error message:

Re: [R] Basic question for subset of dataframe

2014-02-27 Thread Ivan Calandra
Hi, Thanks for the example! I cannot really tell you why you get what you get when you type leadership[leadership$country == US] But what I know (or think I know) is that when you don't write the comma, R will take it as a condition for the columns. It means that leadership[1:2] is

Re: [R] Basic question for subset of dataframe

2014-02-27 Thread MacQueen, Don
Try a simpler example: ick - data.frame(x=1:5, a=letters[1:5], c=month.abb[1:5], y=11:15) ick x a c y 1 1 a Jan 11 2 2 b Feb 12 3 3 c Mar 13 4 4 d Apr 14 5 5 e May 15 ick[2] a 1 a 2 b 3 c 4 d 5 e ick[3] c 1 Jan 2 Feb 3 Mar 4 Apr 5 May If you use [] without a comma, it returns

Re: [R] data.frmae : Error: unexpected numeric constant in:

2014-02-27 Thread Gergely Daróczi
Dear Beata, how do you try to load the data? Copy-pasting that amount of characters into the R console might now work due to size limitations of the clipboard. Or do you get this error when calling source on the file? Best, Gergely -- Sent from my Android phone with K-9 Mail. Please excuse my

Re: [R] write function to convert to date or delete

2014-02-27 Thread William Dunlap
Error in as.POSIXlt.character(as.character(x), ...) : character string is not in a standard unambiguous format. That error occurs when as.POSIXlt is looking for a format with which to parse the strings. If you supply a format for the date then as.POSIXlt will not give this error - it will

[R] scales percent precision

2014-02-27 Thread Jacob Wegelin
scales::percent appears not to be documented. Details: At http://cran.r-project.org/web/packages/scales/scales.pdf, equivalently in ?percent, I find no answer to the following two questions. (1) How can I specify the number of decimal points in a call to percent()? For instance, 0.010101

[R] Controlling plot axis for dates

2014-02-27 Thread David Parkhurst
I’d like to control the number of tick marks on the “x” axis of a plot, when the variable there is dates. I thought to use the xaxp parameter, but the documentation for par says “It [i.e., xaxp] is only relevant to default numeric axis systems, and not for example to dates.” My question,

Re: [R] NOTE when checking CRAN income feasibility

2014-02-27 Thread Martin Maechler
Gunther Schauberger gunther.schauber...@stat.uni-muenchen.de on Thu, 27 Feb 2014 16:20:36 +0100 writes: Hello, recently I submitted a new version of my package EffectStars to CRAN, but I was told that the following note arises: * checking CRAN incoming feasibility ...

Re: [R] Controlling plot axis for dates

2014-02-27 Thread Prof Brian Ripley
On 27/02/2014 17:09, David Parkhurst wrote: I’d like to control the number of tick marks on the “x” axis of a plot, when the variable there is dates. I thought to use the xaxp parameter, but the documentation for par says “It [i.e., xaxp] is only relevant to default numeric axis systems, and

Re: [R] Basic question for subset of dataframe

2014-02-27 Thread David Carlson
You have discovered two features of R with your example. Don told you about the first. Data frames are considered to be lists so if you provide only one index, you get the columns (the list elements) when you type str(leadership) 'data.frame': 5 obs. of 10 variables: $ manager: num 1 2 3 4

Re: [R] Fast linear convolution with R

2014-02-27 Thread Martin Maechler
MM == Mitchell Maltenfort mmal...@gmail.com on Thu, 27 Feb 2014 10:34:00 -0500 writes: MM Convolve uses the FFT so probably expects powers of 2. Not quite (but in the correct direction): ?fft contains The FFT is fastest when the length of the series being transformed is

Re: [R] Non-negative solution to an underdetermined linear system

2014-02-27 Thread Berend Hasselman
On 27-02-2014, at 13:22, klq...@mail.bg wrote: Dear R users, I have to find optimal solution of an underdetermined linear system, but only with positive variables. I tried the function from this post https://stat.ethz.ch/pipermail/r-help/2007-October/143408.html , but it's

[R] time series analysis

2014-02-27 Thread Yang Yang
Hi Currently I am working on a river discharge data analysis. I have the daily discharge record from 1935 to now. I want to extract the annual maximum discharge for each hydrolocial year (*start from 01/11 to next year 31/10*). However, I found that the hydroTSM package can only deal with the

[R] Problem with user-defined split function in rpart

2014-02-27 Thread Peter Mayer
Hello, I have written an user-defined split function for the package rpart, now I want to prune the fitted tree with my own defined function. To do so I want at first to grow a large tree with rpart and then use the function to prune the tree. The problem here is, growing a large tree with the

Re: [R] scales percent precision

2014-02-27 Thread Jacob Wegelin
But percent_format() does not take the argument, multiply it by 100, and paste on a percent sign, as we see here: ?scales::percent_format percent_format(0.0101010101) Error in percent_format(0.0101010101) : unused argument(s) (0.0101010101) args(percent_format) function () NULL And how do

Re: [R] scales percent precision

2014-02-27 Thread Jacob Wegelin
Incidentally, ?scales::percent brings up exactly the same text as ?scales::percent_format On 2014-02-27 Thu 14:47, Jacob Wegelin wrote: But percent_format() does not take the argument, multiply it by 100, and paste on a percent sign, as we see here: ?scales::percent_format

[R] expressions (nesting, substitution, 2-stage evaluation)

2014-02-27 Thread Daryl Morris
Hi, I have a function which generates many plots. To keep it simple, let's say I want to set the main title based on where we are in nested loops. So, something like vectorA = c(a,b,c) vectorB = c(a,b,c) for(ii in vectorA) { for(jj in vectorB) { plot(0:1,0:1) title(main = paste(ii,jj))

Re: [R] expressions (nesting, substitution, 2-stage evaluation)

2014-02-27 Thread Bert Gunter
?plotmath -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Thu, Feb 27, 2014 at 2:58 PM, Daryl Morris dar...@uw.edu wrote: Hi, I have a function which

Re: [R] data.frmae : Error: unexpected numeric constant in:

2014-02-27 Thread David Winsemius
You posted in HTML (despite warnings in the Posting Guide that doing so might create problems.) There are exclamation points at many places in the text that appear in a plain-text view of your code. When I past the first section of your code to my console I see a similar error message (just

[R] Three questions about plotting

2014-02-27 Thread David Parkhurst
I would like to plot three graphs, one above the other, of three “y” variables that have different scales against a common Date variable, as with the code below. Q1. If I understand correctly, I can't use lattice graphics because my y's have different scales. Is that correct? All the

Re: [R] Three questions about plotting

2014-02-27 Thread Gabor Grothendieck
On Thu, Feb 27, 2014 at 7:19 PM, David Parkhurst parkh...@imap.iu.edu wrote: I would like to plot three graphs, one above the other, of three y variables that have different scales against a common Date variable, as with the code below. Q1. If I understand correctly, I can't use lattice

Re: [R] time series analysis

2014-02-27 Thread Pascal Oettli
Hello, Maybe functions xts, endpoints and period.apply of the xts package might help you. Regards, Pascal On Fri, Feb 28, 2014 at 1:32 AM, Yang Yang simonyangy...@gmail.com wrote: Hi Currently I am working on a river discharge data analysis. I have the daily discharge record from 1935 to

Re: [R] expressions (nesting, substitution, 2-stage evaluation)

2014-02-27 Thread David Winsemius
On Feb 27, 2014, at 3:17 PM, Bert Gunter wrote: ?plotmath -- Bert Daryl;; I think what Bert was hoping you would do was read the plotmath page and figure it out on your own but that can be a bit tricky when working with expression object vectors. Here is (perhaps) a step forward:

Re: [R] Three questions about plotting

2014-02-27 Thread Jim Lemon
On 02/28/2014 11:19 AM, David Parkhurst wrote: I would like to plot three graphs, one above the other, of three “y” variables that have different scales against a common Date variable, as with the code below. Q1. If I understand correctly, I can't use lattice graphics because my y's have

[R] pre-allocation not always a timesaver

2014-02-27 Thread Ross Boylan
The R Inferno advises that if you are building up results in pieces it's best to pre-allocate the result object and fill it in. In some testing, I see a benefit with this strategy for regular variables. However, when the results are held by a class, the opposite seems to be the case. Comments?

Re: [R] expressions (nesting, substitution, 2-stage evaluation)

2014-02-27 Thread Daryl Morris
Hi, Both your code and my code work when I don't combine things. The problem is when I want to combine an expression (or a bquote in your example) with something else e.g. this doesn't work: vectorA = c( bquote(TNF-*alpha), bquote(IFN-*gamma) ) for(ii in vectorA) { plot(0:1,0:1)

Re: [R] expressions (nesting, substitution, 2-stage evaluation)

2014-02-27 Thread Daryl Morris
Yes, plotmath contains expressions. The example produced in ?plotmath is not as complex as the example I provided. bquote and substitute allow substitutions of variables ... but what I need to be able to do is substitute an expression... and that is the magic I'm looking for. thanks, Daryl

[R] Parameter fitting by using minpack.lm package

2014-02-27 Thread Rajendra Paudel
Hi! I am trying to fit 2-dimensional data (global data with 2-degree resolution) using nls.lm function of minpack.lm package. I am successful to fit the transient data in a single grid point but not able to fit 2-D data. The error message is listed below. I am just wondering if anybody has used

[R] Data Rearrangement

2014-02-27 Thread dila radi
Hi all, I know this is easy, but I really do not have any idea to solve it. I have this kind of data set: dat - read.table(text=Day Year Jan Feb Mar Apr 1 2012 0 2.5 0.5 2 2 2012 0 6.5 0 29 3 2012 0 9.5 0 0 4 2012 0 0 8 0.5 5 2012 0 5 0.5 110.5 6 2012 0 4 3.5 22 7 2012 11 0

[R] New to R

2014-02-27 Thread George Katsuras
I successfully downloaded and loaded the stockPortfolio and quadprog packages, but when I entered the following command I got an error: returns - getReturns(names(stocks), freq=week) Error in file(file, rt) : cannot open the connection In addition: Warning message: In file(file, rt) : cannot

Re: [R] expressions (nesting, substitution, 2-stage evaluation)

2014-02-27 Thread Bert Gunter
1. I don't think this is the right way to go about this. I would think about making pieces of your title arguments and assembling them in your call. ... But be that as it may... 2. The problem is that in your loop, ii is already an expression -- a language object. Pasting to it is meaningless.

Re: [R] expressions (nesting, substitution, 2-stage evaluation)

2014-02-27 Thread David Winsemius
On Feb 27, 2014, at 9:55 PM, Bert Gunter wrote: 1. I don't think this is the right way to go about this. I would think about making pieces of your title arguments and assembling them in your call. ... But be that as it may... 2. The problem is that in your loop, ii is already an

Re: [R] Data Rearrangement

2014-02-27 Thread David Winsemius
On Feb 27, 2014, at 7:24 PM, dila radi wrote: Hi all, I know this is easy, but I really do not have any idea to solve it. I have this kind of data set: dat - read.table(text=Day Year Jan Feb Mar Apr 1 2012 0 2.5 0.5 2 2 2012 0 6.5 0 29 3 2012 0 9.5 0 0 4 2012 0 0 8 0.5 5

[R] how is the model resample performance calculated by caret?

2014-02-27 Thread zhenjiang zech xu
Dear all, I did a 5-repeat of 10-fold cross validation using partial least square regression model provided by caret package. Can anyone tell me how are the values in plsTune$resample calculated? Is that predicted on each hold-out set using the model which is trained on the rest data with the

[R] acessing symbols dynamically through a gedit box using getsymbol function

2014-02-27 Thread Ashis Deb
I had tried a little weird way of accessing symbols from YAHOO.FINANCE in my GUI which is made in gwidgets ...Here is an example:-- tbl[5,1]=glabel(ENTER SYMBOL:-,cont=tbl) tbl[5,2]=gedit(, cont=tbl,coerce.with=as.character) BSS-function(h,...) { options(guiToolkit=RGtk2) data - new.env()

Re: [R] ggplot/ barplot

2014-02-27 Thread arun
Hi Farnoosh, YOu can try:  DataA$percent - with(DataA,round((Var2/sum(Var2))*100,2)) library(ggplot2)   ggplot(DataA,aes(x=Var1,y=percent))+geom_bar(stat=identity,aes(fill=Var1))+geom_text(label=paste0(DataA$percent,%),vjust=-0.2,size=4) A.K. On Thursday, February 27, 2014 5:02 PM, farnoosh

Re: [R] ggplot/ barplot

2014-02-27 Thread farnoosh sheikhi
You are the best. Thanks tons:))   Regards, Farnoosh Sheikhi On Thursday, February 27, 2014 10:37 PM, arun smartpink...@yahoo.com wrote: Hi Farnoosh, YOu can try:  DataA$percent - with(DataA,round((Var2/sum(Var2))*100,2)) library(ggplot2)  

Re: [R] Data Rearrangement

2014-02-27 Thread PIKAL Petr
Hi Your data came scrambled as you in contrary to advice post in HTML. So it is just a guess but maybe you want library(reshape) melt(dat, id=c(Year, Day)) Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of dila radi