[R] Different result on using apply.

2011-07-29 Thread Ashim Kapoor
Dear R-helpers, In the following example I compute ret and returns the SAME way. In ret I use compute returns for EACH column and in returns I do it for the whole data frame. Could someone please tell me why I see a lagged result,by which I mean ret and returns are different by one lag.

Re: [R] bug in dev.copy2pdf output?

2011-07-29 Thread Prof Brian Ripley
This is all in the help page for pdf ... including a request not to falsely blame R and two workarounds for the broken viewers. On Thu, 28 Jul 2011, Duncan Murdoch wrote: On 11-07-28 1:22 PM, selwyn quan wrote: Hi, Am using R 2.13.1 on Linux (Fedora). Is anybody else having problems with

Re: [R] Can R (without GUI) be compiled with static linking?

2011-07-29 Thread Barry Rowlingson
On Thu, Jul 28, 2011 at 10:54 PM, Jonathan Callahan jonat...@mazamascience.com wrote: One of their requirements (hard or soft?) is that each module in the framework be compiled with statically linked libraries into a standalone binary that can be run from the command line. But if they insist

[R] wilcoxon signed test

2011-07-29 Thread Ungku Akashah
hello, i'm searching the r-coding to plot wilcoxon signed test. i already searched everywhere for a month, but i didn't found it. Could anyone help me, please. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] bug in dev.copy2pdf output?

2011-07-29 Thread Martin Maechler
sq == selwyn quan selw...@stanford.edu on Thu, 28 Jul 2011 15:59:14 -0700 writes: sq On Fri, 29 Jul 2011, Rolf Turner wrote: On 29/07/11 09:51, selwyn quan wrote: On Thu, 28 Jul 2011, Duncan Murdoch wrote: On 11-07-28 1:22 PM, selwyn quan wrote:

Re: [R] order a data frame after date and hour

2011-07-29 Thread anglor
Hi, thank you for the reply! I'm sorry I added so little information. I thought DateHour was a character class but it was a factor. So I converted to character and order worked as you described. For this time I only wanted to convert DateHour to a number because I thought I had to do that in

[R] [R-pkgs] xgrid package: Access Apple Xgrid using R

2011-07-29 Thread Nicholas Horton
The package xgrid 0.1-11 is now available on CRAN.  The package provides functions to distribute and collate results from simulation studies and other computationally expensive tasks to Apple Xgrid clusters from within R. More specifically, the routines within the package facilitate access to

Re: [R] order a data frame after date and hour

2011-07-29 Thread anglor
Thanks for a patient reply... I feel really stupid about this other problem dput(). What I didn't understand is how I can make the same thing with my data. You use rnorm and rpois which generates random poisson ditribution and normal distribution purhaps just to create a data.frame? Should I

[R] 'breackpoints' (package 'strucchange'): 2 blocking error messages when using for multiple regression model testing

2011-07-29 Thread Michel Lutz
Good morning to all, I am encountering a blocking issue when using the function 'breackpoints' from package 'strucchange'. *Context:* I use a data frame, 248 observations of 5 variables, no NA. I compute a linear model, as y~x1+...+x4 x4 is a dummy variable (0 or 1). I want to check this model

Re: [R] Different result on using apply.

2011-07-29 Thread peter dalgaard
(oops, forgot to cc. the list) On Jul 29, 2011, at 08:09 , Ashim Kapoor wrote: Dear R-helpers, In the following example I compute ret and returns the SAME way. In ret I use compute returns for EACH column and in returns I do it for the whole data frame. Could someone please tell me why I

Re: [R] Different result on using apply.

2011-07-29 Thread Dennis Murphy
Hi: To add to Peter Dalgaard's comments, a look at head(ret) and head(returns) would also have clued you in: head(ret, 1) GOOG.OpenGOOG.High GOOG.Low GOOG.Close GOOG.Volume 2007-01-03 1.377067e-05 3.184271e-05 3.378641e-05 7.049545e-05 3.01405e-09

[R] Environment of a LM created in a function

2011-07-29 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Dear all, Quite often I have the situation that I've multiple response variables and I create Linear Models for them in a function. The following code illustrates my usual approach: ---8--- set.seed(123) dat - data.frame(x = rep(rep(1:3, each = 3), 4), y = rep(1:3, 12))

Re: [R] ?plot: Add an example on how to plot functions to the help of `plot`.

