[R] Italicized title from index

2011-03-31 Thread Jeremy Newman
Hi all! I've written a handy script that uses a for loop to allow me to generate a large number of figures and statistical outputs for a large dataset. I am using indexing to retrieve a species name for the title of my graphs- which worked fine. However, I need to italicize these species names.

[R] Graph many points without hiding some

2011-03-31 Thread Samuel Dennis
I have a very large dataset with three variables that I need to graph using a scatterplot. However I find that the first variable gets masked by the other two, so the graph looks entirely different depending on the order of variables. Does anyone have any suggestions how to manage this? This code

[R] Assign Names of columns in data.frame dinamically

2011-03-31 Thread Marcos Amaris Gonzalez
Hello List. I have many files of ECG, each one with 7 column and I need only the second column and the name of each ECG. I am doing this but althought I have various days trying this i haven't gotten, so I ask help with this, if somebody cans help me I'll be so thankfully.

Re: [R] Graph many points without hiding some

2011-03-31 Thread Peter Langfelder
On Wed, Mar 30, 2011 at 10:04 PM, Samuel Dennis sjdenn...@gmail.com wrote: I have a very large dataset with three variables that I need to graph using a scatterplot. However I find that the first variable gets masked by the other two, so the graph looks entirely different depending on the order

[R] ANCOVA for linear regressions without intercept

2011-03-31 Thread Yusuke Fukuda
Hello R experts I have two linear regressions for sexes (Male, Female, Unknown). All have a good correlation between body length (response variable) and head length (explanatory variable). I know it is not recommended, but for a good practical reason (the purpose of study is to find a single

Re: [R] Graph many points without hiding some

2011-03-31 Thread Dennis Murphy
Hi: I can think of a couple: (1) size reduction of the points; (2) alpha transparency; (3) (1) + (2) From your original plot in base graphics, I reduced cex to 0.2 and it didn't look too bad: plot(rnorm(x,mean=19),rnorm(x),col=3,xlim=c(16,24), cex = 0.2) points(rnorm(x,mean=20),rnorm(x),col=1,

Re: [R] VECM with UNRESTRICTED TREND

2011-03-31 Thread Pfaff, Bernhard Dr.
Hello Greg, you include your trend as a (Nx1) matrix and use this for 'dumvar'. The matrix 'dumvar' is just added to the VECM as deterministic regressors and while you are referring to case 5, this is basically what you are after, if I am not mistaken. But we aware that this implies a

Re: [R] Graph many points without hiding some

2011-03-31 Thread Nick Sabbe
Hi. You could also turn it into a 3D plot with some variation on the function below: plot4d-function(x,y,z, u, main=, xlab=, ylab=, zlab=, ulab=) { require(rgl)#may need to install this package first #standard trick to get some intensity colors uLim-range(u)

[R] nls.profile

2011-03-31 Thread Daniel Kaschek
Hello, I use nls.profile to compute confidence intervals of parameter estimates of a non-linear model. When computing the profiles, the model function produces an error for certain parameter combinations. Therefore nls fails and so does nls.profile. Is there a way to tell nls.profile to ignore

Re: [R] summing values by week - based on daily dates - but with somedates missing

2011-03-31 Thread Martyn Byng
Hi, Yep, that was what it was doing. For a sum across week, try something like get.week.flag - function(dd) { ## get weekday from the date in dd and code it as Monday = 1, Tuesday = 2 etc idd = factor(weekdays(dd),levels=c(Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday)) ##

[R] statistical question

2011-03-31 Thread Anna Lee
Dear List! I want to compare medians of non normal distributed data. Is it possible and usefull to calculate 95% confidence intervals for medians? And if so - how can this be achieved in R? Thanks a lot! Anna -- Der Inhalt dieser E-Mail ist vertraulich. Sollte Ihnen die E-Mail irrtümlich

[R] dfsane arguments

2011-03-31 Thread Kristian Lind
Hi there, I'm trying to solve 2 nonlinear equations in 2 unknowns using the BB package. The first part of my program solves 3 ODEs using the deSolve package. This part works. The output is used as parameter values in the functions I need to solve. The second part is to solve 2 equations in 2

Re: [R] statistical question

2011-03-31 Thread Roger Koenker
The default rank test in the quantreg package would look like this summary(rq(y ~ d, tau = .5)) where d is a factor variable indicating which sample the elements of y belonged to. Summary returns a confidence interval for the coef of the factor variable -- if this interval excludes zero at the

[R] Simple lattice question

2011-03-31 Thread Rubén Roa
DeaR ComRades, require(lattice) data - data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)), x=rpois(60,10), y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5), z=rep(1:4,15))

