Re: [R] Display warning when embedded data file is loaded

2012-01-09 Thread Hintzen, Niels
Dear all, I didn't manage to get any new insights on this, anyone from the list suggestions? Best regards, Niels Hintzen -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Hintzen, Niels Sent: maandag, januari 02, 2012 10:42 To:

Re: [R] Simulate AR(1) starting from X number?

2012-01-09 Thread Rolf Turner
On 09/01/12 16:32, jfca283 wrote: Yes, it's work for my class. Well, this list is ***NOT*** for giving help with homework. However --- to get you started, read the help for arima.sim() a bit more carefully, and look at what it says about the argument n.start. You are miss-using this

Re: [R] Where to download the splines package.

2012-01-09 Thread David Croll
Hello, you will find this helpful: http://r.789695.n4.nabble.com/Where-is-the-splines-package-td2122794.html splines is now a part of the normal R installation, David Winsemius says there. Regards, David Hi, install.packages(splines) Warning in install.packages : package

Re: [R] Where to download the splines package.

2012-01-09 Thread Duncan Murdoch
On 12-01-08 9:56 PM, Xiaobo Gu wrote: Hi, install.packages(splines) Warning in install.packages : package ‘splines’ is not available (for R version 2.14.1) splines is a base package, i.e. it is part of R, so you already have it in the latest version. It won't be updated other than when

[R] modeling a haemodynamic response function in R