2011-07-29 Thread Paul Menzel
Am Donnerstag, den 28.07.2011, 09:12 +0200 schrieb Martin Maechler: PM == Paul Menzel paulepan...@users.sourceforge.net on Wed, 27 Jul 2011 23:53:51 +0200 writes: […] PM So my newest suggestion is to add a comment to PM plot(sin, -pi, 2*pi) PM in `?plot`. Like

Re: [R] ggplot2 help/suggestions needed

2011-07-29 Thread ONKELINX, Thierry
Dear Bruce, It's doable with ggplot2, but image() is probably a better solution. To use ggplot2, you will need to convert your array into a data.frame where each row has the information for one cell (x, y and colour) library(ggplot2) #create some dummy data dataset - expand.grid(x =

Re: [R] 'breackpoints' (package 'strucchange'): 2 blocking error messages when using for multiple regression model testing

2011-07-29 Thread Achim Zeileis
Michel: I am encountering a blocking issue when using the function 'breackpoints' from package 'strucchange'. *Context:* I use a data frame, 248 observations of 5 variables, no NA. I compute a linear model, as y~x1+...+x4 x4 is a dummy variable (0 or 1). I want to check this model for

[R] Problems with ks.test()

2011-07-29 Thread Jochen1980
Hi, I got two data point vectors. Now I want to make a ks.test(). I you print both vectors you will see, that they fit pretty fine. Here is a picture: http://www.jochen-bauer.net/downloads/kstest-r-help-list-plot.png As you can see there is one histogram and moreover there is the gumbel

Re: [R] R, ctree and categorical variables

2011-07-29 Thread Achim Zeileis
On Thu, 28 Jul 2011, seanstcl...@verizon.net wrote: I am running the ctree function in R. My data has about 10 variables, many of which are categorical. 2 of the categorical variables have many levels (one has 900 levels, another has 1,000 levels). As an example, 1 of these

Re: [R] fitting a sinus curve

2011-07-29 Thread Hans W Borchers
David Winsemius dwinsemius at comcast.net writes: On Jul 28, 2011, at 1:07 PM, Hans W Borchers wrote: maaariiianne marianne.zeyringer at ec.europa.eu writes: Dear R community! I am new to R and would be very grateful for any kind of help. I am a PhD student and need to fit a

Re: [R] 'breackpoints' (package 'strucchange'): 2 blocking error messages when using for multiple regression model testing

2011-07-29 Thread Michel Lutz
Achim, Thank you so much for this prompt answer. Really appreciated ! Anyway, I am still a bit lost... don't you mind if I ask you somme additional questions? * *one standard approach is to employ a HACcovariance matrix* I did many researches but I never found this recommendation. The only

[R] GMM, panel data, functions lag() and diff()

2011-07-29 Thread Cecilia Carmo
I’m starting to use the GMM estimator with panel data in R. I´ve read the document «Panel Data Econometrics in R: The plm Package» (Croissant and Millo). In Stata before using the functions lag() or diff() we must sort the data by individual and by time. I would like to know if I have to do

Re: [R] wilcoxon signed test

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 3:18 AM, Ungku Akashah wrote: hello, i'm searching the r-coding to plot wilcoxon signed test. i already searched everywhere for a month, but i didn't found it. You need to work on your searching skills. It should have taken a few seconds: # ??wilcoxon (Only four

[R] Multifactor boxplots

2011-07-29 Thread Tom Wilding
Dear All I would like to produce interaction boxplots and this seems to work: par(mfrow=c(2,2)) A=sample(rnorm(50,50,10)) B=sample(rnorm(50,100,10)) Test=merge(A,B,by=0)#by=0 where 0 is the row.names TreatA=(gl(2,50,100,labels=c(High,Low))) TreatB=rep(gl(2,25,50,labels=c(High,Low)),2)

[R] Odp: Multifactor boxplots

2011-07-29 Thread Petr PIKAL
Hi Dear All I would like to produce interaction boxplots and this seems to work: par(mfrow=c(2,2)) A=sample(rnorm(50,50,10)) B=sample(rnorm(50,100,10)) Test=merge(A,B,by=0)#by=0 where 0 is the row.names TreatA=(gl(2,50,100,labels=c(High,Low)))

Re: [R] Unable to install packages on Mac OS X

2011-07-29 Thread Miguel Leal
Thank you David for your answer. The lattice package was not a good example. The thing is the same errors occurs with any package I try to install. Thank you Miguel On Jul 28, 2011, at 4:31 PM, David Winsemius wrote: On Jul 28, 2011, at 3:08 PM, Miguel Leal wrote: I'm having problems