Re: [R] how about a p- operator?

2011-03-31 Thread Kenn Konstabel
In addition to %...% operators one can define := (I haven't seen this possibility documented anywhere but it's used in a package) which seems to have different precedence. `:=`-`%-%` # the %-% by John Fox a [1] -1 a := 1000 + 1 [1] 1001 a [1] 1001 a %-% 1000 + 1 [1] 1001 a [1] 1000

[R] That dreaded floating point trap

2011-03-31 Thread Alexander Engelhardt
Hi, I had a piece of code which looped over a decimal vector like this: for( i in where ){ thisdata - subset(herde, herde$mlr = i) # do stuff with thisdata.. } 'where' is a vector like seq(-1, 1, by=0.1) My problem was: 'nrow(thisdata)' in loop repetition 0.4 was different if 'where' was

Re: [R] VECM with UNRESTRICTED TREND

2011-03-31 Thread Grzegorz Konat
Hello Bernhard, thank You so much one again! Now I (more or less) understand the idea, but still have problem with its practical application. I do (somewhat following example 8.1 in your textbook): library(urca) data(my.data) names(my.data) attach(my.data) dat1 - my.data[, c(dY, X, dM)] dat2 -

Re: [R] That dreaded floating point trap

2011-03-31 Thread Ted Harding
On 31-Mar-11 11:24:01, Alexander Engelhardt wrote: Hi, I had a piece of code which looped over a decimal vector like this: for( i in where ){ thisdata - subset(herde, herde$mlr = i) # do stuff with thisdata.. } 'where' is a vector like seq(-1, 1, by=0.1) My problem was:

Re: [R] how about a p- operator?

2011-03-31 Thread John Fox
Dear Ken and Bill, Thanks for the comments. I obviously didn't think about the precedence issue and was unaware that one could define :=. Best, John -Original Message- From: Kenn Konstabel [mailto:lebats...@gmail.com] Sent: March-31-11 7:12 AM To: William Dunlap Cc: John Fox; Carl

Re: [R] Italicized title from index

2011-03-31 Thread Henrique Dallazuanna
Try this: plot(1, main = bquote(Yield for ~ italic(.(spp)) ~ in management region ~ .(region))) On Thu, Mar 31, 2011 at 2:35 AM, Jeremy Newman jnewm...@uottawa.ca wrote: Hi all! I've written a handy script that uses a for loop to allow me to generate a large number of figures and

Re: [R] Italicized title from index

2011-03-31 Thread Henrique Dallazuanna
Better: plot(1, main = bquote(Yield for ~ italic(.(as.character(spp))) ~ in management region ~ .(region))) You have a factor, so you need convert it to character On Thu, Mar 31, 2011 at 8:59 AM, Henrique Dallazuanna www...@gmail.com wrote: Try this: plot(1, main = bquote(Yield  for ~

Re: [R] That dreaded floating point trap

2011-03-31 Thread Alexander Engelhardt
A very straightforward way to avoid this problem is to construct the sequence by multiplying a sequence of integers by an approriate constant. E.g. for your first example: for( i in where ){ thisdata- subset(herde, herde$mlr= i) # do stuff with thisdata.. } 'where' is a vector

Re: [R] VECM with UNRESTRICTED TREND

2011-03-31 Thread Pfaff, Bernhard Dr.
Hello Bernhard, thank You so much one again! Now I (more or less) understand the idea, but still have problem with its practical application. I do (somewhat following example 8.1 in your textbook):

Re: [R] VECM with UNRESTRICTED TREND

2011-03-31 Thread Grzegorz Konat
'time' was a trend variable from my.data set. Equivalent to the output of the command 'matrix' you just gave me. So now I did: library(urca) data(my.data) names(my.data) attach(my.data) dat1 - my.data[, c(dY, X, dM)] mat1 - matrix(seq(1:nrow(dat1)), ncol = 1) args('ca.jo') yxm.vecm - ca.jo(dat1,

Re: [R] That dreaded floating point trap

2011-03-31 Thread Sarah Goslee
On Thu, Mar 31, 2011 at 8:14 AM, Alexander Engelhardt this helps, thank you. But if this code is in a function, and some user supplies a vector, I will still have to round it in the function, I guess. It's weird how 0.1 is different from round(0.1, digits=1) , but I don't want to read that

Re: [R] fonts in mosaic

2011-03-31 Thread Michael Friendly
If you are doing multiple plots like this, there is no way I know of to specify the fonts for labeling *once* for all such plots. However, you can do something like this to save typing and keep things consistent: my.largs - list( gp_labels = gpar(fontsize = 12, fontfamily = calibri),

Re: [R] VECM with UNRESTRICTED TREND

2011-03-31 Thread Pfaff, Bernhard Dr.
Well, without further information, I do not know, but try the following library(urca) example(ca.jo) trend - matrix(1:nrow(sjf), ncol = 1) colnames(trend) - trd ca.jo(sjf, type = trace, ecdet = const, K = 2, spec = longrun, dumvar = trend) Best, Bernhard

Re: [R] That dreaded floating point trap

2011-03-31 Thread Alexander Engelhardt
Am 31.03.2011 14:41, schrieb Sarah Goslee: On Thu, Mar 31, 2011 at 8:14 AM, Alexander Engelhardt this helps, thank you. But if this code is in a function, and some user supplies a vector, I will still have to round it in the function, I guess. It's weird how 0.1 is different from round(0.1,

Re: [R] Lists of tables and conditional statements

2011-03-31 Thread Herbert, Alan G
Thanks Henrique - that worked like a charm - I had tried lots of other combinations before seeing your reply - wished I had asked sooner! Alan -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Wednesday, March 30, 2011 10:09 PM To: Herbert, Alan G Cc:

Re: [R] That dreaded floating point trap

2011-03-31 Thread Kenn Konstabel
n Thu, Mar 31, 2011 at 3:56 PM, Alexander Engelhardt a...@chaotic-neutral.de wrote: Am 31.03.2011 14:41, schrieb Sarah Goslee: On Thu, Mar 31, 2011 at 8:14 AM, Alexander Engelhardt this helps, thank you. But if this code is in a function, and some user supplies a vector, I will still have

Re: [R] VECM with UNRESTRICTED TREND

2011-03-31 Thread Grzegorz Konat
The code you gave me works fine with Finland, but the same for my data - does not! I do: library(urca) data(my.data) dat1 - my.data[, c(dY, X, dM)] trend - matrix(1:nrow(dat1), ncol = 1) colnames(trend) - trd yxm.vecm - ca.jo(dat1, type = trace, ecdet = const, K = 2, spec = longrun, dumvar =

Re: [R] That dreaded floating point trap

2011-03-31 Thread ONKELINX, Thierry
Dear Alexander, Instead of testing 'somevector 0.4', test 'abs(somevector - 0.4) some.small.number' Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg

[R] how to do t-test in r for difference of mean

2011-03-31 Thread arkajyoti jana
I am trying to do t-test to test whether the mean of one one column of the data frame is greater then another. please help me out. -- Arkajyoti Jana M. Phil/ 2nd semester Centre for Economic Studies and planning School of Social Sciences Jawaharlal Nehru University New Delhi-67

Re: [R] summing values by week - based on daily dates - but with somedates missing

2011-03-31 Thread Dimitri Liakhovitski
Thank you so much, everyone, for your help. Extremely valuable suggestions and extremely valuable learnings! Dimitri On Thu, Mar 31, 2011 at 5:03 AM, Martyn Byng martyn.b...@nag.co.uk wrote: Hi, Yep, that was what it was doing. For a sum across week, try something like get.week.flag -

Re: [R] how about a p- operator?

2011-03-31 Thread Duncan Murdoch
On 11-03-30 7:00 PM, Carl Witthoft wrote: I was cursing Matlab again today (what else is new) because the default action for every Matlab command is to spew the result to the console, and one must remember to put that darn ; at the end of every line. So I just wondered: was there ever a

Re: [R] That dreaded floating point trap

2011-03-31 Thread Duncan Murdoch
On 11-03-31 7:24 AM, Alexander Engelhardt wrote: Hi, I had a piece of code which looped over a decimal vector like this: for( i in where ){ thisdata- subset(herde, herde$mlr= i) # do stuff with thisdata.. } 'where' is a vector like seq(-1, 1, by=0.1) The solution to this problem is

Re: [R] Simple lattice question

2011-03-31 Thread Peter Ehlers
On 2011-03-31 03:39, Rubén Roa wrote: DeaR ComRades, require(lattice) data- data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)), x=rpois(60,10), y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5), z=rep(1:4,15))

[R] another statistical question

2011-03-31 Thread Anna Lee
Dear List! I have a unverse (basic population) which is not normally distributed. Now from this universe I take some subsets. Each subset is normally distributed within itself. I now want to compare the subsets and see if they differ significantly. So what is my assumption - normal distributed

Re: [R] Simple lattice question

2011-03-31 Thread Rubén Roa
Thanks Peters! Just a few minor glitches now: require(lattice) data - data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)), x=rpois(60,10), y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5), z=rep(1:4,15))

Re: [R] another statistical question

2011-03-31 Thread Alexander Engelhardt
Am 31.03.2011 15:46, schrieb Anna Lee: Dear List! I have a unverse (basic population) which is not normally distributed. Now from this universe I take some subsets. Each subset is normally distributed within itself. I now want to compare the subsets and see if they differ significantly. So what

[R] choosing best 'match' for given factor

2011-03-31 Thread Murali.Menon
Folks, I have a 'matching' matrix between variables A, X, L, O: a - structure(c(1, 0.41, 0.58, 0.75, 0.41, 1, 0.6, 0.86, 0.58, 0.6, 1, 0.83, 0.75, 0.86, 0.83, 1), .Dim = c(4L, 4L), .Dimnames = list( c(A, X, L, O), c(A, X, L, O))) a A X L O A 1.00 0.41 0.58 0.75 X

[R] error in recode.defalt ....object '.data' not found

2011-03-31 Thread Simon Kiss
Dear colleagues, working with the data frame below, trying to reverse two variables I the error message below. i searched through the help list but could not find any postings which could help me solve the situation. I tried attaching and detaching the data frame to no avail. Yours, Simon Kiss

Re: [R] error in recode.defalt ....object '.data' not found

2011-03-31 Thread John Fox
Dear Simon, Your intention appears to be to call the recode() function in the car package. That function is not generic, and consequently has no default method, leading me to believe that you've called a recode() function in some other package. I hope this helps, John

[R] AEM package

2011-03-31 Thread Fernanda Melo Carneiro
I'm trying to do AEM eigenfunctions, but I have a different number of points into each reservoir (e.g.: reservoir 1-4 points, reservoir 2-6 points, reservoir 3-2 points). Can someone help me?Besides this in the Legendre's book exemple in the part:length.edge-vector(length=nrow(edges.b))for

Re: [R] fonts in mosaic

2011-03-31 Thread Erich Neuwirth
The easiest way of changing the font used for labels by the windows graphics device (opened by a call to windows()) seems to be the following: Let us assume we want to use the font Consolas for all labels: windowsFonts(myfont=Consolas) par(family=myfont) If one later on wants to change the

Re: [R] ANCOVA for linear regressions without intercept

2011-03-31 Thread Bert Gunter
If you haven't already received an answer, a careful reading of ?formula will provide it. -- Bert On Wed, Mar 30, 2011 at 11:42 PM, Yusuke Fukuda yusuke.fuk...@nt.gov.auwrote: Hello R experts I have two linear regressions for sexes (Male, Female, Unknown). All have a good correlation

Re: [R] how to do t-test in r for difference of mean

2011-03-31 Thread Ista Zahn
Hi Arkajyoti, Please learn to help yourself. Start with help.search(t-test) Also read one of the many introductory R tutorials on the web. Best, Ista On Thu, Mar 31, 2011 at 9:07 AM, arkajyoti jana arkajyo...@gmail.com wrote: I am trying to do t-test to test whether the mean of one one column

Re: [R] choosing best 'match' for given factor

2011-03-31 Thread Nick Sabbe
Hi Murali. I haven't compared, but this is what I would do: bestMatch-function(searchVector, matchMat) { searchRow-unique(sort(match(searchVector, colnames(matchMat #if you're sure, you could drop unique cat(Original row indices:) print(searchRow)

Re: [R] another statistical question

2011-03-31 Thread Peter Ehlers
On 2011-03-31 07:44, Alexander Engelhardt wrote: Am 31.03.2011 15:46, schrieb Anna Lee: Dear List! I have a unverse (basic population) which is not normally distributed. Now from this universe I take some subsets. Each subset is normally distributed within itself. I now want to compare the

Re: [R] How to put line linking two plots

2011-03-31 Thread Greg Snow
Here is a way to do it using just base graphics: layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE)) plot(runif(10), type='b', ylim=c(0,1)) x.tmp - grconvertX(4, to='ndc') y.tmp - grconvertY(0.9, to='ndc') plot(runif(20), type='l', ylim=c(0,1)) par(xpd=NA) segments( 10, 1, grconvertX(x.tmp,

Re: [R] Italicized title from index

2011-03-31 Thread Jeremy Newman
Hi, Thank you *very* much. I'll remember that in the future! Cheers, -Jeremy N Undergraduate Researcher in Macroecology University of Ottawa Department of Biology Ad astra per alia porci! On Thu, Mar 31, 2011 at 8:01 AM, Henrique Dallazuanna www...@gmail.comwrote: Better: plot(1, main

Re: [R] Graph many points without hiding some

2011-03-31 Thread Greg Snow
Just a note, Base graphics does support transparency as long as the device plotting to supports it. -- 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

Re: [R] Simple lattice question

2011-03-31 Thread Peter Ehlers
On 2011-03-31 06:58, Rubén Roa wrote: Thanks Peters! Just a few minor glitches now: require(lattice) data- data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)), x=rpois(60,10), y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5),