2012-01-09 Thread Martin Batholdy
Hi, I have time-series data and I would like to fit a 2-gamma HRF to the data (http://en.wikibooks.org/wiki/SPM/Haemodynamic_Response_Function) in order to get the explained variance and the maximum of the fitted data. Is there a straightforward function for that or a package that provides

[R] Unexpected results using the oneway_test in the coin package

2012-01-09 Thread Christoph Liedtke
Dear fellow R users, Keywords: Kruskal-Wallis, Post-Hoc, pair-wise comparisons, Nemenyi-Damico-Wolfe-Dunn test, coin package, oneway_test I am using the oneway_test function in the R package coin and I am obtaining results which I cannot believe are accurate. I do not wish to waste anyone's

[R] What is the function for smoothing splines with the smoothing parameter selected by generalized maximum likelihood?

2012-01-09 Thread ali_protocol
Dear all, I am new to R, and I am a biotechnologist, I want to fit a smoothing spline with smoothing parameter selected by generalized maximum likelihood. I was wondering what function implement this, and, if possible how I can find the fitted results for a certain point (or predict from the

[R] Autocorrelation values? How to extract?

2012-01-09 Thread Anna Zakrisson
Hi, I am attempting to correct my models p-values due to temporal autocorrelations. It is not possible to model the correlation, so I have to make do with the p-value correction. I am feeling a bit thick hereI cannot get the autocorrelation values. What is the argument? My aim is to

Re: [R] how to combine grouped data and ungrouped data in a trellis xyplot

2012-01-09 Thread Deepayan Sarkar
On Sun, Jan 8, 2012 at 9:45 AM, Mike Dahman mike.dah...@gmail.com wrote: I'm hoping the community knowledge can help me out here. I have found great value in R, especially using it to generate charts, but I am still scaling the learning curve in a number of ways. I am looking plot one grouped

[R] Open Street map problem

2012-01-09 Thread Alaios
Dear all, I would like to use R to create a map , with some points with no copyright. I am trying to use the open street map interface of Rgooglemaps package. It seems that I am getting internal server error source('make2DaysMaps.R') [1]

Re: [R] Where to download the splines package.

2012-01-09 Thread Xiaobo Gu
Thanks, reinstalling R 2.14.1 fixes this problem. On Mon, Jan 9, 2012 at 8:31 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 12-01-08 9:56 PM, Xiaobo Gu wrote: Hi, install.packages(splines) Warning in install.packages :   package ‘splines’ is not available (for R version 2.14.1)

[R] Joint confidence interval for fractional polynomial terms

2012-01-09 Thread Eleni Rapsomaniki
Dear R users, The package 'mfp' that fits fractional polynomial terms to predictors. Example: data(GBSG) f - mfp(Surv(rfst, cens) ~ fp(age, df = 4, select = 0.05) + fp(prm, df = 4, select = 0.05), family = cox, data = GBSG) print(f) To describe the association between the

Re: [R] What is the function for smoothing splines with the smoothing parameter selected by generalized maximum likelihood?

2012-01-09 Thread Liaw, Andy
See the gss package on CRAN. Andy -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ali_protocol Sent: Monday, January 09, 2012 7:13 AM To: r-help@r-project.org Subject: [R] What is the function for smoothing splines with

Re: [R] Open Street map problem

2012-01-09 Thread peter dalgaard
On Jan 9, 2012, at 14:22 , Alaios wrote: Dear all, I would like to use R to create a map , with some points with no copyright. I am trying to use the open street map interface of Rgooglemaps package. It seems that I am getting internal server error source('make2DaysMaps.R') [1]

Re: [R] Joint confidence interval for fractional polynomial terms

2012-01-09 Thread Frank Harrell
This does not exactly answer your question but if you were to use restricted cubic splines instead of FPs, an upcoming new release of the rms package allows one to easily obtain simultaneous confidence bands for any series of predictions. So for your case you would hold all covariates constant

Re: [R] Summing rows by years (each time separately)

2012-01-09 Thread Andrew Gaska
Thanks for your answer! There is one thing I could not find in aggregate(): I want to have it a sum for each group of 2008,2009 and 2010. In aggregate() I can sum all the rows that have a rowname 2008, all the rows that have a rowname 2009 and all the rows that have a rowname 2010. But I want

[R] as.numeric() generates NAs inside an apply call, but fine outside of it

2012-01-09 Thread Chris Beeley
Hello- I have rather a messy SPSS file which I have imported to R, I've dput'd some of the columns at the end of this message. I wish to get rid of all the labels and have numeric values using as.numeric. The funny thing is it works like this: as.numeric(mydata[,2]) # generates correct

Re: [R] as.numeric() generates NAs inside an apply call, but fine outside of it

2012-01-09 Thread peter dalgaard
On Jan 9, 2012, at 15:11 , Chris Beeley wrote: Hello- I have rather a messy SPSS file which I have imported to R, I've dput'd some of the columns at the end of this message. I wish to get rid of all the labels and have numeric values using as.numeric. The funny thing is it works like

Re: [R] Summing rows by years (each time separately)

2012-01-09 Thread David Winsemius
On Jan 9, 2012, at 9:06 AM, Andrew Gaska wrote: Thanks for your answer! There is one thing I could not find in aggregate(): I want to have it a sum for each group of 2008,2009 and 2010. In aggregate() I can sum all the rows that have a rowname 2008, all the rows that have a rowname 2009

Re: [R] as.numeric() generates NAs inside an apply call, but fine outside of it

2012-01-09 Thread Chris Beeley
Perfect, many thanks for explanation and correct line of code. On 09/01/2012 14:29, peter dalgaard wrote: as.data.frame(lapply(mydata, as.numeric)) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] modeling a haemodynamic response function in R

2012-01-09 Thread David Winsemius
On Jan 9, 2012, at 7:55 AM, Martin Batholdy wrote: Hi, I have time-series data and I would like to fit a 2-gamma HRF to the data (http://en.wikibooks.org/wiki/SPM/Haemodynamic_Response_Function) in order to get the explained variance and the maximum of the fitted data. Is there a

Re: [R] Autocorrelation values? How to extract?

2012-01-09 Thread dnz.marcio
Hi Anna, I think you use acf() function to calculate the variable autocorrelation. I'd do: ac - acf(y, lag.max = 100)$acf Here, you use $acf, then you can extract the values only. Best regards, Márcio Diniz PhD Student IME - Mathematical and Statistics Institute USP - University - São Paulo

[R] How can I stack two matrices?

2012-01-09 Thread dnz.marcio
Hi, I'd like to stack two matrices. How can I do it without be column by column? Best regards, Márcio Diniz PhD Student IME - Mathematical and Statistics Institutee USP - University of São Paulo -- View this message in context:

Re: [R] Joint confidence interval for fractional polynomial terms

2012-01-09 Thread Eleni Rapsomaniki
Dear Professor Harrell, Once again thank you for your helpful reply. I could use rcs instead, so I look forward to your latest rms release (soon I hope?) Initially I favoured fractional polynomials thinking that the model would be easier to present, but now I see that with either method unless

Re: [R] as.numeric() generates NAs inside an apply call, but fine outside of it

2012-01-09 Thread Petr PIKAL
Hi Hello- I have rather a messy SPSS file which I have imported to R, I've dput'd some of the columns at the end of this message. I wish to get rid of all the labels and have numeric values using as.numeric. The funny thing is it works like this: as.numeric(mydata[,2]) # generates

Re: [R] How can I stack two matrices?

2012-01-09 Thread Jorge I Velez
Hi Marcio, Take a look at ?cbind and ?rbind. HTH, Jorge On Mon, Jan 9, 2012 at 9:28 AM, dnz.marcio wrote: Hi, I'd like to stack two matrices. How can I do it without be column by column? Best regards, Márcio Diniz PhD Student IME - Mathematical and Statistics Institutee USP -

[R] runif with condition

2012-01-09 Thread arunkumar1111
Hi I want to generate 4 random number which sum up to 100 always Please help - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/runif-with-condition-tp4278704p4278704.html Sent from the R help mailing list archive at Nabble.com.

[R] glmD error

2012-01-09 Thread Bond, Stephen
I am attemting to use glmD in order to use latex(obj) afterwards. Glm works fine, glmD throws an error: conv.go - glmD(cbind(go.cnt,tot.cnt-go.cnt)~sn+rcs(relAge,4)+termfac+rate:termfac+ + I(relAge*term(term-1.25))+I((prevbal/tot.cnt)*1e-4)+prod+newmort+ +

Re: [R] runif with condition

2012-01-09 Thread Sarah Goslee
On Mon, Jan 9, 2012 at 10:06 AM, arunkumar akpbond...@gmail.com wrote: Hi I want to generate 4 random number which sum up to 100 always Please help This sounds like homework. But you might want to search rseek.org for information on random numbers, and to ponder the mysteries of addition

Re: [R] runif with condition

2012-01-09 Thread David Winsemius
On Jan 9, 2012, at 10:06 AM, arunkumar wrote: Hi I want to generate 4 random number which sum up to 100 always Random plus condition == non-random Perhaps you want 3 random numbers conjoined to the difference of their sum and 100? Or perhaps you want 4 random numbers multiplied by

Re: [R] runif with condition

2012-01-09 Thread Duncan Murdoch
On 09/01/2012 10:27 AM, David Winsemius wrote: On Jan 9, 2012, at 10:06 AM, arunkumar wrote: Hi I want to generate 4 random number which sum up to 100 always Random plus condition == non-random Perhaps you want 3 random numbers conjoined to the difference of their sum and 100? Or

[R] RGL- Drawing Circle

2012-01-09 Thread gli
hi, i want to draw a simple circle by using 3d package RGL. i think i can use the command rgl.lines by studying the code from: http://www.swiftless.com/tutorials/opengl/circle.html but is there a faster and easier way to do it?? graham -- View this message in context:

Re: [R] RGL- Drawing Circle

2012-01-09 Thread Duncan Murdoch
On 09/01/2012 10:12 AM, gli wrote: hi, i want to draw a simple circle by using 3d package RGL. i think i can use the command rgl.lines by studying the code from: http://www.swiftless.com/tutorials/opengl/circle.html but is there a faster and easier way to do it?? The code on that page is

Re: [R] runif with condition

2012-01-09 Thread jim holtman
try this: x - matrix(runif(100), ncol = 4) # now scale each row to add up to 100 x.new - t(apply(x, 1, function(.row) .row * 100 / sum(.row))) x.new [,1] [,2] [,3] [,4] [1,] 25.868978 31.4867075 34.547444 8.0968705 [2,] 35.803781 28.3485728 27.177462

Re: [R] runif with condition

2012-01-09 Thread Jorge I Velez
Try foo - function(n){ x - runif(n) x * 100 / sum(x) } foo(4) HTH, Jorge.- On Mon, Jan 9, 2012 at 10:06 AM, arunkumar wrote: Hi I want to generate 4 random number which sum up to 100 always Please help - Thanks in Advance Arun -- View this message in context:

Re: [R] How can I stack two matrices?

2012-01-09 Thread dnz.marcio
Thanks, Jorge! -- View this message in context: http://r.789695.n4.nabble.com/How-can-I-stack-two-matrices-tp4278614p4278855.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Summing rows by years (each time separately)

2012-01-09 Thread William Dunlap
You didn't show us what you did to get the results you didn't want. I suspect you did not compute groupId - cumsum(c(TRUE, year[-1] != year[-length(year)])) and aggregate by groupId instead of by year. (Note that groupId counts how many changes there are in the sequence of years.) By the

Re: [R] need help with axis ticks

2012-01-09 Thread Uwe Ligges
See ?par and its argument mgp, e.g.: par(mgp=c(3, 0.5, 0)) Uwe Ligges On 08.01.2012 20:13, vibhava wrote: hi, i am using par(mrow=c(6,6)) function to get 6x6 plots on one screen. the problem that i am having is that the axis tick labels are far away from the ticks and going into

[R] plot, xlim to cut data set

2012-01-09 Thread Alaios
Dear all, I would like to tell plot to limit the plotted area into values (for the x axis) that are from X1 to X2. I have tried to use xlim=c(X1,X2) inside plot.. but unfortunately this does only change the labeling of the xaxis and not the values plotted there. How I can do that in R? B.R

Re: [R] runif with condition

2012-01-09 Thread David Winsemius
On Jan 9, 2012, at 10:27 AM, David Winsemius wrote: On Jan 9, 2012, at 10:06 AM, arunkumar wrote: Hi I want to generate 4 random number which sum up to 100 always Random plus condition == non-random An offlist correspondent has disputed this and I can admit that I was perhaps too

Re: [R] k-means++

2012-01-09 Thread Hans W Borchers
Ferebee Tunno ferebee.tunno at mathstat.astate.edu writes: Hi everyone - I know that R is capable of clustering using the k-means algorithm, but can R do k-means++ clustering as well? k-means++ is a routine to suggest center points before the classical k-means is called. The following

[R] par.plot() for repeated measurements

2012-01-09 Thread JerryLee
Hello, I am using the package gamlss in R to plot repeated measurements. The command I am using is par.plot(). It works great except one thing about the label of the axises. I tried to label both x and y axises using ylab and xlab options. But the plot only gives variable variables. The labels

Re: [R] Display warning when embedded data file is loaded

2012-01-09 Thread Martin Morgan
On 01/09/2012 12:38 AM, Hintzen, Niels wrote: Dear all, I didn't manage to get any new insights on this, anyone from the list suggestions? Hi Niels -- Files in the data directory of a package can be an R script, so in PkgA/data/f.R f - local({ message(curves ahead) 1:5 })

[R] Different lm() Residuals Output

2012-01-09 Thread Rich Shepard
All but one of the summaries of multiple linear regressions in this analysis set present the residuals by min, 1Q, median, 3Q, and max. Example: lm(formula = TDS ~ Cond + Ca + Cl + Mg + Na + SO4, data = snow.cast) Residuals: Min 1Q Median 3Q Max -277.351 -32.551

Re: [R] selection part of subset

2012-01-09 Thread Christof Kluß
Hi thank you very much for your useful answers! In this case I solved it with Sarah's suggestion tab[tab[[name]] == v,] that works fine Greetings Christof Am 05-01-2012 16:51, schrieb Christof Kluß: Hi I want to do something like a - c(10,20,15,43,76,41,25,46) tab - data.frame(a)

Re: [R] Different lm() Residuals Output

2012-01-09 Thread Bert Gunter
It's the print method that determines this. See stats:::print.summary.lm and in particular the if clause beginning: if (rdf 5L) { R code is open source. Once you know what to look for, you can examine it yourself. -- Bert On Mon, Jan 9, 2012 at 9:25 AM, Rich Shepard

Re: [R] Different lm() Residuals Output

2012-01-09 Thread Rich Shepard
On Mon, 9 Jan 2012, Bert Gunter wrote: It's the print method that determines this. Bert, Oh. I wrap the lm() function in summary() so I didn't expect to see differences in output. See stats:::print.summary.lm and in particular the if clause beginning: if (rdf 5L) { OK. I'll read

[R] RODBC vs gdata

2012-01-09 Thread Christof Kluß
Hi one col in my Excel file contains many numbers. But on line 3000 and some other lines are strings like FG 1. RODBS seems to omit this lines. gdata works, but is much slower. Is this a bug of RODBC or do I apply it wrong? Example with the same file.xlsx library(RODBC); excel -

Re: [R] RODBC vs gdata

2012-01-09 Thread Enrico Schumann
Hi Christof, have a look at the manual of RODBC, and in particular the section on Excel drivers. RShowDoc(RODBC, package=RODBC) Regards, Enrico Am 09.01.2012 19:02, schrieb Christof Kluß: Hi one col in my Excel file contains many numbers. But on line 3000 and some other lines are

[R] what to do with underdispersed count data

2012-01-09 Thread karla
Hi, I have been trying to do a simple GLM with count data using a poisson distribution. The results show evidence of underdispersion. I have only ever encountered overdispersion. Am I still able to use family=quasipoisson to correct for underdispersion? Thank you, Karla -- View this message

Re: [R] RODBC vs gdata

2012-01-09 Thread Christof Kluß
Hi Enrico, thank you very much, so it is a known problem with the Microsoft Excel ODBC drivers :( 7 Excel Drivers ... There are at least two known problems with reading columns that do not have a format set before data entry, and so start with format `General'. First, the driver uses the fi rst

Re: [R] How can I stack two matrices?

2012-01-09 Thread iliketurtles
#The following works: a-array(rnorm(20),dim=c(10,2)) b-array(rnorm(20),dim=c(10,2)) ab-cbind(a,b) ab-array(ab,dim=c(10,2,2)) - Isaac Research Assistant Quantitative Finance Faculty, UTS -- View this message in context:

Re: [R] RODBC vs gdata

2012-01-09 Thread Hasan Diwan
On 9 January 2012 10:46, Christof Kluß ckl...@email.uni-kiel.de wrote: thank you very much, so it is a known problem with the Microsoft Excel ODBC drivers :( As I was advised a few weeks ago, the best way for Excel to get into R is to export the file as CSV and use read.csv, read.csv2, or

Re: [R] Can levelplot colorkeys display a logarithmic scale evenly?

2012-01-09 Thread Jean V Adams
Mike MacFerrin wrote on 01/05/2012 09:28:56 PM: I'm using the {lattice} levelplot function to make a (more or less) 2-d histogram, and for the most part it's working fine with my data. However, I can't get the color key to do what I need. I can give it labels and custom cutoffs, but my

Re: [R] plot, xlim to cut data set

2012-01-09 Thread Jean V Adams
Alaios wrote on 01/09/2012 10:28:28 AM: Dear all, I would like to tell plot to limit the plotted area into values (for the x axis) that are from X1 to X2. I have tried to use xlim=c(X1,X2) inside plot.. but unfortunately this does only change the labeling of the xaxis and not the values

[R] glmmPQL and predict

2012-01-09 Thread Mike Harwood
Is the labeling/naming of levels in the documentation for the predict.glmmPQL function backwards? The documentation states Level values increase from outermost to innermost grouping, with level zero corresponding to the population predictions. Taking the sample in the documentation: fit -

Re: [R] RODBC vs gdata

2012-01-09 Thread Enrico Schumann
You could prepare the data in Excel as text, and then coerce them to numeric in R (and approriately code your FG 1 strings). Depending on how large your file is, you could create a new file, format the cells as text, and then copy the data into this new file. Or change cell entries to text

Re: [R] Joint confidence interval for fractional polynomial terms

2012-01-09 Thread Frank Harrell
Good. If you are using linux/unix I can send you the new version now, otherwise I hope to submit to CRAN in about 10 days. Do note that most people plot pointwise confidence intervals in this setting, but I think that simultaneous confidence bands do have advantages. Frank Eleni Rapsomaniki-3

Re: [R] how to combine grouped data and ungrouped data in a trellis xyplot

2012-01-09 Thread Mike Dahman
Thanks Deepayan. That did the trick. xyplot(cpu~dt|zone,data=filt_zone_df,ylim=c(0,100),groups=pool, auto.key=list(columns=min(4,length(unique(filt_zone_df$pool))),lines=T,points=F), type=l, main=Test Chart, ylab=% Utilization,

Re: [R] RODBC vs gdata

2012-01-09 Thread Ajay Askoolum
If you use Excel and are prepared to use the RCOM package, another option for reading Excel workbooks becomes available: ado-comCreateObject(ADODB.RecordSet) sql-SELECT * FROM [Sheet1$] con-Provider=Microsoft.ACE.OLEDB.12.0;Data Source=XLSDataSource.xlsx;Extended Properties='Excel 12.0

[R] power in generalized linear models with categorical independent variables

2012-01-09 Thread Richard Friedman
Dear r-help list members, Is there an R package to compute the power and sample size of generalized linear models with categorical independent variables? I am especially interested in the negative binomial error model. Failing this, is there any package outside of R that does this kind

[R] Calculating rolling mean by group

2012-01-09 Thread Sam Albers
Hello all, I am trying to determine how to calculate rolling means in R using a grouping variable. Say I have a dataframe like so: dat1 - data.frame(x = runif(2190, 0, 125), year=rep(1995:2000, each=365), jday=1:365, site=here) dat2 - data.frame(x = runif(2190, 0, 200), year=rep(1995:2000,

[R] CairoPDF and greek letter spacing

2012-01-09 Thread John Walker
I have a small problem with R graphics output. When I use the lattice package and CairoPDF to generate publication quality graphs I often use the expression to create an axis title that has microlitres or micrometers as a unit. I use something like the following 'expression(paste(Length (, mu,m

Re: [R] [ncdf] programmatically copying a netCDF file

2012-01-09 Thread Tom Roche
summary: Programmatically copying NetCDF mostly works: thanks for your assistance! However, 4 followup questions/responses (and motivation provided) below regarding problems encountered. details: Tom Roche Thu, 05 Jan 2012 18:29:35 -0500 I need to do surgery on a large netCDF file (technically

Re: [R] R package equivalent to Excel SOLVER - Paquete R equivalente a SOLVER de Excel

2012-01-09 Thread Carl Witthoft
Or package(BB) , depending on exactly what you want to do. quote From: David Winsemius dwinsemius_at_comcast.net Date: Sun, 08 Jan 2012 16:54:28 -0500 On Jan 8, 2012, at 4:51 PM, Ricardo Bandin wrote: Esteemed colleagues I wonder if there is a package in R that performs the functions of the

Re: [R] runif with condition

2012-01-09 Thread Carl Witthoft
This question *screams* for the standard response: What is the problem you are trying to solve? I can think of two related problems off the top of my head. 1) Write a function which generates the four bridge hands from a well-shuffled deck. 2) Throw 100 pennies into a big shaker with four

Re: [R] splitting strings effriciently

2012-01-09 Thread MacQueen, Don
See suggestion inserted below. It assumes and requires that every input IP address has the required four elements. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 1/8/12 5:11 AM, Enrico Schumann enricoschum...@yahoo.de

Re: [R] Calculating rolling mean by group

2012-01-09 Thread Gabor Grothendieck
On Mon, Jan 9, 2012 at 6:39 PM, Sam Albers tonightstheni...@gmail.com wrote: Hello all, I am trying to determine how to calculate rolling means in R using a grouping variable. Say I have a dataframe like so: dat1 - data.frame(x = runif(2190, 0, 125), year=rep(1995:2000, each=365),

Re: [R] RODBC vs gdata

2012-01-09 Thread Gabor Grothendieck
On Mon, Jan 9, 2012 at 1:02 PM, Christof Kluß ckl...@email.uni-kiel.de wrote: Hi one col in my Excel file contains many numbers. But on line 3000 and some other lines are strings like FG 1. RODBS seems to omit this lines. gdata works, but is much slower. Is this a bug of RODBC or do I apply

Re: [R] CairoPDF and greek letter spacing

2012-01-09 Thread Rolf Turner
On 10/01/12 11:40, John Walker wrote: I have a small problem with R graphics output. When I use the lattice package and CairoPDF to generate publication quality graphs I often use the expression to create an axis title that has microlitres or micrometers as a unit. I use something like the

[R] Aggregate by minimum

2012-01-09 Thread Jeffrey Joh
For each date, I would like to keep the line with the lowest speed and discard the rest. The result would have one line for each date. Can I use aggregate for this? My table is as follows: structure(list(speed = c(3,9,14,8,7,6), result = c(0.697, 0.011, 0.015, 0.012, 0.018, 0.019), house

Re: [R] Aggregate by minimum

2012-01-09 Thread jim holtman
try this: x - structure(list(speed = c(3,9,14,8,7,6), result = c(0.697, 0.011, 0.015, 0.012, 0.018, 0.019), house = c(1, + 1, 1, 1, 1, 1), date = c(719, 1027, 1027, 1027, 1030, 1030), +id = c(1000, 1, +10001, 10002, 10003, 10004)), .Names = c(speed, + result, house, date, id),

Re: [R] CairoPDF and greek letter spacing

2012-01-09 Thread David Winsemius
On Jan 9, 2012, at 8:19 PM, Rolf Turner wrote: On 10/01/12 11:40, John Walker wrote: I have a small problem with R graphics output. When I use the lattice package and CairoPDF to generate publication quality graphs I often use the expression to create an axis title that has microlitres or

[R] Extracting Data from SQL Server

2012-01-09 Thread dthomas
Hi, I am new to R (and rusty on SQL!) and I'm trying to extract records from a SQL server database. I have a table of patient records (LoadPUS) which have three code columns which i want to evaluate against a list of particular codes (CVD_ICD$ table). Given the size of the patient table I want

[R] stacked barplot colour coding

2012-01-09 Thread acacia21
Hi all, i'm fairly new to R and its graphing, but having unsuccessfully 'googled' and checked this forum to find answer to my problem, i'm posting my question here. I'm trying to plot stacked barplot. I have simple data that looks like this: bg ag 0.412.81 0.372.91 0.31

Re: [R] Conditional Loop For Data Frame Columns

2012-01-09 Thread Rui Barradas
Hello, I believe that the following solves it: aggregate(SD[, 3:ncol(SD)], by=list(ID), mean) aggregate(SD[, 3:ncol(SD)], by=list(ID), mean, na.rm=TRUE) It's the second you want, it will compute the means for groups that aren't only NA and return NaN for groups with all values NA. Rui Barradas

[R] Lag() and lag()

2012-01-09 Thread lornyi
lag is a very confusing function i try to plot lag(x,-h) and y , the results are the same figures for all the h lags. then i saw online people use lag(x,-h) as xreg in arima that won't work in my eyes if lag function is consistent, isnce it returns the same value for all the lags i don't know in

Re: [R] Lag() and lag()

2012-01-09 Thread lornyi
besides I use Lag(x,h) to plot the lagged ts graph, it is very usefful but when doing the regression(arima, xreg=), i am really not sure if I should use lag(x,-h) or Lag(x,h) from online i see people use lag(x,-h), but i didnt believe that, bc I can't plot the lagged graph using this function.

Re: [R] Conditional Loop For Data Frame Columns

2012-01-09 Thread Rui Barradas
P.S. If you want to use your function, revised, it may be a good idea: it's faster #write indexed mean function meanfun - function(x, inx, na.rm=FALSE) { meanSD - matrix(0, nrow=length(levels(inx)), ncol=length(3:ncol(x))) for(i in 3:ncol(x)) { meanSD[, i - 2] -

[R] error in Recursive

2012-01-09 Thread arunkumar1111
Hi I need help in the recursive problem. this is my code #Generate two random Numbers minval=20 maxval=100 cutoffValue=50 optVal- function(cutoffValue,minval,maxval) { x=runif(2) x=x*cutoffValue for( i in 1:2) { if(x[i] 30 || x[i] 60) # checking it falls between the

[R] Lapack routine dgesv: system is exactly singular

2012-01-09 Thread Philip Robinson
Hi I have a problem with this error, I have searched the archives and found previous discussion about this, can I cannot understand how the explanations apply to what I am trying to do. I am trying to do Log_rank Survival analysis, I have included tables and str command, is it a

Re: [R] runif with condition

2012-01-09 Thread Rui Barradas
Hello, David is obviously right: David Winsemius wrote If the sample space is defined, for instance, as the set of all positive integers whose sum is 100, then it might be possible to say that one randomly drawn instance of such a 4-tuple would be 4 random numbers. What I meant to

[R] Call for Tutorial Proposals and Abstracts for useR! 2012

2012-01-09 Thread Frank Harrell
Dear R Community, The deadline for proposing half-day tutorials for useR! 2012 is January 15. If you would like to propose a tutorial and have not yet submitted a proposal to the web site, please do so by Jan. 15. More information is below. It is also not too early to submit abstracts for

Re: [R] CairoPDF and greek letter spacing

2012-01-09 Thread Rolf Turner
On 10/01/12 15:25, David Winsemius wrote: On Jan 9, 2012, at 8:19 PM, Rolf Turner wrote: On 10/01/12 11:40, John Walker wrote: I have a small problem with R graphics output. When I use the lattice package and CairoPDF to generate publication quality graphs I often use the expression to

Re: [R] CairoPDF and greek letter spacing

2012-01-09 Thread David Winsemius
On Jan 10, 2012, at 12:22 AM, Rolf Turner wrote: On 10/01/12 15:25, David Winsemius wrote: On Jan 9, 2012, at 8:19 PM, Rolf Turner wrote: On 10/01/12 11:40, John Walker wrote: I have a small problem with R graphics output. When I use the lattice package and CairoPDF to generate