Re: [R] How to use as.Date (or something else) with 31-Jul-2010 23:59:00

2011-07-29 Thread Gabor Grothendieck
On Thu, Jul 28, 2011 at 6:54 PM, Eduardo M. A. M.Mendes emammen...@gmail.com wrote: Hello Many thanks. Sorry for not replying earlier but I have followed advice and read as much documentation as I could. I managed to get a zoo object the way I want dadoszoo : 'zoo' series from 2010-06-27

[R] dlmSum(...) and non-constant state space models

2011-07-29 Thread Alan Fernihough
Hello, I would be very grateful if somebody more knowledgeable then me could assist me in the following. I have two (three actually but for simplicity I will say two) models which I would like to fit jointly as a state space object. Here are the equations: (1) w = a1 + b1*(p) + e1 a1 = a1[t-1]

Re: [R] [Rd] R CMD CHECK doens't run configure when testing install? (Revised)

2011-07-29 Thread Simon Urbanek
On Jul 28, 2011, at 6:56 PM, Alexander James Rickett wrote: I'm trying to get ready to submit a package to CRAN, but in order for the package to install on OS X, I need to temporarily set the environment variable NOAWT=1. I put 'export NOAWT=1' in my package's 'configure' script, and 'R

[R] Using perm.t.test() upon Matrix/Dataframe columns parted by factor instead of t.test()

2011-07-29 Thread Gunnar Oehmichen
Hello dear subscribed Users, this is my first post, so please forgive me for any inconveniences. The following problem: I have a dataframe containing a factor column. For each column i would like to compare means as parted by the factor. Using the normal t.test function I have already achieved

[R] boxplots

2011-07-29 Thread Martin Olofsson
Hi! My name is Martin and I have a problem concerning the boxplot function in R. I want my boxes to be limited by the 1st and 3rd quartile and NOT the 'hinges' values that are the default setting in R. Do anyone knows if there is any command that I could do to change this default setting?

[R] How to interpret Kolmogorov-Smirnov stats