Re: [R] choosing best 'match' for given factor

2011-03-31 Thread Bert Gunter
Folks: I think the following may be somewhat faster, as it avoids sorting: bmat - function(mx,vec) {   nm - colnames(mx)   ivec - match(vec,nm)   sapply(ivec,function(k){    if(k==1)NA  else { lookat - setdiff(seq_len(k-1),ivec) ## only those to left and not in search vector ##

[R] Sequential multiple regression

2011-03-31 Thread Tyler Rinker
Hello, In the past I have tended to reside more in the ANOVA camp but am trying to become more familiar with regression techniques in R. I would like to get the F change from a model as I take away factors: SO... mod1-lm(y~x1+x2+x3)...mod2-lm(y~x1,x2)...mod3-lm(y~x1) I can do

Re: [R] Sequential multiple regression

2011-03-31 Thread Bert Gunter
?drop1 -- Bert On Thu, Mar 31, 2011 at 9:24 AM, Tyler Rinker tyler_rin...@hotmail.com wrote: Hello, In the past I have tended to reside more in the ANOVA camp but am trying to become more familiar with regression techniques in R.  I would like to get the F change from a model as I take

Re: [R] statistical question

2011-03-31 Thread Greg Snow
You could do bootstrapping for confidence intervals or permutation tests for just comparing the medians. There are other tools as well, just be sure that you understand what you are testing and what assumptions are being made in whatever method you choose. -- Gregory (Greg) L. Snow Ph.D.

Re: [R] choosing best 'match' for given factor

2011-03-31 Thread Henrique Dallazuanna
Try this: bestMatch - function(search, match) { colnames(match)[pmax(apply(match[,search], 2, which.max) - 1, 1)] } On Thu, Mar 31, 2011 at 11:46 AM, murali.me...@avivainvestors.com wrote: Folks, I have a 'matching' matrix between variables A, X, L, O: a - structure(c(1, 0.41,

Re: [R] Sequential multiple regression

2011-03-31 Thread Tyler Rinker
Bert and anyone else with info, First, Bert thank you for your quick reply. drop1 gives the results as a type II anova. Is there a way to make drop1 give you type I anova (the args don't appear to have a way to do so)? Another package/function perhaps? Tyler Date: Thu, 31 Mar 2011

Re: [R] nls.profile

2011-03-31 Thread Douglas Bates
On Thu, Mar 31, 2011 at 4:02 AM, Daniel Kaschek daniel.kasc...@physik.uni-freiburg.de wrote: Hello, I use nls.profile to compute confidence intervals of parameter estimates of a non-linear model. When computing the profiles, the model function produces an error for certain parameter

[R] one question about bioconductor

2011-03-31 Thread wang peter
dear lady and gentalmen: i am gaoshan from kansas university. i used such coding to deal with gel data data - ReadAffy() Warning messages: 1: In file(out, wt) : cannot open file 'C:\Users\gaoshan\AppData\Local\Temp\RtmpvsyXOV\Rhttpd3f0b2e85': No such file or directory 2: In file(out,

[R] How to update R?

2011-03-31 Thread Li, Yunfei
Hi, My R version is old, and I would like to update it. How can I update R and keep all the libraries? Thanks Best, Yunfei Li -- Research Assistant Department of Statistics School of Molecular Biosciences

Re: [R] one question about bioconductor

2011-03-31 Thread Philipp Pagel
On Thu, Mar 31, 2011 at 09:32:06AM -0700, wang peter wrote: dear lady and gentalmen: i am gaoshan from kansas university. i used such coding to deal with gel data data - ReadAffy() Warning messages: 1: In file(out, wt) : cannot open file

[R] Cluster analysis, factor variables, large data set

2011-03-31 Thread Hans Ekbrand
Dear R helpers, I have a large data set with 36 variables and about 50.000 cases. The variabels represent labour market status during 36 months, there are 8 different variable values (e.g. Full-time Employment, Student,...) Only cases with at least one change in labour market status is included

[R] read password-protected files

2011-03-31 Thread Shi, Tao
Hi list, I have a bunch of .csv files that are password-protected. I wonder if there is a way to read them in in R without manually removing the password protection for each file? Thank you very much! ...Tao [[alternative HTML version deleted]]

Re: [R] How to update R?

2011-03-31 Thread Shi, Tao
This question has been asked by many people already. The easiest way is: 1) install the new version 2) copy all or the libraries that you installed later from the library folder of older version to the new version 3) uninstall the old version 4) do a library update in the new version Done!

Re: [R] How to update R?

2011-03-31 Thread Joshua Wiley
Hi Yunfei, It really depends to some extent on the version of R (and your OS) you were using. Here is a link to a blog post that discusses some potential strategies: http://www.r-statistics.com/2010/04/changing-your-r-upgrading-strategy-and-the-r-code-to-do-it-on-windows/ There are also a

Re: [R] Cluster analysis, factor variables, large data set

2011-03-31 Thread Christian Hennig
Dear Hans, clara doesn't require a distance matrix as input (and therefore doesn't require you to run daisy), it will work with the raw data matrix using Euclidean distances implicitly. I can't tell you whether Euclidean distances are appropriate in this situation (this depends on the

Re: [R] How to update R?

2011-03-31 Thread Shi, Tao
Forgot to mention that my way of updating is for Windows only. ...Tao From: Joshua Wiley jwiley.ps...@gmail.com To: Li, Yunfei yunfei...@wsu.edu Cc: r-help@r-project.org Sent: Thu, March 31, 2011 11:05:29 AM Subject: Re: [R] How to update R? Hi Yunfei, It

Re: [R] read password-protected files

2011-03-31 Thread Joshua Wiley
Hi Tao, You will need to give us more details. CSV files are pure text. How are they password protected? Are they Excel files? In a password protected compressed format? Encrypted? Best Regards, Josh On Thu, Mar 31, 2011 at 11:00 AM, Shi, Tao shida...@yahoo.com wrote: Hi list, I have a

Re: [R] read password-protected files

2011-03-31 Thread Prof Brian Ripley
On Thu, 31 Mar 2011, Shi, Tao wrote: Hi list, I have a bunch of .csv files that are password-protected. I wonder if there is There is nothing in the CSV standard about password protection. I very much doubt that these actually CSV files. So please follow the posting guide [*] a way

Re: [R] read password-protected files

2011-03-31 Thread Philipp Pagel
On Thu, Mar 31, 2011 at 11:00:48AM -0700, Shi, Tao wrote: Hi list, I have a bunch of .csv files that are password-protected. I wonder if there is a way to read them in in R without manually removing the password protection for each file? I doubt that there is such a thing as a

Re: [R] read password-protected files

2011-03-31 Thread Shi, Tao
Hi Josh and Prof. Ripley, Thanks for the quick replies! Sorry about the HTML email. It's the default for my yahoo account and forgot to switch. The question was asked by a colleague of mine. After double-checking, yes, they are actually Excel files. Any idea on how to approach this?

Re: [R] read password-protected files

2011-03-31 Thread Joshua Wiley
Hi Tao, There are a number of R packages to work with reading/writing Excel files (e.g., xlsReadWrite). If Excel is on the system in question, as long as you have opened the file in Excel, you should be able to use RODBC with RDCOMClient or rcom, but I am not sure those will work if it is

Re: [R] read password-protected files

2011-03-31 Thread Shi, Tao
Thanks, Josh. I use xlsReadWrite routinely. It would be nice if it has a password option. ...Tao - Original Message From: Joshua Wiley jwiley.ps...@gmail.com To: Shi, Tao shida...@yahoo.com Cc: r-help@r-project.org Sent: Thu, March 31, 2011 11:50:27 AM Subject: Re: [R] read

Re: [R] read password-protected files

2011-03-31 Thread Henrique Dallazuanna
Using RDCOMCliente: library(RDCOMClient) eApp - COMCreate(Excel.Application) wk - eApp$Workbooks()$Open(Filename=your_file,Password=your_password) tf - tempfile() wk$Sheets(1)$SaveAs(tf, 3) DF - read.table(sprintf(%s.txt, tf), header = TRUE, sep = \t) On Thu, Mar 31, 2011 at 3:33 PM, Shi, Tao

Re: [R] Cluster analysis, factor variables, large data set

2011-03-31 Thread Hans Ekbrand
On Thu, Mar 31, 2011 at 07:06:31PM +0100, Christian Hennig wrote: Dear Hans, clara doesn't require a distance matrix as input (and therefore doesn't require you to run daisy), it will work with the raw data matrix using Euclidean distances implicitly. I can't tell you whether Euclidean

[R] transparent grays?

2011-03-31 Thread Frostygoat
Is there a grayscale equivalent to alpha levels in rgb? Example: I have the following to make red transparent circles overlap with previously plotted blue symbols. symbols(x=sites$long,y=sites$lat,circles=log(sites$prop.nem +1),add=T,inches=F,bg=rgb(red=1,green=0,blue=0,

Re: [R] Cluster analysis, factor variables, large data set

2011-03-31 Thread Hans Ekbrand
On Thu, Mar 31, 2011 at 08:48:02PM +0200, Hans Ekbrand wrote: On Thu, Mar 31, 2011 at 07:06:31PM +0100, Christian Hennig wrote: Dear Hans, clara doesn't require a distance matrix as input (and therefore doesn't require you to run daisy), it will work with the raw data matrix using

Re: [R] Cluster analysis, factor variables, large data set

2011-03-31 Thread Peter Langfelder
On Thu, Mar 31, 2011 at 11:48 AM, Hans Ekbrand h...@sociologi.cjb.net wrote: The variables are unordered factors, stored as integers 1:9, where 1 means Full-time employment 2 means Part-time employment 3 means Student 4 means Full-time self-employee ... Does euclidean distances make

[R] rank of Matrix

2011-03-31 Thread Carson Farmer
Dear list, Can anyone tell me how to obtain the rank of a sparse Matrix, for example from package Matrix (class dgCMatrix)? Here is an example of QR decomposition of a sparse matrix (from the sparseQR class help). library(Matrix) data(KNex) mm - KNex$mm str(mmQR - qr(mm)) Similarly, using the

Re: [R] transparent grays?

2011-03-31 Thread Henrique Dallazuanna
Try this: with(trees, symbols(Height, Volume, circles=Girth/24, inches=FALSE, fg = gray30, bg = sapply(apply(rbind(col2rgb(gray(seq(0,1, l = 10)))/255, alpha = 0.5), 2, as.list), do.call, what = rgb))) On Thu, Mar 31, 2011 at 2:52 PM, Frostygoat frostyg...@gmail.com wrote: Is there a

[R] generate random numbers

2011-03-31 Thread Anna Lee
Hey List, does anyone know how I can generate a vector of random numbers from a given distribution? Something like rnorm just for non normal distributions??? Thanks a lot! Anna -- Der Inhalt dieser E-Mail ist vertraulich. Sollte Ihnen die E-Mail irrtümlich zugesandt worden sein, bitte ich

Re: [R] Sequential multiple regression

2011-03-31 Thread Bert Gunter
See http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf ?update.lm -- Bert On Thu, Mar 31, 2011 at 10:27 AM, Tyler Rinker tyler_rin...@hotmail.com wrote: Bert and anyone else with info, First, Bert thank you for your quick reply.  drop1 gives the results as a type II anova.  Is there a way to

Re: [R] generate random numbers

2011-03-31 Thread Greg Snow
There are several non-normal distributions built in that you could just use their generationg functions. There are packages (most with dist somewhere in the name) that allow for functions on standard distributions including combining together distributions. If your distribution is not one of

Re: [R] generate random numbers

2011-03-31 Thread Ted Harding
On 31-Mar-11 19:23:33, Anna Lee wrote: Hey List, does anyone know how I can generate a vector of random numbers from a given distribution? Something like rnorm just for non normal distributions??? Thanks a lot! Anna SUppose we give your distribution the name Dist. The generic approach

[R] fit.mult.impute() in Hmisc

2011-03-31 Thread Yuelin Li
I tried multiple imputation with aregImpute() and fit.mult.impute() in Hmisc 3.8-3 (June 2010) and R-2.12.1. The warning message below suggests that summary(f) of fit.mult.impute() would only use the last imputed data set. Thus, the whole imputation process is ignored. Not using a Design

Re: [R] Simple lattice question

2011-03-31 Thread David Winsemius
On Mar 31, 2011, at 8:41 AM, Peter Ehlers wrote: On 2011-03-31 03:39, Rubén Roa wrote: DeaR ComRades, require(lattice) data- data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)), x=rpois(60,10), y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5),

