Re: [R] csv file with two header rows

2013-04-27 Thread peter dalgaard
On Apr 26, 2013, at 14:48 , John Kane wrote: I don't think so. read.csv is a striped down version of read.table. You should be able to do this with the skip option there. You can also pass skip= to read.csv, it just passes it on to read.table. But it is not clear to me what is supposed to

Re: [R] using metafor for meta-analysis of before-after studies

2013-04-27 Thread Michael Dewey
At 03:27 27/04/2013, Qiang Yue wrote: Hello, Dr. Viechtbauer. I am trying to perform a meta-analyis on a group of before-after studies using Metafor. I read your webpage including your correspondence with Dr. Dewey (https://stat.ethz.ch/pipermail/r-help/2012-April/308946.html), who also

Re: [R] csv file with two header rows

2013-04-27 Thread John Kane
Thanks Peter, I must have misread the read.csv help. I thought skip had been dropped with a couple of other options. John Kane Kingston ON Canada -Original Message- From: pda...@gmail.com Sent: Sat, 27 Apr 2013 09:48:22 +0200 To: jrkrid...@inbox.com Subject: Re: [R] csv file with

[R] Loading of package RNetCDF fails

2013-04-27 Thread Marc Girondot
Dear Pavel Michna [maintainer of the package] (and copy to R-help Mailing List) When I try to load the package RNetCDF (after install from CRAN) I get this message: library(RNetCDF, lib.loc=/Library/Frameworks/R.framework/Versions/3.0/Resources/library) Error : .onLoad a échoué dans

Re: [R] csv file with two header rows

2013-04-27 Thread William Dunlap
But it is not clear to me what is supposed to happen with the the double header, or what the file format in question is exactly. I've seen double headers in which the first line gives the names of the variables and the second their units. E.g.,

Re: [R] csv file with two header rows

2013-04-27 Thread William Dunlap
And I've read them with the 2-calls-to-read.table trick you mentioned hd - read.csv(..., nrows=2) df - read.csv(..., skip=2, header=FALSE) names(df) - ... some operation on hd ... (or 3 calls, when I wanted to paste the units onto the variable name.) Or with

[R] [R-pkgs] Version 1.3.1 of apcluster package on CRAN

2013-04-27 Thread Ulrich Bodenhofer
Dear colleagues, This is to inform you that Version 1.3.1 of the R package apcluster has been released on CRAN. We did a major improvement of heatmap and dendrogram plotting, as well as several minor improvements of the package. For more details, see the following URLs:

Re: [R] Stepwise regression for multivariate case in R?

2013-04-27 Thread Uwe Ligges
On 26.04.2013 13:58, Jonathan Jansson wrote: Hi! I am trying to make a stepwise regression in the multivariate case, using Wilks' Lambda test. I've tried this: greedy.wilks(cbind(Y1,Y2) ~ . , data=my.data ) But it only returns: Error in model.frame.default(formula = X[, j] ~ grouping,

[R] Polynomial Regression and NA coefficients in R

2013-04-27 Thread Lucas Holland
Hey all, I'm performing polynomial regression. I'm simulating x values using runif() and y values using a deterministic function of x and rnorm(). When I perform polynomial regression like this: fit_poly - lm(y ~ poly(x,11,raw = TRUE)) I get some NA coefficients. I think this is due to the

Re: [R] Read big data (3G ) methods ?

2013-04-27 Thread Jan van der Laan
I believe it was already mentioned, but I can recommend the LaF package (not completely impartial being the maintainer of LaF ;-) However, the speed differences between packages will not be very large. Eventually all packages will have to read in 6 GB of data and convert the text data to

Re: [R] Error Installing packages

2013-04-27 Thread Uwe Ligges
On 26.04.2013 19:15, Pramod Anugu wrote: I am trying to install the package boss but i am getting error below: Please advice Well, it says configure: error: netcdf header netcdf.h not found so perhaps you do not have the netcdf headers installed? Best, Uwe Ligges

Re: [R] the joy of spreadsheets (off-topic)

2013-04-27 Thread Albyn Jones
I once had a discussion with an economist who told me in almost these exact words: I don't care what the data say, the theory is so clear. albyn On 2013-04-26 9:30, William Dunlap wrote: The prior for the incompetence/malice question is usually best set pretty heavily in favour of

Re: [R] Loading of package RNetCDF fails

2013-04-27 Thread Prof Brian Ripley
On 27/04/2013 14:40, Marc Girondot wrote: Dear Pavel Michna [maintainer of the package] (and copy to R-help Mailing List) When I try to load the package RNetCDF (after install from CRAN) I get this message: library(RNetCDF,

Re: [R] the joy of spreadsheets (off-topic)

2013-04-27 Thread Thomas Adams
Pretty scary... On Sat, Apr 27, 2013 at 12:28 PM, Albyn Jones jo...@reed.edu wrote: I once had a discussion with an economist who told me in almost these exact words: I don't care what the data say, the theory is so clear. albyn On 2013-04-26 9:30, William Dunlap wrote: The prior for

Re: [R] Predictions with missing inputs

2013-04-27 Thread Uwe Ligges
On 25.04.2013 18:12, tonitogomez wrote: Hi Bill, Very clear response. How about when the missing values are on the response variable being predicted (y)? That is, the model is fitted only to complete cases, but then I want to have predictions for all individual y (including those missing). Can

Re: [R] Polynomial Regression and NA coefficients in R

2013-04-27 Thread Bert Gunter
Inline. -- Bert On Sat, Apr 27, 2013 at 8:48 AM, Lucas Holland hollandlu...@gmail.com wrote: Hey all, I'm performing polynomial regression. I'm simulating x values using runif() and y values using a deterministic function of x and rnorm(). When I perform polynomial regression like this:

Re: [R] Polynomial Regression and NA coefficients in R

2013-04-27 Thread Joshua Wiley
Hi Lucas, You may find some of these examples useful (towards the end): http://elkhartgroup.com/rmodels.php For example in your case you could be using b splines instead of an 11th order polynomial, or use thin plate regression splines from the mgcv package. I will also humbly suggest that

[R] Manhattan Plot

2013-04-27 Thread lw...@yahoo.com
Hi, Tenfei, I have two group of data composed of gene mutation and deletion on specific sites. Will it be possible for me to use the Manhattan Plot for comparison? Thank you for you attention! Li-Wu Guo, Ph.D. Sent from Windows Mail [[alternative HTML version deleted]]

[R] Bls: RE: example

2013-04-27 Thread triutami . iut
Dear Sir, Yes, I want to generate the data by two Gaussian but mean from one of them generatated from polar its coordinates. I am confused about the algorithm? I know how to generate two Gaussian data with certain meancovariance matrix using mvnorm but what about mean from its polar

Re: [R] example

2013-04-27 Thread John Kane
https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example It is not clear what you want. Do you need to generate the data or do something with existing data? John Kane Kingston ON Canada -Original

Re: [R] csv file with two header rows

2013-04-27 Thread analys...@hotmail.com
On Apr 26, 8:17 pm, David Winsemius dwinsem...@comcast.net wrote: On Apr 25, 2013, at 6:35 PM, analys...@hotmail.com wrote: Is there a way to use read.csv() on such a file without deleting one of the header rows? What do you mean by one of the header rows? -- David Winsemius Alameda,

Re: [R] using metafor for meta-analysis of before-after studies

2013-04-27 Thread Qiang Yue
Hello, Michael. Thanks for your kind and rapid reply, and sorry for the inconvenience of characters. Yes, the primary studies reported the n, the mean percentage change and its standard deviation, but some did not report the original value of before- or after-intervention, and there is only

Re: [R] the joy of spreadsheets (off-topic)

2013-04-27 Thread Nuri Jazairi
Maurice Allais (1988 Nobel Laureate in Economics) once said something to the effect that economics can never be a science because it involves self-interest. * * It has been said that Euclid's theorem would have been bitterly contested had its implications brought financial or political

Re: [R] Read big data (3G ) methods ?

2013-04-27 Thread Kevin Hao
thank you all very much. Kevin On Sat, Apr 27, 2013 at 11:51 AM, Jan van der Laan rh...@eoos.dds.nlwrote: I believe it was already mentioned, but I can recommend the LaF package (not completely impartial being the maintainer of LaF ;-) However, the speed differences between packages will

[R] path reference problems in R 3.0.0

2013-04-27 Thread Melissa Key
Hi- I just upgraded R to 3.0.0 from 2.15.1 (which worked fine). When I started trying to install updated versions of the libraries, I saw the following error: install.packages(lme4) Installing package into 'c:/Docume~1/melissa/R/win-library/3.0' (as 'lib' is unspecified) Warning in

[R] r syntax

2013-04-27 Thread sgs sys
Hi i want to recode Male =1 and female =2 in R what is the syntax for same ? thanks Sameer [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Error in `contrasts-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :

2013-04-27 Thread sgs sys
i am getting the following error Error in `contrasts-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels can any on e suggest how torectify [[alternative HTML version deleted]]

[R] Help

2013-04-27 Thread Zilefac Elvis
Hello, I have a question and need your help urgently. I am new to R but want to learn it. I have several files in a folder which I have imported to R using : temp = list.files(pattern=*.txt) myfiles = lapply(temp, read.delim) The resulting files are on the workspace stored as List[110]. So

Re: [R] find and replace missing data in several different files

2013-04-27 Thread Zilefac Elvis
Hello, I have a question and need your help urgently. I am new to R but want to learn it. I have several files in a folder which I have imported to R using : temp = list.files(pattern=*.txt) myfiles = lapply(temp, read.delim) The resulting files are on the workspace stored as List[110]. So

Re: [R] path reference problems in R 3.0.0

2013-04-27 Thread Gabor Grothendieck
On Sat, Apr 27, 2013 at 3:08 PM, Melissa Key mkche...@mac.com wrote: Hi- I just upgraded R to 3.0.0 from 2.15.1 (which worked fine). When I started trying to install updated versions of the libraries, I saw the following error: install.packages(lme4) Installing package into

Re: [R] Help

2013-04-27 Thread arun
HI, Find 'T','C','A','F' and 'Y', delete them from all the 110 files I assume that you meant to replace it with NA. set.seed(28) myfiles- lapply(1:5,function(i) as.data.frame(matrix(sample(c(LETTERS,-999.99M),40*i,replace=TRUE),ncol=(40*i)/8),stringsAsFactors=FALSE))  myfiles[[1]] #  V1 V2 

Re: [R] r syntax

2013-04-27 Thread Rui Barradas
Hello, You should provide us with a data example. In the following, the two solutions are completely different but both of them do what you want. Note that the second creates a factor variable, whose levels are coded as integers. See R-intro.pdf in your doc directory, chapter 4 Ordered and

Re: [R] Manhattan Plot

2013-04-27 Thread Hasan Diwan
Just because it is possible to make a plot, doesn't mean it's a good idea. It would depend on what you're trying to show. -- H On 27 April 2013 17:21, lw...@yahoo.com lw...@yahoo.com wrote: Hi, Tenfei, I have two group of data composed of gene mutation and deletion on specific sites. Will it

Re: [R] Error in `contrasts-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :

2013-04-27 Thread William Dunlap
You didn't show an example of how to recreate your problem, but this shows up when a term in a model is a factor (or character) variable with no variation in it. E.g., d - data.frame(y=1:10, x1=rep(3,10), x2=rep(c(Female,Male),c(7,3))) lm(y ~ x1 + x2, data=d, subset = x2==Female) Error in

[R] Selecting ridge regression coefficients for minimum GCV

2013-04-27 Thread Preetam Pal
Hi all, I have run a ridge regression as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617

Re: [R] Selecting ridge regression coefficients for minimum GCV

2013-04-27 Thread William Dunlap
Using a reproducible example: library(MASS) fits - lm.ridge(y ~ ., longley, lambda=seq(0,.2,len=9)) whichIsBest - which.min(fits$GCV) coef(fits)[whichIsBest,] # no need to refit GNPUnemployed Armed.ForcesPopulation Year -1.454883e+03

Re: [R] Help

2013-04-27 Thread zilefacel...@yahoo.com
Hi A.K, Thanks for this great help. I wish to find -999.99M and replace with NA. All others like T, A, F etc should be deleted from the files. Thanks for much. -- Original Message -- From : arun To : Zilefac Elvis; Cc : R help; Sent : 27-04-2013

Re: [R] Help

2013-04-27 Thread arun
Hi, If you wanted to delete T, C,A, F and Y and replace -999.99M with NA, it is possible, but the result would be stored in a list if the number of elements deleted from each of the columns are different.   As you didn't provide any reproducible example, I don't know whether equal number of

Re: [R] r syntax

2013-04-27 Thread Bert Gunter
But there is almost certainly no need to do this in the first place! -- Bert On Sat, Apr 27, 2013 at 3:57 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, You should provide us with a data example. In the following, the two solutions are completely different but both of them do what you

Re: [R] Help

2013-04-27 Thread Jeff Newmiller
What do you mean when you say deleted from the files? You are discussing using space delimited files. What do you want to occupy the places where those letters are? --- Jeff NewmillerThe .

Re: [R] Help

2013-04-27 Thread arun
Hi Atem, I was able to read the file and removed those suffix letters.  The file had a lot of formatting issues.  I don't know about the formatting in your other files.  Also, there were lines  that differ in the number of elements. If it is similar to the one you send, you can try this:  

Re: [R] Bls: RE: example

2013-04-27 Thread Jim Lemon
On 04/27/2013 11:32 PM, triutami@gmail.com wrote: Dear Sir, Yes, I want to generate the data by two Gaussian but mean from one of them generatated from polar its coordinates. I am confused about the algorithm? I know how to generate two Gaussian data with certain meancovariance matrix