2011-07-29 Thread baxy77
Hi, Interpretation problem ! so what i did is by using the: fit1 - fitdist(vectNorm,beta) Warning messages: 1: In dbeta(x, shape1, shape2, log) : NaNs produced 2: In dbeta(x, shape1, shape2, log) : NaNs produced 3: In dbeta(x, shape1, shape2, log) : NaNs produced 4: In dbeta(x, shape1, shape2,

[R] R in Linux (Ubuntu)

2011-07-29 Thread gaiarrido
Hi, I´m trying to move to ubuntu at all, but I don´t like R in Ubuntu because it runs in the terminal, so i can´t access directly to some options R gots in Windows. Is there any R can i install in ubuntu which runs in hos own prompt or terminal?? Thanks - Mario Garrido Escudero PhD student

Re: [R] GLM different results with the same factors

2011-07-29 Thread gaiarrido
Thanks very much again, I´m reading some papers and articles about this issue and I think i´m starting to understand the problem. And thanks for the link to Professor Fox about the non-sequential Anova. I'll be back with more doubts. I'm sure of that. - Mario Garrido Escudero PhD student

[R] Cplex solver and optimization in R

2011-07-29 Thread sasanthi
Dear all, I want to work with R in an optimization problem and I was wondering if there are any available solvers. I found RCplex package but downloading it, I get problems. Why? Is it not free? are there any other solvers available? many thanks! -- View this message in context:

[R] converting factor to numeric gives NAs introduced by coercion

2011-07-29 Thread anglor
Hi, I have a dataframe that I imported from a .txt file by: skogTemp - read.delim2(Skogaryd_shoot_data.txt, header=TRUE, fill=TRUE) and the data are factors, how can avoid factors from the beginning? Although the file contains both characters and numbers. I tried to convert some of the columns

[R] How to calculate Total least squares in R? (Orthogonal regression)

2011-07-29 Thread Dail
Hello, Is there a function to calculate TLS - Total least squares (orthogonal regression) with R? Thank you -- View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-Total-least-squares-in-R-Orthogonal-regression-tp3703863p3703863.html Sent from the R help mailing list

Re: [R] Using perm.t.test() upon Matrix/Dataframe columns parted by factor instead of t.test()

2011-07-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Just a hunch I can't test from my phone, but in your final lapply you are passing a function of x that has no x in it, so I wouldn't be surprised if R was unhappy about that. Change the latter M's to x and see if that helps. Cheers Michael Weylandt On Jul 29, 2011, at 6:30 AM, Gunnar

Re: [R] 'breackpoints' (package 'strucchange'): 2 blocking error messages when using for multiple regression model testing

2011-07-29 Thread Hadley Wickham
struc.test - breakpoints(y~x1+x2+x3+x3+x4, data=D) *I get an error message:*  Erreur dans chol2inv(qr.R(fm$qr)) :  l'?l?ment (5, 5) est nul, donc l'inverse ne peut ?tre calcul? (sorry for the french version, I don't know how to get the message english translation in R). My first

Re: [R] Unable to install packages on Mac OS X

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 8:13 AM, Miguel Leal wrote: Thank you David for your answer. The lattice package was not a good example. The thing is the same errors occurs with any package I try to install. Read all of the message, this time for meaning. You appear to have ignored my suggestion

[R] 'breackpoints' (package 'strucchange'): 2 blocking error messages when using for multiple regression model testing

2011-07-29 Thread Michel Lutz
Hi Hadley, Thanks for the idea, but this was a typo... My code is the following: D - data.frame(CPU=pred.cor2$CPU, PREP=PREP, BRG=BIZ$JOBPREPLOTRULE_BRG, CLOG=res.WIP, WE=DUMMY) model.mes - CPU~PREP+BRG+CLOG+WE stab.model - Fstats(model.mes, data = D, from = 0.1, vcov = function(x,

Re: [R] Multifactor boxplots

2011-07-29 Thread Dennis Murphy
Hi: Here are a couple of attempts, one with base graphics and one with lattice. d - data.frame(TreatA = gl(2, 50, 100, labels = c('High', 'Low')), TreatB = rep(gl(2, 25, 50, labels = c('High', 'Low')), 2), Test = c(rnorm(50, 50, 10), rnorm(50, 100, 10))) lbl -

Re: [R] How to calculate Total least squares in R? (Orthogonal regression)

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 8:20 AM, Dail wrote: Hello, Is there a function to calculate TLS - Total least squares (orthogonal regression) with R? Searching the archives should bring up plenty of on target advice. -- David Winsemius, MD West Hartford, CT

[R] scripting/littler: How to call function named iteratively (`f1`, `f2`, …)?

2011-07-29 Thread Paul Menzel
Dear R folks, wanting to compare different implementations of a solution I want to script it to iterate over the different implementations. Is there a way to do this in the R shell/command line? $ more /tmp/iterf.r f1 - function(n = 10, l = 10)

Re: [R] R in Linux (Ubuntu)

2011-07-29 Thread Rainer M Krug
On Fri, Jul 29, 2011 at 10:03 AM, gaiarrido gaiarr...@usal.es wrote: Hi, I´m trying to move to ubuntu at all, but I don´t like R in Ubuntu because it runs in the terminal, so i can´t access directly to some options R gots in Windows. Is there any R can i install in ubuntu which runs in hos

Re: [R] How to calculate Total least squares in R? (Orthogonal regression)

2011-07-29 Thread Ben Bolker
David Winsemius dwinsemius at comcast.net writes: On Jul 29, 2011, at 8:20 AM, Dail wrote: Is there a function to calculate TLS - Total least squares (orthogonal regression) with R? Searching the archives should bring up plenty of on target advice. Also, please don't cross-post to

Re: [R] Using perm.t.test() upon Matrix/Dataframe columns parted by factor instead of t.test()

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 9:11 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Just a hunch I can't test from my phone, but in your final lapply you are passing a function of x that has no x in it, so I wouldn't be surprised if R was unhappy about that. Change the latter M's to x

Re: [R] Odp: Multifactor boxplots

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 8:05 AM, Petr PIKAL wrote: Hi Dear All I would like to produce interaction boxplots and this seems to work: par(mfrow=c(2,2)) A=sample(rnorm(50,50,10)) B=sample(rnorm(50,100,10)) Test=merge(A,B,by=0)#by=0 where 0 is the row.names

Re: [R] Cplex solver and optimization in R

2011-07-29 Thread Dennis Murphy
Start here: http://cran.r-project.org/web/views/Optimization.html HTH, Dennis On Fri, Jul 29, 2011 at 1:29 AM, sasanthi chrys...@gmail.com wrote: Dear all, I want to work with R in an optimization problem and I was wondering if there are any available solvers. I found RCplex package but

[R] Changing font type within y axis labels

2011-07-29 Thread Philip Boulcott
I wish place the following axis label in such a manner that some of the text is plain and the scientific name is in italics (i.e. a mixture of two font types) Using plot: mtext(Total Landings of Pecten maximus (tonnes),font,=3, side=2, line=3) makes everything italic, but how do I

[R] coordinates from locator function in POSIXct format

2011-07-29 Thread cristabel.duran
Dear R-list, I have a plot with y-axis corresponding to wind measurments and x-axis with date-time information. When I want to identify some extrem wind events in the wind-curve, I use locator() to get the exact date-information, by clicking in the points in graph I´m interested in. I get in the

Re: [R] converting factor to numeric gives NAs introduced by coercion

2011-07-29 Thread Dennis Murphy
Hi: The argument stringsAsFactors = FALSE will suppress character data from being converted to factors. For more control, see the arguments colClasses and as.is in ?read.table - they should carry over to read.delim[2] but don't quote me on that :) HTH, Dennis On Fri, Jul 29, 2011 at 1:45 AM,

Re: [R] scripting/littler: How to call function named iteratively (`f1`, `f2`, …)?

2011-07-29 Thread Eik Vettorazzi
Hi Paul, how about this for (i in 1:2) { print( do.call(paste(f,i,sep=),list(2, 3) )) } or using get for (i in 1:2) { print( get(paste(f,i,sep=))(2, 3) ) } cheers Am 29.07.2011 15:28, schrieb Paul Menzel: Dear R folks, wanting to compare different implementations of a solution I want to

Re: [R] boxplots

2011-07-29 Thread Sarah Goslee
Martin, I don't know of an easy way to make that change, but do note: The two ‘hinges’ are versions of the first and third quartile, i.e., close to ‘quantile(x, c(1,3)/4)’. The hinges equal the quartiles for odd n (where ‘n - length(x)’) and differ for even n. Whereas the

Re: [R] scripting/littler: How to call function named iteratively (`f1`, `f2`, …)?

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 9:28 AM, Paul Menzel wrote: Dear R folks, wanting to compare different implementations of a solution I want to script it to iterate over the different implementations. Is there a way to do this in the R shell/command line? You might consider examining the short and

Re: [R] [solved] scripting/littler: How to call function named iteratively (`f1`, `f2`, …)?

2011-07-29 Thread Paul Menzel
Dear Eik, Am Freitag, den 29.07.2011, 15:46 +0200 schrieb Eik Vettorazzi: how about this for (i in 1:2) { print( do.call(paste(f,i,sep=),list(2, 3) )) } or using get for (i in 1:2) { print( get(paste(f,i,sep=))(2, 3) ) } works great for me. Thank you very much. Regarding search machines

Re: [R] Changing font type within y axis labels

2011-07-29 Thread Eik Vettorazzi
Hi Philip, have a look at ?plotmath and try mtext(expression(paste(Total Landings of~~italic(Pecten maximus),(tonnes))), side=2,line=2) ~~ is used for extra space between plain and italic font, but that might be a matter of taste. hth. Am 29.07.2011 15:34, schrieb Philip Boulcott: I wish

[R] example for plot.compare.datasets() in package rioja fails

2011-07-29 Thread Jason Paul Joines
I'm using rioja 0.5-6 with R 2.12.1 / x86_64-pc-linux-gnu on Kubuntu 11.04. When I run this example from the rioja reference manual: library(rioja) # compare diatom data from core from Round Loch of Glenhead # with SWAP surface sample dataset data(RLGH) data(SWAP) result -

Re: [R] R in Linux (Ubuntu)

2011-07-29 Thread gaiarrido
Thanks very much, and...Which do you recommend? - Mario Garrido Escudero PhD student Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola Universidad de Salamanca -- View this message in context: http://r.789695.n4.nabble.com/R-in-Linux-Ubuntu-tp3703329p3704107.html

Re: [R] Changing font type within y axis labels

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 10:10 AM, Eik Vettorazzi wrote: Hi Philip, have a look at ?plotmath and try mtext(expression(paste(Total Landings of~~italic(Pecten maximus),(tonnes))), side=2,line=2) ~~ is used for extra space between plain and italic font, but that might be a matter of taste. And the

Re: [R] boxplots

2011-07-29 Thread Joshua Wiley
Hi Martin, As Sarah said, I do not know of any way to change the default, but you can certainly do it manually each time. Here is an example: ## generate some data set.seed(10) x - rnorm(101) ## store boxplot results s - boxplot(x, plot = FALSE) ## look at them s ## replace the stats with lower

Re: [R] R in Linux (Ubuntu)

2011-07-29 Thread ONKELINX, Thierry
Dear Mario, Have a look at Eclipse with the StatET plugin. One of the benefits is that is available for both Linux and Windows which simplifies things when you need to switch often between Windows and Linux (e.g. Windows at work and Linux at home). Best regards, Thierry

Re: [R] R in Linux (Ubuntu)

2011-07-29 Thread Rainer M Krug
On Fri, Jul 29, 2011 at 3:49 PM, gaiarrido gaiarr...@usal.es wrote: Thanks very much, and...Which do you recommend? I am using emacs + ESS - but as you have mentioned options, I assume you would like to e.g. manage package installation from the GUI - which you can do with both mentioned GUIs.

[R] HIRHAM netcdf files

2011-07-29 Thread Ana
Can someone help me out with a small problem? I've started using netcdf files recently, and I want to extract the grid id and also the coordinates from a HIRHAM netcdf file. I know how to extract a slice of dataset both in space and in time and I also know the area that this file should cover,

Re: [R] coordinates from locator function in POSIXct format

2011-07-29 Thread Jannis
Well,if you would have had a look at ?POSIXct the documentation would have given you quite a comprehensive explanation of the meaning of the values of your time vector as they are the values these POSIXct values are actually stored in (they are seconds since 1970-01-01). Additionally you

Re: [R] help with rpart

2011-07-29 Thread Sarah Goslee
Mark, The R-help list is not telepathic. I asked entirely reasonable follow-up questions intended to elicit from you a more extensive explanation of your problem. On Fri, Jul 29, 2011 at 10:26 AM, m...@statcourse.com wrote: 1. I did not receive your reply, which, not incidentally, does not

[R] inside argument in barplot

2011-07-29 Thread Colin Bergeron
Dear list, I want to plot a sample depth curve over a barplot. It would be perfect if the argument inside in the barplot function would be functional, cause I could just add this curve to the actual barplot, but it seems like it is not (not yet implemented). Argument inside would allow not to

Re: [R] HIRHAM netcdf files

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 10:44 AM, Ana wrote: Can someone help me out with a small problem? I've started using netcdf files recently, and I want to extract the grid id and also the coordinates from a HIRHAM netcdf file. I know how to extract a slice of dataset both in space and in time and I

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Roy Mendelssohn
I am not familiar with the HIRHAM netcdf files. Do you have the netcdf library installed and can you print the output of the ncdump -h command on one of the files? -Roy On Jul 29, 2011, at 7:44 AM, Ana wrote: Can someone help me out with a small problem? I've started using netcdf files

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Jannis
This problem may be more related to netcdf files than to RAnd the answer to your question very much depends on which netcdf convention the AWI folks who created your data followed. Additionally it depends on the Software you use to read these ncdf files. Regarding the grid locations

Re: [R] Animated gif or something similar in R?

2011-07-29 Thread Dale Coons
Thanks to several who responded--I should have looked (doh!) in the documentation. play3d() and movie3d() were just the ticket! On 7/28/2011 4:48 PM, Jean V Adams wrote: Dale, I do not have the same color problem when I run your code on my PC. The colors in both devices look the same.

Re: [R] HIRHAM netcdf files

2011-07-29 Thread David William Pierce
On Fri, Jul 29, 2011 at 7:44 AM, Ana rrast...@gmail.com wrote: Can someone help me out with a small problem? I've started using netcdf files recently, and I want to extract the grid id and also the coordinates from a HIRHAM netcdf file. I know how to extract a slice of dataset both in space

Re: [R] inside argument in barplot

2011-07-29 Thread Jannis
Dear Collin, as always, a reproducible example code would help us to understand what you want to do. This way I can only guess And my guess would be that it is much easier to use: par(new=TRUE) and to superimpose the barplot with whatever curve you want to include. You may need to set

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Ana
Hi Roy and David, My main problem is how to interpret the coordinate system. If I try to open it directly in a GIS software that supports necdf format, the location is far away from where it should be (plots rlong,rlat). All I want to do is to get a data.frame with a column for long, another for

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Roy Mendelssohn
Hi Ana: On Jul 29, 2011, at 8:03 AM, Ana wrote: netcdf precip.DMI.HS1 { dimensions: rlat = 84 ; rlon = 90 ; time = 10800 ; time_bnds = 2 ; variables: float lat(rlat, rlon) ; lat:standard_name = latitude ; lat:long_name = latitude

[R] help with plot.rpart

2011-07-29 Thread mark
à data=read.table(http://statcourse.com/research/boston.csv;, , sep=,, header = TRUE) à library(rpart) à fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT) Please: Show me the tree. Mark Original Message Subject: Re: [R] help

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Jannis
Well, the CF ncdf convention (for example) suggests to use variables with identical names as the dimensions as coordinate variables. In your case the dimensions are called rlat/rlong so the software uses these rotated axes. In your file you however also have variables lat and long and they

Re: [R] inside argument in barplot

2011-07-29 Thread Colin Bergeron
Thanks Jannis, I am including an example code of what I am trying to do: par(mar=c(4,5,3,1)) barplot(Value[,1],space=0, col=grey30,axis.lty=2) barplot(sampledepth[,1]/2, space=0, col=grey30, inside=FALSE, add=TRUE) sampledepth is divided by two to have the same axis scale as Value

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Barry Rowlingson
       float lat(rlat, rlon) ;                lat:standard_name = latitude ;                lat:long_name = latitude ;                lat:units = degrees_north ;        float lon(rlat, rlon) ;                lon:standard_name = longitude ;                lon:long_name = longitude ;        

Re: [R] help with plot.rpart

2011-07-29 Thread Sarah Goslee
Ah, now we're getting somewhere. Think how easy this would be if you'd provided this information initially. On Fri, Jul 29, 2011 at 11:11 AM, m...@statcourse.com wrote: Ø  data=read.table(http://statcourse.com/research/boston.csv;, , sep=,, header = TRUE) Ø  library(rpart) Ø  fit=rpart (MV~

Re: [R] help with plot.rpart

2011-07-29 Thread Joshua Wiley
Mark, The below is not directly reproducible. There is no MV or PT variable in the dataset you reference. I am assuming you meant: dat - read.table(http://statcourse.com/research/boston.csv;, , sep=,, header = TRUE) fit - rpart(MEDV ~ CRIM + ZN + INDUS + CHAS + NOX + RM + AGE + DIS + RAD +

Re: [R] help with predict.rpart

2011-07-29 Thread mark
 data=read.table(http://statcourse.com/research/boston.csv;, , sep=,, header = TRUE)  library(rpart)  fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT) predict(fit,data[4,]) plot only reveals part of the tree in contrast to the results on obtains

[R] special recursive filter

2011-07-29 Thread Konrad Schubert
Hi, I have a question about a special recursive filter problem. What I have: - given variables: x: time series with rather randomly occuring '0' and '1' wait: non negative integer - a working but ineffectiv implementation (see below) How the implementation works (what I want): The filter

Re: [R] Data aggregation question

2011-07-29 Thread David Warren
Hi all, table() did the trick, and very efficiently, too! Thanks for the advice, Dave On Thu, Jul 28, 2011 at 5:39 PM, David Winsemius dwinsem...@comcast.netwrote: On Jul 28, 2011, at 4:24 PM, David Warren wrote: Hi all, I'm working with a sizable dataset that I'd like to

Re: [R] effect size

2011-07-29 Thread h_bumann
I understand, that eta^2 presents a useful measure of effect sizes. However, the power-calculation-tool G*Power I intend to use, requires an Effect size f which is calculated like this: Variance explained by special effect / Variance explained by special effect + Variance within groups I run a

Re: [R] help with plot.rpart

2011-07-29 Thread mark
Your plot only shows part of the tree provided by print(fit). I would like to plot the entire tree. Original Message Subject: Re: [R] help with plot.rpart From: Joshua Wiley [1]jwiley.ps...@gmail.com Date: Fri, July 29, 2011 8:25 am To:

[R] Apostrophes in R Commander in recode

2011-07-29 Thread Simon Kiss
Dear colleagues, I'm using R64 (2.13) on Mac OS 10.6.8 and I've encountered a problem with the recode function in Rcommander. The application cannot deal with apostrpohes ( ' ) do not. I've got a factor from the 2008 Canada Election study (highest level of schooling) and some of the values

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Roy Mendelssohn
The rlat and rlon variables are the grid coordinate system, which appears to be some non-standard conical projection. Climate scientists! Actually this file, as it contents state, follow the CF convention, which is widely used in climate science, oceanography and atmospheric science

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Ana
Hi! Thank you all. I finally understood the way to solve the problem from Barry's mail. From the file created with coordinates(Lat,Long) using fan, everything looks ok (wgs84). I will now try Bryan's approach in R. Ana On Fri, Jul 29, 2011 at 4:22 PM, Barry Rowlingson

Re: [R] help with predict.rpart

2011-07-29 Thread Sarah Goslee
On Fri, Jul 29, 2011 at 11:26 AM, m...@statcourse.com wrote:        data=read.table(http://statcourse.com/research/boston.csv;, , sep=,, header = TRUE)        library(rpart)        fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT)        predict(fit,data[4,]) plot

Re: [R] HIRHAM netcdf files

2011-07-29 Thread Barry Rowlingson
On Fri, Jul 29, 2011 at 4:32 PM, Roy Mendelssohn roy.mendelss...@noaa.gov wrote: Actually this file, as it contents state, follow the CF convention, which is widely used in climate science, oceanography and atmospheric science  (see http://cf-pcmdi.llnl.gov/documents/cf-conventions).  The

Re: [R] special recursive filter

2011-07-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
I'm not sure I understand what your filter intends to do, but could this not be done more efficiently with logicals and the which? You also might need the cumsum() function and diff() with the optional lag argument if I've misunderstood your filter. Specifically try this: res =

[R] rpart, resolution

2011-07-29 Thread mark
Thank you for all your help. The unexpected solution to my predict() problem was to use the Misc menu and remove all objects before proceeding further. The final digits of the trees continue to be clipped but I can live with that. Mark __

[R] splitting a string based on the last underscore

2011-07-29 Thread Dimitri Liakhovitski
Hello! Hope you could help me split the strings. I have a set of strings: x-c(name_a1_2.5.o,name_a2_2.53.o,name_a3_bla_1.o) I need to extract from each string: 1. Its unique part that comes before the last _, i.e.: a1,a2,a3_bla. 2. The part that comes after the last _ and before .o at the end,

[R] finding a faster way to run lm on rows of predictor matrix

2011-07-29 Thread cypark
Hi, everyone. I need to run lm with the same response vector but with varying predictor vectors. (i.e. 1 response vector on each individual 6,000 predictor vectors) After looking through the R archive, I found roughly 3 methods that has been suggested. Unfortunately, I need to run this task

Re: [R] Apostrophes in R Commander in recode

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 11:32 AM, Simon Kiss wrote: Dear colleagues, I'm using R64 (2.13) on Mac OS 10.6.8 and I've encountered a problem with the recode function in Rcommander. It's probably in a package named 'car'. library(car) ?recode The application cannot deal with apostrpohes ( ' )

Re: [R] Animated gif or something similar in R?

2011-07-29 Thread Gene Leynes
I wasn't at my normal computer yesterday, so I didn't run the example. I thought rgl was one of those color palette generator packages. So, my suggestion of using animation was completely off base (oops). But I did notice two other things: 1) your color column changes from a factor to a

Re: [R] special recursive filter

2011-07-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Oh darn, I missed the recursive-ness entirely. You condition on the filtered series, not the signal itself. In that case, I have a solution which is pretty fast, but not particularly R-esque. In effect your filter just says, take x but if you see a 1, sit out for the next wait periods. This

Re: [R] coordinates from locator function in POSIXct format

2011-07-29 Thread cristabel.duran
Hi Janis, thank you for you answer. Actually already I did exactly what you said. However, when I convert the number of seconds from the first measurement (some day in July 2010) then a I get a date in the year 2050 which is impossible. The latest date possible is 29March2011. my value in

Re: [R] coordinates from locator function in POSIXct format

2011-07-29 Thread David Winsemius
On Jul 29, 2011, at 12:21 PM, cristabel.duran wrote: Hi Janis, thank you for you answer. Actually already I did exactly what you said. However, when I convert the number of seconds from the first measurement (some day in July 2010) then a I get a date in the year 2050 which is

Re: [R] splitting a string based on the last underscore

2011-07-29 Thread jim holtman
try this: x-c(name_a1_2.5.o,name_a2_2.53.o,name_a3_bla_1.o) strsplit(sub(.*?([^_]+)_([^-]+).o$, \\1 \\2, x), ' ') [[1]] [1] a1 2.5 [[2]] [1] a2 2.53 [[3]] [1] bla 1 On Fri, Jul 29, 2011 at 12:08 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Hello! Hope you could help

Re: [R] finding a faster way to run lm on rows of predictor matrix

2011-07-29 Thread Joshua Wiley
Hi, If you are doing repeated fits in this specialized case, you can benefit by skipping some of the fancy overhead and going straight to lm.fit. ## what you had data.residuals - t(apply(predictors, 1, function(x)( lm(regress.y ~ -1 + as.vector(x))$residuals))) ## passing the matrices directly

  1   2   >