[R] Effects - plot the marginal effect

2011-03-31 Thread Tomii
Hello, I try to plot the marginal effect by using package effects (example of the graph i want to get is in the attached picture). All variables are continuous. Here is regression function, results and error effect function gives: mreg01 = lm(a90$enep1 ~ a90$enpres + a90$proximity1 +

[R] nlme for exact binomial model

2011-03-31 Thread Nonyane, Bareng A.S.
Hi I am conducting a meta-analysis on proportions and I'm interested in using the exact binomial likeliood for the within-study effects rather than the approximate approaches and I don't want to use the quasi-likelihood approach in R's glmmPQL. Does anyone know how I can do this using nlme? I

Re: [R] VECM with UNRESTRICTED TREND

2011-03-31 Thread renoir vieira
Dear Pfaff, Would that be possible to fit a Time varying VECM using urca? Yours, Renoir On Thursday, March 31, 2011, Grzegorz Konat grzegorz.ko...@ibrkk.pl wrote: The code you gave me works fine with Finland, but the same for my data - does not! I do: library(urca) data(my.data) dat1 -

[R] Create Variable names dynamically

2011-03-31 Thread Noah Silverman
Hi, I want to create variable names from within my code, but can't find any documentation for this. An example is probably the best way to illustrate. I am reading data in from a file, doing a bunch of stuff, and want to generate variables with my output. (I could make a list of lists and

Re: [R] Create Variable names dynamically

2011-03-31 Thread Henrique Dallazuanna
Take a look in ?assign On Thu, Mar 31, 2011 at 5:42 PM, Noah Silverman n...@smartmediacorp.com wrote: Hi, I want to create variable names from within my code, but can't find any documentation for this. An example is probably the best way to illustrate. I am reading data in from a file,

Re: [R] read password-protected files

2011-03-31 Thread Shi, Tao
Thanks, Henrique! I'll try that. ...Tao - Original Message From: Henrique Dallazuanna www...@gmail.com To: Shi, Tao shida...@yahoo.com Cc: Prof Brian Ripley rip...@stats.ox.ac.uk; r-help@r-project.org Sent: Thu, March 31, 2011 12:00:45 PM Subject: Re: [R] read password-protected

Re: [R] Create Variable names dynamically

2011-03-31 Thread Noah Silverman
Perfect. Thank You On Mar 31, 2011, at 1:47 PM, Mark Leeds wrote: hi noah: assign(thing you paste, 123, envir=whatever) should work I think. On Thu, Mar 31, 2011 at 4:42 PM, Noah Silverman n...@smartmediacorp.com wrote: Hi, I want to create variable names from within my code,

[R] Is it possible to run unit tests after a package installation?

2011-03-31 Thread Juan Carlos Borrás
Dear all, I'm deep into Chambers' SoDA and R-exts.html but I can't find all answers. The thing is that I would like to run my unit tests right after a package installation. That is while the command R CMD check package_name runs all files named package_name/tests/*.R (so unit tests can be placed

Re: [R] generate random numbers

2011-03-31 Thread David Scott
On 01/04/11 08:50, Ted Harding wrote: On 31-Mar-11 19:23:33, Anna Lee wrote: Hey List, does anyone know how I can generate a vector of random numbers from a given distribution? Something like rnorm just for non normal distributions??? Thanks a lot! Anna SUppose we give your distribution the

[R] Linear Model with curve fitting parameter?

2011-03-31 Thread stephen sefick
I have a model Q=K*A*(R^r)*(S^s) A, R, and S are data I have and K is a curve fitting parameter. I have linearized as log(Q)=log(K)+log(A)+r*log(R)+s*log(S) I have taken the log of the data that I have and this is the model formula without the K part lm(Q~offset(A)+R+S, data=x) What is the

Re: [R] Create Variable names dynamically

2011-03-31 Thread jim holtman
The best thing to do is to understand how to use 'list' for this purpose. Much easier to handle the information. On Thu, Mar 31, 2011 at 4:42 PM, Noah Silverman n...@smartmediacorp.com wrote: Hi, I want to create variable names from within my code, but can't find any documentation for this.

[R] regular expression

2011-03-31 Thread array chip
Hi, I am stuck on this: how to specify a match pattern that means not to include abc? I tried: grep(^(abc), hello, value=T) should return hello. while grep(^(abc), hello abcd foo, value=T) should return character(0). But both returned character(0). Thanks John [[alternative

  1   2   >