Re: [R] max length of a factor variable

2010-09-28 Thread Richard Mott
Thanks I eventually tracked down the problem to something unrelated to this question (one out of the millions of character strings happened to be NA by chance, which of course was parsed as a missing value, breaking the code a long way downstream.) Richard On 28/09/2010 04:01, Michael

[R] How to convert SEXP to double

2010-09-28 Thread Dmitrij Kudriavcev
Hello All, A simple question. I get some return from the R in my C++ program (via Rcpp package). The result come, as SEXP and it should be a simple numeric variable. How to convert it to double? The code, what i use: stringstream ss; ss p - predict(fit_ar11, n.ahead = 2, doplot=FALSE);

Re: [R] hcluster with linkage median

2010-09-28 Thread Kennedy
Thank you Peter for your help. I had tried hclust before but I made the mistake of using the D matrix above instead of a dist object. Hence library(flashClust) d - as.dist(D) # Clustering using hclust hc - hclust(d, method = median,members=NULL) # Clustering using flashClust fc -

Re: [R] calculating mean and s.d. from a two-column table

2010-09-28 Thread Jim Lemon
On 09/28/2010 02:34 AM, Jonas Josefsson wrote: I have a two-column table as follows where age is in the 1st column and the number of individuals is in the 2nd. age;no 1;21 2;31 3;9 4;12 5;6 Can I use mean() and sd() to calculate the mean and standard deviation from this or do I have to

Re: [R] Regular expressions: offsets of groups

2010-09-28 Thread Michael Bedward
What Titus wants to do is akin to retrieving capturing groups from a Matcher object in Java. I also thought there must be an existing, elegant solution to this some time ago and searched for it, including looking at the sources (albeit with not much expertise) but came up blank. I also looked at

Re: [R] How to convert SEXP to double

2010-09-28 Thread Romain Francois
Le 28/09/10 08:43, Dmitrij Kudriavcev a écrit : Hello All, A simple question. I get some return from the R in my C++ program (via Rcpp package). The result come, as SEXP and it should be a simple numeric variable. How to convert it to double? The code, what i use: stringstream ss; ss p-

Re: [R] One-sided CUSUM / MOSUM Tests?

2010-09-28 Thread Achim Zeileis
On Mon, 27 Sep 2010, bo...@hsu-hh.de wrote: Dear R-help list members, I have the following question concerning the strucchange()-package: is it possible to get the boundaries for one-sided (upper / lower) CUSUM and MOSUM tests? Not out of the box, at least not exactly. You can do this:

[R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Tal Galili
Hello, It seems that there is a problem when plotting an expression in the ylab of a plot in case it is too long. Example: plot(1) title(ylab = test looong ) # work plot(1) title(ylab = expression(paste(test (% of 360

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Barry Rowlingson
On Tue, Sep 28, 2010 at 10:03 AM, Tal Galili tal.gal...@gmail.com wrote: Hello, It seems that there is a problem when plotting an expression in the ylab of a plot in case it is too long. Example: plot(1) title(ylab = test

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Tal Galili
Hi Barry, Sorry for not being clear. Not work == Doesn't add the text to the ylab My initial example was intended with no line breaks. Here it is again with variations: plot(1) title(ylab = expression(paste(test lng (%

[R] 95% confidence intercal with glm

2010-09-28 Thread zozio32
Hi I had to use a glm instead of my basic lm on some data due to unconstant variance. now, when I plot the model over the data, how can I easily get the 95% confidence interval that sormally coming from: yv - predict(modelVar,list(aveLength=xv),int=c)

[R] Combining two variables in text

2010-09-28 Thread trb1
Hi all, how can I manually create a data.frame or similar object to display in a textplot, that omits column and row numbers/headings? Also, how can I combine several variables in text i.e. suppose I have a - one b - two then what expression can I place in title(main=...) in terms of a and b

Re: [R] Combining two variables in text

2010-09-28 Thread trb1
In the date.frame/ text plot, would it be possible to change the font size of one of the lines? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Combining-two-variables-in-text-tp2716916p2716931.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Combining two variables in text

2010-09-28 Thread Dimitris Rizopoulos
try this: a - one b - two paste(a, b, sep = , ) I hope it helps. Best, Dimitris On 9/28/2010 12:12 PM, trb1 wrote: Hi all, how can I manually create a data.frame or similar object to display in a textplot, that omits column and row numbers/headings? Also, how can I combine several

Re: [R] bwplot superpose panel.points from another dataframe

2010-09-28 Thread Christophe Bouffioux
Thanks for your help Peter but the red marks on boxplot do not correspond to ex2 dataframe actually, it reproduce on each panel the same marks that is to say the 3 first lines of ex2 So this is not correct Christophe On Mon, Sep 27, 2010 at 6:18 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On

[R] break function execution

2010-09-28 Thread raje...@cse.iitm.ac.in
Hi, I have an R function that executes for a little over a minute. When the function starts running, the R interface freezes and doesnt change until the function exits cleanly. Is there someway I can force the function to exit without messing up the interface?(An equivalent of Ctrl-C)

Re: [R] subtraction based on two groups in a dataframe

2010-09-28 Thread Dennis Murphy
Hi: Perhaps this might be useful: tst - read.table(textConnection( +plate.id well.id Group HYB rlt1 + 1 P1 A1 Control SKOV3hyb 0.190 + 2 P1 A2 Control SKOV3hyb 0.210 + 3 P1 A3 Control SKOV3hyb 0.205 + 4 P1 A4 Control SKOV3hyb 0.206 +

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Barry Rowlingson
On Tue, Sep 28, 2010 at 10:35 AM, Tal Galili tal.gal...@gmail.com wrote: My point is that in regular text, ylab plots it where it then goes outside the borders. With the use of expressions - the text just doesn't show up. Originally I thought it was because of my miss-use of expressions,

Re: [R] cochran Q test

2010-09-28 Thread Dennis Murphy
Hi: Try here: https://stat.ethz.ch/pipermail/r-help/2006-September/113156.html HTH, Dennis On Mon, Sep 27, 2010 at 7:27 PM, Kohleth Chia kohl...@gmail.com wrote: Dear all, I am trying to look for a built in function that performs the cochran Q test. that is, cochranq.test(X) where X is

[R] Best package for time series analysis with wavelets???

2010-09-28 Thread gaussllego
Hi!! I'm looking for a package in R for time series analysis using wavelets( I'm interested on extractingt information from electrocardiograms with the aim of study the heart rate variability) so i want to know which package is the best for me. I've thinking about using some of those(you can

[R] Use R in Visual Basic Environment

2010-09-28 Thread Soumen Pal
I need your kind help regarding the following: I wish to know is there any way to use R in Visual Basic environment. I want to develop a VB application where R can be embedded (R will work as a back end statistical engine). If available, please provide me some source of study materials/articles

Re: [R] Regular expressions: offsets of groups

2010-09-28 Thread Titus von der Malsburg
On Tue, Sep 28, 2010 at 9:46 AM, Michael Bedward michael.bedw...@gmail.com wrote: What Titus wants to do is akin to retrieving capturing groups from a Matcher object in Java. Precisely. Here's the description:

Re: [R] Combining two variables in text

2010-09-28 Thread Johannes Huesing
trb1 thomasrbol...@yahoo.co.uk [Tue, Sep 28, 2010 at 12:12:01PM CEST]: [...] Also, how can I combine several variables in text i.e. suppose I have a - one b - two then what expression can I place in title(main=...) in terms of a and b to give an output title of one, two i.e. a then b

[R] Using mlogit package to generate a binary mixed logit model

2010-09-28 Thread Michael Morton
Hi, I am trying to generate a binary mixed logit model which contains only individual specific data (no alternative specific data). Each observation is contained within one line (data shape = wide). For example: Individual ID Dependent variableIndependent variable 1

Re: [R] Regular expressions: offsets of groups

2010-09-28 Thread Gabor Grothendieck
On Tue, Sep 28, 2010 at 6:52 AM, Titus von der Malsburg malsb...@gmail.com wrote: On Tue, Sep 28, 2010 at 9:46 AM, Michael Bedward michael.bedw...@gmail.com wrote: What Titus wants to do is akin to retrieving capturing groups from a Matcher object in Java. Precisely.  Here's the description:

Re: [R] bwplot superpose panel.points from another dataframe

2010-09-28 Thread Dennis Murphy
Hi: I did this in ggplot2, which seemed easier than the approach you tried in lattice's bwplot() - as far as I can tell, you want to plot the unique value of v1b as a red dot in each boxplot. To that end, ex - data.frame(v1 = log(abs(rt(180, 3)) + 1), v2 = rep(c(2007, 2006,

Re: [R] Odp: Object Browser

2010-09-28 Thread Douglas Bates
On Mon, Sep 27, 2010 at 3:04 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi I noticed that nobody answered your question yet so here is my try. If you want to see what objects are in your environment you can use ls() but its output is only names of objects. Here is a function I use a long

Re: [R] bwplot superpose panel.points from another dataframe

2010-09-28 Thread Deepayan Sarkar
On Tue, Sep 28, 2010 at 12:59 PM, Christophe Bouffioux christophe@gmail.com wrote: Thanks for your help Peter but the red marks on boxplot do not correspond to ex2 dataframe actually, it reproduce on each panel the same marks that is to say the 3 first lines of ex2 So this is not correct

Re: [R] Compare two 3d plots

2010-09-28 Thread Ab Hu
I'll check that book out and/or get help from the authors. But i was still hoping there is some basic way to compare these 3d plots using R. By the way, I figured out i can draw these plots using command image and get a gradient heat map or topography map with gradients. Is there a function in R

Re: [R] Best package for time series analysis with wavelets???

2010-09-28 Thread Dennis Murphy
Hi: You might find this useful: http://finzi.psych.upenn.edu/R/library/wavelets/html/ecg.html You could also try package wmtsa, the Insightful Wavelet Methods for Time Series Analysis package. But there's more :) The results of this search also appear to dig up some useful packages and

Re: [R] cochran Q test

2010-09-28 Thread Kohleth Chia
Thanks for all the suggestions. It seems that I still have to write my own code after all. But I am really surprised that no one has done it in a proper package yet. KC ^_^ On 28/09/2010, at 9:18 PM, Dennis Murphy wrote: Hi: Try here:

Re: [R] 95% confidence intercal with glm

2010-09-28 Thread Ben Bolker
zozio32 remy.pascal at gmail.com writes: Hi I had to use a glm instead of my basic lm on some data due to unconstant variance. now, when I plot the model over the data, how can I easily get the 95% confidence interval that sormally coming from: yv -

Re: [R] stacked area chart

2010-09-28 Thread Ista Zahn
Hi Dimitri, I'm not proficient with base graphics, but here is a ggplot solution: my.data.m - melt(my.data, id=date) my.data.m$pn - + my.data.m[my.data.m$variable %in% c(y, z), pn] - - my.data.m$variable - factor(my.data.m$variable, levels=c(a, x, y, z)) my.data.m$Date -

Re: [R] time series

2010-09-28 Thread Giovanni Petris
Unless you tell us what model or what forecasting technique you want to use, it seems to me that this is more a question about Statistics than about using R. Best, Giovanni Petris On Mon, 2010-09-27 at 23:02 +0100, Dr. Alireza Zolfaghari wrote: Hi list, I have a set of data which I want to

[R] Standard error of forecast

2010-09-28 Thread Brima
Hi all, This is very basic but for a starter nothing is. I have a simple linear regression I am using to predict some values and I need the standard error of the prediction (forecast). Whats the easiest/bestway of getting this error? Best regards -- View this message in context:

Re: [R] bwplot superpose panel.points from another dataframe

2010-09-28 Thread Christophe Bouffioux
BINGO we have the solution thanks a lot both, Deepayan and Dennis, for your help Christophe On Tue, Sep 28, 2010 at 2:10 PM, Deepayan Sarkar deepayan.sar...@gmail.comwrote: On Tue, Sep 28, 2010 at 12:59 PM, Christophe Bouffioux christophe@gmail.com wrote: Thanks for your help Peter

[R] Table with different digit number

2010-09-28 Thread Nicola Sturaro Sommacal (Quantide srl)
Hi! I have a table representing both absolute and relative frequency, for example (code to get example data under the signature): ItalyGermany absolute100 105 relative 40.51 41.18 How can I print a different number of decimal digits? I try to

Re: [R] plotting multiple animal tracks against Date/Time

2010-09-28 Thread Struve, Juliane
Hi, in this self-contained example the file the same error message appears as when I read in my original results files. library (zoo) library(chron) #generate example data Fish_ID=1646 Date - 01/01/2004 00:01:00 Date - as.POSIXct(strptime(Date,format=%m/%d/%Y %H:%M:%S)) R2sqrt -100 #put

Re: [R] Table with different digit number

2010-09-28 Thread Gabriela Cendoya
Try round(df,2) for two decimal digits Gabriela 2010/9/28, Nicola Sturaro Sommacal (Quantide srl) mailingl...@sturaro.net: Hi! I have a table representing both absolute and relative frequency, for example (code to get example data under the signature): ItalyGermany

Re: [R] Table with different digit number

2010-09-28 Thread Henrique Dallazuanna
Try this: df[1,] - as.character(df[1,]) On Tue, Sep 28, 2010 at 8:48 AM, Nicola Sturaro Sommacal (Quantide srl) mailingl...@sturaro.net wrote: Hi! I have a table representing both absolute and relative frequency, for example (code to get example data under the signature):

Re: [R] Standard error of forecast

2010-09-28 Thread Ista Zahn
Hi, predict(model_fit, se.fit=TRUE) see ?predict.lm for details. -Ista On Tue, Sep 28, 2010 at 12:16 PM, Brima adamsteve2...@yahoo.com wrote: Hi all, This is very basic but for a starter nothing is. I have a simple linear regression I am using to predict some values and I need the

[R] the arima()-function and AICc

2010-09-28 Thread Benedikt Gehr
Hi I'm trying to fit arima models with the arima() function and I have two questions. ## ##1. ## ## I have n observations for my time series. Now, no matter what arima(p,d,q)- model I fit, I always get n residuals. How is that possible? For example: If I try this out myself on an

[R] Offre illimitée Iphone 4 : Accesoires Off erts

2010-09-28 Thread ACTA SOLUTIONS COMMERCIALES
Si ce message ne s'affiche pas correctement, [1]visualisez la version en ligne [2]Remplissez ce formulaire pour ne plus recevoir notre newsletter. A réception, celui-ci sera pris en compte. References Visible links 1.

Re: [R] Regular expressions: offsets of groups

2010-09-28 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Michael Bedward Sent: Tuesday, September 28, 2010 12:46 AM To: Titus von der Malsburg Cc: r-help@r-project.org Subject: Re: [R] Regular expressions: offsets of groups What

[R] Splitting data in to multiple boxplots

2010-09-28 Thread deadlyspider
Hi, I have a data set in the following format: id cat value 1 a12 2 a23 3 a14 4 b2 5 b3 6 c9 7 c8 8 c10 9 d30 I would like to set up boxplots for each category. The actual category names are long and many so I would like this to be

Re: [R] Splitting data in to multiple boxplots

2010-09-28 Thread Joshua Wiley
Hi, There is a very handy feature of boxplot() that will handle this easily. You can write formulae of the form: scores ~ groups For your sample data: # read in data dat - read.table(textConnection( id cat value 1 a12 2 a23 3 a14 4 b2 5 b3 6 c9 7 c8 8

[R] Opening a .R file with R (Windows)

2010-09-28 Thread Kye Gilder
I am new to using R. I installed R on my computer (Windows) and everything things appears to be just fine. However, I have a simple script RTest.R that does a few simple calculations. When I double-click the RTest.R icon, I get an Information dialong box which says, ARGUMENT 'C:\Documents and

Re: [R] Opening a .R file with R (Windows)

2010-09-28 Thread Joshua Wiley
Hi Kye, I have never gotten .R files to work quite like other types (e.g., double-clicking a .PDF) in Windows. AFAIK there is no simple way to do it, because you do not edit scripts directly in R (I am happy to be corrected if someone knows better). For general use, I would just open R first

Re: [R] Opening a .R file with R (Windows)

2010-09-28 Thread Bert Gunter
Well, try following the correct conventions ... 1. Double click on an .Rdata file, which is produced by saving from R, and it will open. 2. Drag and drop a .R or any text file into an open R window and it will source the contents. This is probably documented somewhere .. maybe in the RW FAQ.

Re: [R] Best package for time series analysis with wavelets???

2010-09-28 Thread gaussllego
Hi djmuseR! Hi everybody! Thanks for your answer djmuseR (I've just discovered the sos library and it's really useful,xD)... I would also like to know if there's a trully reliable,recommended wavelet's library in R(In the sense that if,for example, there's some library that's often used in

Re: [R] efficient equivalent to read.csv / write.csv

2010-09-28 Thread statquant2
Hi, after testing R) system.time(read.csv(myfile.csv)) user system elapsed 1.126 0.038 1.177 R) system.time(read.csv.sql(myfile.csv)) user system elapsed 1.405 0.025 1.439 Warning messages: 1: closing unused connection 4 () 2: closing unused connection 3 () It seems that

[R] constrained optimization -which package?

2010-09-28 Thread Leonardo Monasterio
Dear R users, I want to find the maximum value of v, subject to the constrain that the sum of x is equal to 1. So, I want to maximize: v-t(x)%*%distance%*%x Subject to: sum(x)=1 Where: x is a vector n X 1 distance is a matrix n*n and it is given. (In practive, the number of n can go up to

Re: [R] Best package for time series analysis with wavelets???

2010-09-28 Thread Ben Bolker
gaussllego gluonesconleche at gmail.com writes: I would also like to know if there's a trully reliable,recommended wavelet's library in R(In the sense that if,for example, there's some library that's often used in scientific projects or mentioned in articles). I don't know, but I would

Re: [R] constrained optimization -which package?

2010-09-28 Thread Peng, C
?constrOptim -- View this message in context: http://r.789695.n4.nabble.com/constrained-optimization-which-package-tp2717677p2717719.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] efficient equivalent to read.csv / write.csv

2010-09-28 Thread Henrik Bengtsson
To speed things up, you certainly want to give R more clues about your data files by being more explicit by many of the arguments (cf. help(read.table), especially specifying argument 'colClasses' makes a big difference. /Henrik On Tue, Sep 28, 2010 at 10:24 AM, statquant2 statqu...@gmail.com

Re: [R] Howto view function's source code of an installed package

2010-09-28 Thread Mark Miller
I justed wanted to provide a description of how I was able to view source code of a function. First download the Program R package containing the function. Specifically, download the file that ends in tar.gz. This is a compressed file. Expand the compressed file using, for example, WinZip.

Re: [R] break function execution

2010-09-28 Thread Greg Snow
Ctrl-C works on some platforms, it would help us to help you if we knew which OS you are using, which version of R you are using, and in some cases whether you are using the GUI or Terminal version of R. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [R] Combining two variables in text

2010-09-28 Thread Greg Snow
Also ?sprintf for another approach. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Johannes Huesing Sent:

Re: [R] Howto view function's source code of an installed package

2010-09-28 Thread Sicotte, Hugues
The instructions below are for examining files from a source code file. For package binaries, the R code may be in a binary file (.rdb).. Then the following will help. The first thing to try is to Download and install the package and type library(packagename) Type the function name (without the

Re: [R] break function execution

2010-09-28 Thread Peter Langfelder
On Tue, Sep 28, 2010 at 12:18 PM, Greg Snow greg.s...@imail.org wrote: Ctrl-C works on some platforms, it would help us to help you if we knew which OS you are using, which version of R you are using, and in some cases whether you are using the GUI or Terminal version of R. Hi, I have an

[R] ask for a question with cch function

2010-09-28 Thread Qian Xiyuan
Dear all, I am reading the cch function source code. But I can not understand the following codes. Please help me. What's the fitter here? fitter - get(method) out - fitter(tenter = tenter, texit = texit, cc = cc, id = id, X = X, ntot = nn, robust = robust) [[alternative HTML version

[R] confirming behavior of by

2010-09-28 Thread Daryl Morris
Hi, I'm using by to summarize by multiple groups, and want to extract the returned into a pretty dataframe. I'm trying to find a simple way to name the rows of the data frame. I'd like it to be something like index1.val1.index2.val2 where the index1 and index2 are the names of the indices

Re: [R] efficient equivalent to read.csv / write.csv

2010-09-28 Thread David Scott
On 29/09/2010 6:24 a.m., statquant2 wrote: Hi, after testing R) system.time(read.csv(myfile.csv)) user system elapsed 1.126 0.038 1.177 R) system.time(read.csv.sql(myfile.csv)) user system elapsed 1.405 0.025 1.439 Warning messages: 1: closing unused connection 4 () 2:

Re: [R] Howto view function's source code of an installed package

2010-09-28 Thread Prof Brian Ripley
On Tue, 28 Sep 2010, Mark Miller wrote: I justed wanted to provide a description of how I was able to view source code of a function. First download the Program R package containing the function. Specifically, download the file that ends in tar.gz. This is a compressed file. Expand the

[R] constrained optimization -which package?

2010-09-28 Thread Leonardo Monasterio
Dear R users, In the function bellow I want to find the maximum value of v, subject to the constrain that the sum of x is equal to 1. I want to maximize: v-t(x)%*%distance%*%x Subject to: sum(x)=1 Where: x is a vector n X 1 distance is a matrix n*n and it is given. (In practice, the number of

Re: [R] Problem with unlist

2010-09-28 Thread Susan Gruber
I suspect the problem is that table() is not displaying the correct length. Try table(n, useNA=ifany) --Susan Message: 75 Date: Mon, 27 Sep 2010 11:41:24 -0700 From: Henrik Bengtsson h...@stat.berkeley.edu To: Ben Bolker bbol...@gmail.com Cc: r-help r-h...@stat.math.ethz.ch Subject: Re: [R]

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Ben Bolker
Barry Rowlingson b.rowlingson at lancaster.ac.uk writes: My point is that in regular text, ylab plots it where it then goes outside the borders. With the use of expressions - the text just doesn't show up. Originally I thought it was because of my miss-use of expressions, until I

[R] Time invariant coefficients in a time varying coefficients model using dlm package

2010-09-28 Thread Christian Schoder
Dear R-users, I am trying to estimate a state space model of the form (1) b_t = G * b_t-1 + w_tw_t ~ N(0,W) (2) y_t= A' * x_t + H' * b_t + v_t v_t ~ N(0,V) (Hamilton 1984: 372) In particular my estimation in state space form looks like (3) a3_t = 1 * a3_t-1 + w_t w_t

[R] drawing samples based on a matching variable

2010-09-28 Thread L Brown
Hi, everyone. I have what I hope will be a simple coding question. It seems this is a common job, but so far I've had trouble finding the answer in searches. I have two matrices (x and y) with a different number of observations in each. I need to draw a random sample without replacement of

Re: [R] ask for a question with cch function

2010-09-28 Thread Bill.Venables
It would help if you were to tell up which package you are talking about. I take it this is the survival package and this is the proportioanl hazards fitting function for case-cohort data. You would have seen earlier in the code that method - match.arg(method) so at that stage 'method'

Re: [R] constrained optimization -which package?

2010-09-28 Thread Ravi Varadhan
No. That would not work for equality constraints. This is quadratic programming problem. Check out `quadprog' or any other quad programming packages in R. If you have more general, nonlinearly constrained optimization you can use any one of the 3 following packages: 1. `spg' function in BB

[R] fixing the dispersion parameter in glm

2010-09-28 Thread Huso, Manuela
I would like to fit a glm with Poisson distribution and log link with a known dispersion parameter. I do not want to estimate the dispersion parameter. I know what it is, so I simply want to fix it at a constant for this and other models to follow. My simple, no covariate model is:

Re: [R] plotting multiple animal tracks against Date/Time

2010-09-28 Thread Gabor Grothendieck
On Tue, Sep 28, 2010 at 9:30 AM, Struve, Juliane j.str...@imperial.ac.uk wrote: Hi, in this self-contained example the file the same error message appears as when I read in my original results files. library (zoo) library(chron) #generate example data Fish_ID=1646  Date - 01/01/2004

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Paul Murrell
Hi It is a bug. A fix has been committed. Thanks for the report! Paul On 29/09/2010 10:15 a.m., Ben Bolker wrote: Barry Rowlingsonb.rowlingsonat lancaster.ac.uk writes: My point is that in regular text, ylab plots it where it then goes outside the borders. With the use of expressions -

Re: [R] fixing the dispersion parameter in glm

2010-09-28 Thread Remko Duursma
How about: y[y[,2] %in% x.samp[,2],] gives you the subset of y where values in the second column are restricted to your sample from x. You can then sample from this matrix, if you need to... greetings, Remko -- View this message in context:

Re: [R] constrained optimization -which package?

2010-09-28 Thread Peng, C
constrOptim() can do linear and quadratic programming problems! See the following example from the help document. ## Solves linear and quadratic programming problems ## but needs a feasible starting value # # from example(solve.QP) in 'quadprog' # no derivative

[R] Problems creating an xts object

2010-09-28 Thread Luis Felipe Parra
Hello I am trying to create an xts object from a data frame that has numeric and string variables. when I create the object all my variables are converted to string, this is my original data frame: head(DatosF) FECHA CIERRE HORA DE CIERRE SESION/RUEDA PLAZO (De regreso para SIML, Repos e INTB)

Re: [R] efficient equivalent to read.csv / write.csv

2010-09-28 Thread Gabor Grothendieck
On Tue, Sep 28, 2010 at 1:24 PM, statquant2 statqu...@gmail.com wrote: Hi, after testing R) system.time(read.csv(myfile.csv))   user  system elapsed  1.126   0.038   1.177 R) system.time(read.csv.sql(myfile.csv))   user  system elapsed  1.405   0.025   1.439 Warning messages: 1: closing

[R] move colorkey

2010-09-28 Thread Marlin Keith Cox
When using a wireframe, I need to move the colorkey from the right position (default0 towards the plot. I have also needed to adjust the height and used the code colorkey=list(T,space='right',height=.5) I have looked at documents (within levelplot) but cannot find a way to move the colorkey

Re: [R] Regular expressions: offsets of groups

2010-09-28 Thread Michael Bedward
Ah, that's interesting - thanks Bill. That's certainly on the right track for me (Titus, you too ?) especially if the subpattern argument accepted a vector of multiple group indices. As you say, this is straightforward in C. I'd be happy to (try to) make a patch for the R sources if there was

[R] quantile() and factors not allowed

2010-09-28 Thread Steve
A list (t) that I'm trying to pass to quantile() is causing this error: Error in quantile.default(t, probs = c(0.9, 9.95, 0.99)) factors are not allowed I've successfully use lists before, and am having difficulty finding my mistake. Any suggestions appreciated! -Steve

Re: [R] stacked area chart

2010-09-28 Thread Dimitri Liakhovitski
Thanks a lot, Ista! On Tue, Sep 28, 2010 at 10:00 AM, Ista Zahn iz...@psych.rochester.edu wrote: Hi Dimitri, I'm not proficient with base graphics, but here is a ggplot solution: my.data.m - melt(my.data, id=date) my.data.m$pn - + my.data.m[my.data.m$variable %in% c(y, z), pn] - -

Re: [R] quantile() and factors not allowed

2010-09-28 Thread Joshua Wiley
Hi Steve, The basic problem (as the error suggests) is that data of class factor is not allowed in quantile.default. So one of the elements of your list must be a factor. What are the results of: str(t) ? As a side note, since t() is a function, using t as a variable name can be a bit

[R] need help with ramdomly sampling some data

2010-09-28 Thread Michael Larkin
I am trying to get R to randomly select values from my dataset (i.e. bootstrapping) with replacement. However, my attempts at this have been unsuccessful. Here is a basic example of what I am doing: I have a data vector of 8 values (i.e. data= 2,5,9,4,5,6,7,8). I used the sample function and

Re: [R] need help with ramdomly sampling some data

2010-09-28 Thread Peter Langfelder
On Tue, Sep 28, 2010 at 6:22 PM, Michael Larkin mlar...@rsmas.miami.edu wrote: I am trying to get R to randomly select values from my dataset (i.e. bootstrapping) with replacement.  However, my attempts at this have been unsuccessful.  Here is a basic example of what I am doing: I have a data

Re: [R] need help with ramdomly sampling some data

2010-09-28 Thread Jonathan Christensen
Mike, It works for me: data - 1:8 sample(data,replace=TRUE) [1] 6 4 5 2 5 8 7 2 Please provide a reproducible example, if possible, and the output of sessionInfo(). Jonathan On Tue, Sep 28, 2010 at 7:22 PM, Michael Larkin mlar...@rsmas.miami.eduwrote: I am trying to get R to randomly

[R] R Extensions getDLLVersion

2010-09-28 Thread Kyle Covington
Hi, I'm just learning to write R extensions in C and to embed R in C. I was trying to get through the example in the help page on calling the .dll directly ( http://cran.r-project.org/doc/manuals/R-exts.html#Calling-R_002edll-directly ). When I compile I consistently get the error that

Re: [R] drawing samples based on a matching variable

2010-09-28 Thread Michael Bedward
Hello LB, It's one of those problems that's basic but tricky :) I don't have an elegant one-liner for it but here's a function that would do it... function(xs, y) { # sample matrix y such that col 2 of the sample matches # col 2 of matrix xs used - logical(nrow(y)) yi - integer(nrow(xs))

Re: [R] drawing samples based on a matching variable

2010-09-28 Thread Michael Bedward
On 29 September 2010 09:47, Remko Duursma wrote: How about: y[y[,2] %in% x.samp[,2],] gives you the subset of y where values in the second column are restricted to your sample from x. You can then sample from this matrix, if you need to... Just saw this reply tangled up in another topic

Re: [R] need help with ramdomly sampling some data

2010-09-28 Thread Michael Larkin
I got it to work. I didn't have the data listed as a vector (c in front of the data). I copied Peter's code and it worked perfectly. Thanks! Mike From: Jonathan Christensen [mailto:dzhona...@gmail.com] Sent: Tuesday, September 28, 2010 9:31 PM To: Michael Larkin Cc:

Re: [R] quantile() and factors not allowed

2010-09-28 Thread Steve
The underlying data contained values that resulted in Factor instead of number fields during the read.csv. Problem fixed! I also introduced a typo while copying the error into my message, and as for the poor variable naming, I'll be more careful. Thanks x3! Corrected structure: str(CPU)

[R] next step in randomly sampling

2010-09-28 Thread Michael Larkin
Thanks to the people on this list I was able to fix my code for randomly sampling. Thanks. Now, I am moving on to the next step and I ran into another snag. I have a large dataset but I am starting with a small made-up dataset until I figure it out. I have two columns of data (age and

[R] get response from a glm

2010-09-28 Thread xinxin xx
Hi everyone: ¡¡I am new to R and I have a really basic question. I have already got a generalized linear model from some dataset, say y=b0 + b1X1 + b2X2. Then I want to get the value of y provided, say, X1=1, X2=2. And the confidence Intervals of this y. I know I can just

Re: [R] next step in randomly sampling

2010-09-28 Thread Jonathan Christensen
Mike, Try growth[sample(1:length(growth)),] to permute the rows. Jonathan On Tue, Sep 28, 2010 at 8:38 PM, Michael Larkin mlar...@rsmas.miami.eduwrote: Thanks to the people on this list I was able to fix my code for randomly sampling. Thanks. Now, I am moving on to the next step and

Re: [R] constrained optimization -which package?

2010-09-28 Thread Ravi Varadhan
Please read the help page carefully, the very first line that describes the function says, Minimise a function subject to linear inequality constraints. OP has a problem with equality constraints: sum(x) = 1. Furthermore, if you want to solve a QP problem then it is better to use a dedicated

Re: [R] Object Browser

2010-09-28 Thread Vitally S.
wxffxw wxf...@gmail.com writes: So, is there any thing like the combination of eclipse and Jgr? If not, I am interested to develope something to fulfill this simple but very important function. But right now I have no idea where to start. Any suggestions? If you are interested in developing

[R] ramdom sampling from a dataset

2010-09-28 Thread Michael Larkin
I am trying to get R to pick random integers from my dataset (i.e. bootstrapping) with replacement. However, my attempts at this have been unsuccessful. Here is a basic example of what I am doing: I have a data vector of 8 integers (data= 2,5,9,4,5,6,7,8). I used the sample function and it

Re: [R] efficient equivalent to read.csv / write.csv

2010-09-28 Thread statquant2
Hello all, the test I provided was just to pinpoint that for loading once a big csv file with read.csv was quicker than read.csv.sql... I have already optimized my calls to read.csv for my particular problem, but is a simple call to read.csv was quicker than read.csv.sql I doubt that specifying

[R] Transforming/appending data (words in IMDB)

2010-09-28 Thread aeneas24
Hi everyone, I am doing an analysis of reviews in IMDB and am running into trouble getting my data into the right shape for analysis. Key question: I want to know for each word in the IMDB, whether it is over- or under-represented in a particular category (Rating x Genre). I was figuring

[R] short captions for xtable?

2010-09-28 Thread cuz
Hi, For my dissertation, I have used xtable profusely. I'm also a fan of extended captions in the text. However, these captions are unwieldy in the List of Tables, so I'd like to use the short caption option available with regular \caption usage. Is this possible? Thanks, Cuz -- View this

  1   2   >