Re: [R] Using Aggregate() with FUN arguments, which require more than one input variables

2012-01-18 Thread RNoob
as.matrix() will not help here. I will get the same error message. And also, I don't need correlation matrices. I simply need a vector of correlations. I will show you some code and data I am using. Here you can see my main dataframe: head(test) industry datetestvar

Re: [R] Using Aggregate() with FUN arguments, which require more than one input variables

2012-01-18 Thread Alexander Erbse
as.matrix() will not help here. I will get the same error message. And also, I don't need correlation matrices. I simply need a vector of correlations. I will show you some code and data I am using. Here you can see my main dataframe: head(test) industry datetestvar

Re: [R] An unsubsettable object in a mixed model

2012-01-18 Thread sj414
R has no problem with a command of the type model-lme(Y~f(x),random=~x|z) but returns that error message when the command becomes something like model-lme(Y~f(X),random=~x|z,correlation=corCompSymm) Y is a vector of single observations from 2099 individuals, X is the covariate matrix of which

[R] Reshape with multiple aggregation functions

2012-01-18 Thread dimitris fekas
I have a data frame and I would like to reshape it to wide format while at the same time applying different aggregate functions to each column AND at times multiple aggregate functions:   test1 = data.frame(         id = c(rep('101',8),rep('102',8)),         phase  =

Re: [R] Reshape with multiple aggregation functions

2012-01-18 Thread Tal Galili
This sounds like a job for the melt/cast scheme for the reshape package. There is a tutorial for using it here: http://www.r-statistics.com/2012/01/aggregation-and-restructuring-data-from-r-in-action/ Good luck, Tal Contact

Re: [R] visualization for k-mean clustering

2012-01-18 Thread Tal Galili
Hi Mukul, If you are talking about the steps of the algorithm, then Yihui answered your question.. If you are looking for visualizing the resulting clusters, there is the clustergram function:

[R] Reshape with multiple aggregate functions

2012-01-18 Thread pengcafe
I have a data frame and I would like to reshape it to wide format while at the same time applying different aggregate functions to each column AND at times multiple aggregate functions: test1 = data.frame( id = c(rep('101',8),rep('102',8)), phase = rep(c('D','D','L','L'),4),

[R] Error in variable ' _' converted to a factor AND *tmp*

2012-01-18 Thread Jhope
I am wondering if anyone can tell me what the error I'm receiving means below. I thought it said that Aeventexhumed should be converted to a factor, so I tried to do so and received the following error. Please advise. J -

[R] sresid with lme4

2012-01-18 Thread Rense
Hi all, does anyone know how to extract or calculate studentized residuals for mixed effects models estimated with the lme4 package? kind regards, Rense -- View this message in context: http://r.789695.n4.nabble.com/sresid-with-lme4-tp4305922p4305922.html Sent from the R help mailing list

Re: [R] Using Aggregate() with FUN arguments, which require more than one input variables

2012-01-18 Thread Uwe Ligges
On 18.01.2012 09:49, Alexander Erbse wrote: as.matrix() will not help here. I will get the same error message. And also, I don't need correlation matrices. I simply need a vector of correlations. I will show you some code and data I am using. Here you can see my main dataframe:

Re: [R] Using Aggregate() with FUN arguments, which require more than one input variables

2012-01-18 Thread RNoob
Great! Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Using-Aggregate-with-FUN-arguments-which-require-more-than-one-input-variables-tp4303936p4306170.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Error in variable ' _' converted to a factor AND *tmp*

2012-01-18 Thread Milan Bouchet-Valat
Le mardi 17 janvier 2012 à 23:56 -0800, Jhope a écrit : I am wondering if anyone can tell me what the error I'm receiving means below. I thought it said that Aeventexhumed should be converted to a factor, so I tried to do so and received the following error. Please advise. J

[R] R help

2012-01-18 Thread Catarina Maia
hello! A few days ago I subscribed the R mailing list in order to ask for some help. The thing is that now I am receiving a lot of mails with doubts from other users but i am just a R begginer and i will not able to give useful help. So, i would like to quit the from the mainling list. I'm so

Re: [R] R help

2012-01-18 Thread Berend Hasselman
On 18-01-2012, at 12:53, Catarina Maia wrote: hello! A few days ago I subscribed the R mailing list in order to ask for some help. The thing is that now I am receiving a lot of mails with doubts from other users but i am just a R begginer and i will not able to give useful help. This

[R] computing scores from a factor analysis

2012-01-18 Thread wolfgang
Haj i try to perform a principal component analysis by using a tetrachoric correlation matrix as data input tetra - tetrachoric (image_na, correct=TRUE) t_matrix - tetra$rho pca.tetra - principal(t_matrix, nfactors = 10, n.obs = nrow(image_na), rotate=varimax, scores=TRUE) the problem i have is

[R] quantile type 1 perhaps?

2012-01-18 Thread Francisco
Hello, I need to analyse some data coming from a questionnaire which have for each item a likert scale 1-5. I need to find the lowest scores in the distribution, and for this purpose I thought to use the quantile() function to identify the participants belonging to the 5% with lowest scores

Re: [R] Reshape with multiple aggregation functions

2012-01-18 Thread pengcafe
Hello, and thanks for your answer, I have melted the data already and can reshape it with cast alright, but I still can find no way to provide a list of aggregate functions per column, nor multiple aggregate functions for some of them (i.e. mean AND stdev) -- View this message in context:

[R] manipulating data of several columns simultaneously

2012-01-18 Thread Nerak
Dear all, I have a question concerning manipulating data of several columns of a dataframe at the same time. I manage to do it for one column (with the use of the specific name for this column). In each columns, I have 60 values. But I should reorganize the values (because I created this as an

Re: [R] bayesian mixed logit

2012-01-18 Thread Carlo F
Thanks Ben, I am tryin on simulated data, say 300 repondents, 8 choice per person, only 2 random parameters... so i think it should be well behaved... so I am probably doing a mistake! :-) Thank for poiting out the MCMCglmm package, ultimately I need to write my own non-linear untility function,

Re: [R] manipulating data of several columns simultaneously

2012-01-18 Thread Gerrit Eichner
Hello, Nerak, maybe rbind( NA, head( results, -1)) does what you want (for all columns at once)? Hth, Gerrit On Wed, 18 Jan 2012, Nerak wrote: Dear all, I have a question concerning manipulating data of several columns of a dataframe at the same time. I manage to do it for one column

Re: [R] manipulating data of several columns simultaneously

2012-01-18 Thread Petr Savicky
On Wed, Jan 18, 2012 at 02:48:48AM -0800, Nerak wrote: Dear all, I have a question concerning manipulating data of several columns of a dataframe at the same time. I manage to do it for one column (with the use of the specific name for this column). In each columns, I have 60 values. But I

Re: [R] manipulating data of several columns simultaneously

2012-01-18 Thread Jean V Adams
Nerakg wrote on 01/18/2012 04:48:48 AM: Dear all, I have a question concerning manipulating data of several columns of a dataframe at the same time. I manage to do it for one column (with the use of the specific name for this column). In each columns, I have 60 values. But I should

Re: [R] R help

2012-01-18 Thread Poul Kristensen
Hello Catarina Maia I'm a beginner too! And I ask questions and people are answering very kindly. From what I know up til now is that R is a competitor to the very expensive SAS statistical software. R is free to use and is developed by professors and Ph.d's. As of my interest right now is R's

Re: [R] R help

2012-01-18 Thread John Kane
That's okay.  The mail goes to thousands of people some of whom can help with  a specfic problem. It is very useful for some one who is a beginer to read some of the answers. You learn a lot by reading about others problems that are similar to yours. Otherwise do what I do: Just delete any

[R] GUI

2012-01-18 Thread Scott Raynaud
I'm setting up a Linux box to run R.  I ususally run in a Windows envrionment but after reading the docs I'm not sure what to expect in terms of the front end appearance in Linux.  Does it resemble Windows or will I need Rkward or R Commander? __

Re: [R] bayesian mixed logit

2012-01-18 Thread Ben Bolker
Carlo F c.fezzi at uea.ac.uk writes: I am tryin on simulated data, say 300 repondents, 8 choice per person, only 2 random parameters... so i think it should be well behaved... so I am probably doing a mistake! Thank for poiting out the MCMCglmm package, ultimately I need to write my own

Re: [R] Checking dates for entry errors

2012-01-18 Thread Terry Therneau
On 1/11/2012 11:07 PM, Paul Miller wrote: Hello Everyone, I have a question about how best to check dates for entry errors. It depends on the study. 1. Simple: use as.Date on the data, and find resultant missing values. You might have to add a format to the as.Date call: if I use

Re: [R] An unsubsettable object in a mixed model

2012-01-18 Thread Ben Bolker
sj414 sj414 at medschl.cam.ac.uk writes: R has no problem with a command of the type model-lme(Y~f(x),random=~x|z) but returns that error message when the command becomes something like model-lme(Y~f(X),random=~x|z,correlation=corCompSymm) Y is a vector of single observations from 2099

Re: [R] GUI

2012-01-18 Thread Milan Bouchet-Valat
Le mercredi 18 janvier 2012 à 06:11 -0800, Scott Raynaud a écrit : I'm setting up a Linux box to run R. I ususally run in a Windows envrionment but after reading the docs I'm not sure what to expect in terms of the front end appearance in Linux. Does it resemble Windows or will I need

Re: [R] Reshape with multiple aggregation functions

2012-01-18 Thread Jean V Adams
dimitris fekas wrote on 01/18/2012 03:21:44 AM: I have a data frame and I would like to reshape it to wide format while at the same time applying different aggregate functions to each column AND at times multiple aggregate functions: test1 = data.frame( id =

[R] Scoring using cox model: probability of survival before time t

2012-01-18 Thread Terry Therneau
--begin included message --- Dear Members, I required to score probability of survival before specified time using fitted cox model on scoring dataset. On the training sample data I am able to get the probability of a survival before time point(t), but on the scoring dataset, which will have only

Re: [R] sresid with lme4

2012-01-18 Thread Ben Bolker
Rense rense.nieuwenhuis at gmail.com writes: does anyone know how to extract or calculate studentized residuals for mixed effects models estimated with the lme4 package? I'm not sure. The influence.ME package has measures of influence based on leave-one-out (jackknife) fitting, I think, so

Re: [R] Reshape with multiple aggregate functions

2012-01-18 Thread David Winsemius
On Jan 18, 2012, at 4:06 AM, pengcafe wrote: I have a data frame and I would like to reshape it to wide format while at the same time applying different aggregate functions to each column AND at times multiple aggregate functions: test1 = data.frame( id =

[R] Reference for dataset colon (package survival)

2012-01-18 Thread Terry Therneau
It has obviously been a very long time since I wrote that manual page. I've now updated it with the following which will show up in the next release. \note{The study is described in Laurie et al. A version of the data set with less follow-up time is used in the paper by Lin.} \references{

Re: [R] breakpoints and nonlinear regression

2012-01-18 Thread crimsonengineer87
Thanks for the comments. Yes, I also had segmented and then I went away from that. I can't remember. I've tried using it but I get some sort of strange error. Here's some code ... pavlu.glm - glm(Na ~ yield, data=pavludata, family=gaussian) pavlu.seg - segmented(pavlu.glm, seg.Z=~yield,

[R] Problems with Panel Data estimation

2012-01-18 Thread JBrettas
Hi everybody, Got some doubts here. I'm kinda desperate for help, so please ask me if anything isn't clear. I have a database with this structure (panel data structure): head(dados_2) Tempo Safra Data Resposta Perc_Resg_Acum Alta_Temporada Flexi Promo 1 1 1 200701 0.04223216

Re: [R] problems with method ken.sto in package soil.spec: subscript out of bounds

2012-01-18 Thread rl.leonardo
Hi Martin, Certainly there are some problems with the ken.sto function In addition there are some considerations that you have to take into account before using this code. For instance, it projects the data onto a principal component space prior sampling. In this case you have to a PCA is

Re: [R] help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!

2012-01-18 Thread Leonardo Ramirez-Lopez
Hi all Certainly there are some problems with the ken.sto function. In addition there are some considerations that need to be taken into account before using this code. For instance, it projects the data onto a principal component space prior sampling. In this case is necessary to check if a PCA

Re: [R] Is using glht with Tukey for lme post-hoc comparisons an appropriate substitute to TukeyHSD?

2012-01-18 Thread Anne Aubut
Hello Richard, Thank you for all of your feedback and for introducing me to the interaction_average argument. I realize that it is probably quite simple, but after some research, I am still having difficulty understanding how the interaction_average argument changes the calculation of

Re: [R] Using Sweave to generate multiple documents

2012-01-18 Thread Ramiro Barrantes
Just an FYI regarding this question. I found the answer on the DOCSTRIP, it allows you to create tags for different sections of your document, thus allowing one to generate multiple documents that share code. You can see an article about this in the December 2011 issue of the R Journal, its

Re: [R] GUI

2012-01-18 Thread Milan Bouchet-Valat
Le mercredi 18 janvier 2012 à 16:23 +0100, Poul Kristensen a écrit : How differs Rstudio from RKward? They seem to be quite similar, but their feature seats are somewhat different. I don't know RStudio enough to tell. I am not aware of the frequence of releases in R but I think it should be

[R] restricted model estimation

2012-01-18 Thread n.via...@libero.it
Dear all, I would like to know how to estimate in R a restricted model. The model would be: y=beta*X1+(1-beta)*X2 so the sum of coefficients must be one. I wonder if there is an option in the lm function that allows to specify that restriction or any other solutions to get the expected

Re: [R] R help

2012-01-18 Thread Kevin E. Thorpe
On 01/18/2012 06:53 AM, Catarina Maia wrote: hello! A few days ago I subscribed the R mailing list in order to ask for some help. The thing is that now I am receiving a lot of mails with doubts from other users but i am just a R begginer and i will not able to give useful help. So, i would

Re: [R] R help

2012-01-18 Thread R. Michael Weylandt
I believe there's also an option to get a daily digest of that day's activity. Michael On Wed, Jan 18, 2012 at 12:02 PM, Kevin E. Thorpe kevin.tho...@utoronto.ca wrote: On 01/18/2012 06:53 AM, Catarina Maia wrote: hello! A few days ago I subscribed the R mailing list in order to ask for

Re: [R] restricted model estimation

2012-01-18 Thread Ben Bolker
n.vialma at libero.it n.vialma at libero.it writes: I would like to know how to estimate in R a restricted model. The model would be: y=beta*X1+(1-beta)*X2 so the sum of coefficients must be one. I wonder if there is an option in the lm function that allows to specify that restriction

[R] Table Intersection

2012-01-18 Thread rantree
I've got two tables first one(table1): ID chromstart end Ex1 2152 180 Ex2 10 2000 2220 Ex3 15 3000 4000 second one ( table2): chrom locationname 2

[R] confint function in MASS package for logistic regression analysis

2012-01-18 Thread Jerome Myers
I have the following binary data set: Sex Response 0 1 0 159 162 1 4 37 My commands library(MASS) sib.glm=glm(sib~sex,family=binomial,data=sib.data) summary(sib.glm) The coefficients in the output are

[R] Loess smoothing - alpha Parameter

2012-01-18 Thread 8legged
I have thousands of Fst-values (markers) spread across the genome. I would like to use Loess to visualize and integrate them along the chromosomes. This makes sense only along the chromosome, since markers (and thus Fst values) are physically linked when located in close physical proximity. The

[R] XIII GRASS and GFOSS italian Meeting

2012-01-18 Thread francesca bader
Dear all, we would like to point out the approaching XIII GRASS and GFOSS italian Meeting which will take place at the University of Trieste from Wednesday, February 15 until Friday, February 17, 2012. Abstracts can be sent to  gr...@units.it till January 20 while subscriptions are open up to

[R] examine grouped data lmList

2012-01-18 Thread agent dunham
Dear community, I'm trying to examine my grouped data following page 6 http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-mixed-models.pdf. I'm trying lmList this way: model.list - lmList(log(v.dep) ~ log(v2) +log(v4) + v3 | v5, subset = v6=0, data=data) and obtain this error

Re: [R] GUI

2012-01-18 Thread Michael Schmidt
A couple of points. I don't know which Linux distro you are using, but in general I think it best to install R from the terminal using a CRAN mirror rather than from the Linux distro repository. The distro repositories are sometimes not completely up to date, so you will get more current updates

Re: [R] confint function in MASS package for logistic regression analysis

2012-01-18 Thread Marc Schwartz
On Jan 18, 2012, at 9:27 AM, Jerome Myers wrote: I have the following binary data set: Sex Response 0 1 0 159 162 1 4 37 My commands library(MASS) sib.glm=glm(sib~sex,family=binomial,data=sib.data)

Re: [R] confint function in MASS package for logistic regression analysis

2012-01-18 Thread Prof Brian Ripley
Yes, the results from confint() are much more accurate than yours and SPSS's. (As Bill Venables once said in a similar circumstance: this is not the place to report bugs in SPSS.) Hint: the word 'profile' appears all over the place on the help pages. confint() uses profile likelihood

Re: [R] confint function in MASS package for logistic regression analysis

2012-01-18 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Jerome Myers Sent: Wednesday, January 18, 2012 7:27 AM To: r-help@r-project.org Subject: [R] confint function in MASS package for logistic regression analysis I have the

Re: [R] confint function in MASS package for logistic regression analysis

2012-01-18 Thread William Dunlap
Your original data must have looked something like the following: sib.data - data.frame(sib=rep(c(0,1,0,1), c(159,4,162,37)), sex=rep(c(0,0,1,1), c(159, 4, 162, 37))) as that gives the 2x2 table you showed (with 'Response' - 'sib'): table(sib.data) sex sib 0

Re: [R] Table Intersection

2012-01-18 Thread Martin Morgan
On 01/18/2012 07:25 AM, rantree wrote: I've got two tables first one(table1): ID chromstart end Ex1 2152 180 Ex2 10 2000 2220 Ex3 15 3000 4000 second one ( table2): chrom

[R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread statguy
I would like to know if it is possible to make a function that defines a variable in another function without setting that variable globally? I would i.e. be able to define a variables value inside a function (one level above) which another function makes use of, without setting this variable

Re: [R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread R. Michael Weylandt
Consider this example: power - function(n){ function(x) x^n } # Note that this function returns a function! cube - power(3) cube(2) # gives 8 That make sense? Michael On Wed, Jan 18, 2012 at 1:30 PM, statguy marti...@mail.com wrote: I would like to know if it is possible to make a

Re: [R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread William Dunlap
Make an environment that the functions share. One way to do this is with local(): test - local({ y - NA + f1 - function(x) x + y + f2 - function(y1) { y - y1 ; f1(1) } + list(f1=f1, f2=f2) }) test$f2(2^(1:3)) [1] 3 5 9 (The example you showed

Re: [R] pscl package and hurdle model marginal effects

2012-01-18 Thread Achim Zeileis
Travis, thanks for the follow-up. As the reply got somewhat lengthier and includes a worked example, I include the R-help mailing list again. Maybe the reply is useful to someone else in the future. Thanks for the reply. I think you cleared it up, but I would like to follow up to be

Re: [R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread statguy
Great! That works perfectly sense. Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/How-to-define-a-variable-in-a-function-that-another-function-uses-without-using-global-variables-tp4307604p4307715.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread R. Michael Weylandt
And to the OP: note the all-important y - NA that starts off Bill's example. That makes a variable y in the local environment so - finds that first before it gets to searching the global environment (and possibly assigning there). It's not so important it's an NA just that it's initialized.

Re: [R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread statguy
Yes, I'm sorry. There was a typo as you discovered. Michael's solution worked fine. I will anyway take a look at the local function as well. Thank you for your help. -- View this message in context:

Re: [R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread R. Michael Weylandt
To close things out: credit is due to Thomas L rather than Luke T here: https://stat.ethz.ch/pipermail/r-help/2011-April/275905.html Michael On Wed, Jan 18, 2012 at 2:06 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: And to the OP: note the all-important y - NA that starts off

[R] R Table

2012-01-18 Thread Ajay Askoolum
Given a table with colnames and rownames, print(mytable) displays the table nicely formatted. How can I capture all of what is displayed as a character matrix? Thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] R Table

2012-01-18 Thread R. Michael Weylandt
Capture in what file format / device? If you want a plain text log, sink() or capture.output() probably will do it. MASS::write.table() might also help. I believe library(Hmisc) has some functions for converting to LaTeX tables as well, but I haven't used those myself. Michael On Wed, Jan 18,

Re: [R] R Table

2012-01-18 Thread R. Michael Weylandt
My mistake: MASS::write.matrix() or utils::write.table() Michael On Wed, Jan 18, 2012 at 2:44 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Capture in what file format / device? If you want a plain text log, sink() or capture.output() probably will do it. MASS::write.table()

Re: [R] R Table

2012-01-18 Thread Ajay Askoolum
Thank you. I used capture.output(); this is fine. From: R. Michael Weylandt michael.weyla...@gmail.com Cc: R General Forum r-help@r-project.org Sent: Wednesday, 18 January 2012, 19:44 Subject: Re: [R] R Table Capture in what file format / device? If you

[R] How do I exactly align the right hand side of mtext relative to a plot device? Beyond adj.

2012-01-18 Thread George Shirreff
Hi, I have a problem with aligning text which I'm adding to a plot using mtext. I would like to specify the position of the right hand end of the text string, relative to the device (in the left-right direction). I've been looking at the use of the argument adj. But this can't be used to specify

Re: [R] Prediciting sports team scores

2012-01-18 Thread kerry1912
In reply to the first comment: it isn't homework and is in fact to do with a betting system I am investigating for my own interest. -- View this message in context: http://r.789695.n4.nabble.com/Prediciting-sports-team-scores-tp4303708p4307787.html Sent from the R help mailing list archive at

[R] Time series questions

2012-01-18 Thread kchkchkch
Hi, I am trying to teach myself some time series analysis. I have some time series data on GDP, quarterly, from 1947 to 2011. colnames are Year Quarter GDP and GDP.deflator The first problem I have is that 4th quarter 2010 is missing--not even NA, there is no record for Year=2010 and Quarter

Re: [R] How to define a variable in a function that another function uses without using global variables

2012-01-18 Thread Duncan Murdoch
On 18/01/2012 1:51 PM, R. Michael Weylandt wrote: Consider this example: power- function(n){ function(x) x^n } # Note that this function returns a function! One bit of advice that may matter sometime: you should call force(n) to make sure it is evaluated before creating the new

Re: [R] How do I exactly align the right hand side of mtext relative to a plot device? Beyond adj.

2012-01-18 Thread Marc Schwartz
On Jan 18, 2012, at 1:14 PM, George Shirreff wrote: Hi, I have a problem with aligning text which I'm adding to a plot using mtext. I would like to specify the position of the right hand end of the text string, relative to the device (in the left-right direction). I've been looking at

Re: [R] How do I exactly align the right hand side of mtext relative to a plot device? Beyond adj.

2012-01-18 Thread Jean V Adams
George Shirreff wrote on 01/18/2012 01:14:55 PM: Hi, I have a problem with aligning text which I'm adding to a plot using mtext. I would like to specify the position of the right hand end of the text string, relative to the device (in the left-right direction). I've been looking at the

Re: [R] CairoPDF and greek letter spacing

2012-01-18 Thread James Cloos
RT == Rolf Turner rolf.tur...@xtra.co.nz writes: RT Compare: RT require(lattice) RT cairo_pdf(file=mung.pdf) RT print(xyplot(y~x,data=data.frame(x=1:10,y=1:10),main=expression(Length==mu*m))) RT dev.off() RT and RT pdf(file=gorp.pdf) RT

[R] Executable expressions

2012-01-18 Thread Ajay Askoolum
Given a-c(1,2,3,4,5) How can  I evaluate the variable a to return a (numeric) vector comprising of 1,2,3,4,5? Thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Executable expressions

2012-01-18 Thread R. Michael Weylandt
eval(parse(text = a)) But this is rarely a good ideaperhaps you could say a little more about your overall goal and we could direct you to a more R-ish solution? library(fortunes) fortune(rethink) Michael On Wed, Jan 18, 2012 at 4:18 PM, Ajay Askoolum aa2e...@yahoo.co.uk wrote: Given

[R] Warning on R CMD check

2012-01-18 Thread David L Lorenz
I am trying to check and build a package that requires another package that generates a warning, so the check step never really completes with no warnings. The package uses some routines in the lubridate package, but when the lubridate package is loaded for the check, I get these warnings:

Re: [R] Executable expressions

2012-01-18 Thread Sarah Goslee
mytext - c(1,2,3,4,5) a - eval(parse(text=mytext)) a [1] 1 2 3 4 5 will do this, if there's no better way to accomplish your actual goal. Sarah On Wed, Jan 18, 2012 at 4:18 PM, Ajay Askoolum aa2e...@yahoo.co.uk wrote: Given a-c(1,2,3,4,5) How can  I evaluate the variable a to return a

Re: [R] Executable expressions

2012-01-18 Thread Robin Cura
Hi eval(parse(text=a)) should do the trick :) Cheers, Robin 2012/1/18 Ajay Askoolum aa2e...@yahoo.co.uk Given a-c(1,2,3,4,5) How can I evaluate the variable a to return a (numeric) vector comprising of 1,2,3,4,5? Thanks. [[alternative HTML version deleted]]

Re: [R] Warning on R CMD check

2012-01-18 Thread R. Michael Weylandt
Which version of lubridate do you have on your machine? I don't get those warnings with the current CRAN version 0.2.6: it looks like Hadley changed things to avoid that problem just a few weeks ago: https://github.com/hadley/lubridate/tree/master/R (see the note on zzz.R) Michael On Wed, Jan

Re: [R] Executable expressions

2012-01-18 Thread Charlie Sharpsteen
On Wed, Jan 18, 2012 at 1:18 PM, Ajay Askoolum aa2e...@yahoo.co.uk wrote: Given a-c(1,2,3,4,5) How can  I evaluate the variable a to return a (numeric) vector comprising of 1,2,3,4,5? Thanks. You can also use an active binding:     makeActiveBinding('a', function(){c(1,2,3,4,5)},

[R] Executable Expressions II

2012-01-18 Thread Ajay Askoolum
Thank you Michael, Sarah and Robin for the answers to my original question. Michael you asked:But this is rarely a good ideaperhaps you could say a little more about your overall goal and we could direct you to a more R-ish solution? I realise eval (known as execute in one of my other

Re: [R] Warning on R CMD check

2012-01-18 Thread David L Lorenz
Michael, I just checked. I've got 0.2.5. I'll update tonight and see if that fixes the problem. Dave From: R. Michael Weylandt michael.weyla...@gmail.com To: David L Lorenz lor...@usgs.gov Cc: r-help@r-project.org r-help@r-project.org Date: 01/18/2012 03:32 PM Subject: Re: [R] Warning on R CMD

[R] R-Help

2012-01-18 Thread caam
I am trying to create a frequency distribution and I am a bit confused. Here are the commands I have entered: data - read.csv(file=40609_sortedfinal.csv,head=TRUE,sep=,) NumberOfActionsByStatus = data$STATUS NumberOfActionsByUser = data$ETS_LOGIN NumberOfBidOffer = data$BID_OFFER

Re: [R] Executable Expressions II

2012-01-18 Thread Richard M. Heiberger
If you are using rcom from Excel, then you would send R the vector of numbers containing the values you were interested in and you would get the mean back. I suggest you look at the RExcel implementation and duplicate its capabilities. The rcom documentation includes examples in other languages

[R] forecasting a time series

2012-01-18 Thread nhomeier
Couldn't find this in the archives. I'm fitting a series of historical weather-related data, but would like to use the latest values to forecast. So let's say that I'm using 1970-2000 to fit a model (using fourier terms and arima/auto.arima), but now would like to use the last X values to predict

[R] kmeans clustering on large but sparse matrix

2012-01-18 Thread Lishu Liu
Hi, I have a 60k*600k matrix, which exceed the vector length limit of 2^32-1. But it's rather sparse, only 0.02% has value. So I save is as MarketMatrix (mm) file, it's about 300M in size. I use readMM in Matrix package to read it in. If do so, the data type becomes dgTMatrix in 'Matrix' package

[R] Problem importing .txt file

2012-01-18 Thread Berneet Kaur
Hello, I hope I am doing this correctly, though I am not sure if a response will be posted somewhere or if I will get a direct response. I am trying to import a .txt table in my class on R and for some reason, the header gets altered and I can no longer read the data. No one in my

Re: [R] R-Help

2012-01-18 Thread Sarah Goslee
A reproducible example would be really helpful here, but I think what you want is: table(NumberOfActionsByUser, NumberOfBidOffer) On Wed, Jan 18, 2012 at 3:49 PM, caam shawn.akh...@gmail.com wrote: I am trying to create a frequency distribution and I am a bit confused. Here are the commands I

Re: [R] Executable expressions

2012-01-18 Thread Wet Bell Diver
for my info, why is this rarely a good idea? Is that the case for this particular example , or is eval(paste()) generally rarely a good idea? --Peter Op 18-1-2012 22:22, R. Michael Weylandt schreef: eval(parse(text = a)) But this is rarely a good ideaperhaps you could say a little more

Re: [R] Problem importing .txt file

2012-01-18 Thread Sarah Goslee
It's hard to diagnose the problem with importing the file without the file itself, but you can easily change the column names: colnames(Lambs) - c(Kind, Fatness, Wt) You should also open the text file itself and check that everything looks okay with the first few rows. Sarah On Wed, Jan 18,

Re: [R] Problem importing .txt file

2012-01-18 Thread R. Michael Weylandt
Responses will be sent to the list and bounced to you if you are subscribed: most replies also cc the thread and OP (and I think the server notes this so you don't get two copies). It looks like it may be an encoding problem in the .txt file. If your data allows it, try opening it up with a text

[R] drop rare factors

2012-01-18 Thread Sam Steingold
I have a data frame with some factor columns. I want to drop the rows with rare factor values (and remove the factor values from the factors). E.g., frame$MyFactor takes values A 1,000 times, B 2,000 times, C 30 times and D 4 times. I want to remove all rows which assume rare values (1%), i.e., C

Re: [R] drop rare factors

2012-01-18 Thread Sarah Goslee
Here's one way, worked out in lots of steps so you can see how each works: mydata - data.frame(MyFactor = factor(rep(LETTERS[1:4], times=c(1000, 2000, 30, 4))), something = runif(3034)) str(mydata) 'data.frame': 3034 obs. of 2 variables: $ MyFactor : Factor w/ 4 levels A,B,C,D: 1 1 1 1 1

[R] [R-pkgs] New package knitr

2012-01-18 Thread Yihui Xie
The knitr package was designed to be a transparent engine for dynamic report generation with R, solve some long-standing problems in Sweave, and combine features in other add-on packages into one package. It is a general-purpose package, and currently supports LaTeX, HTML and Markdown (still

Re: [R] R package dev: how to export constant?

2012-01-18 Thread Jonas Stein
On 2012-01-18, William Dunlap wdun...@tibco.com wrote: Try adding LazyData: yes to the DESCRIPTION file. [3] https://github.com/jonasstein/sitools Thank you. Now it works and I could add all SI prefixes. -- Jonas Stein n...@jonasstein.de __

[R] png output on a server?

2012-01-18 Thread Justin Haynes
I've got R running on a gentoo server that doesn't have X11 installed. Its a custom build to keep those dependencies at bay! However, some of my scripts use the base png() function and ggplot2. But, png uses X11. A google search suggests using the Cairo package, which works... but changes the

[R] makeCluster() function in doSNOW package hangs

2012-01-18 Thread Michael Krabbe Borregaard
Dear R help, I am trying to set up a cluster for parallel computing on a machine running 64-bit windows XP, using the doSNOW package on R 2.14.1. However, the command makeCluster() consistently makes the computer hang. No R processes are started, no CPU consumed, R just becomes unresponsive. ESC

Re: [R] Executable Expressions II

2012-01-18 Thread Ajay Askoolum
I am not using RExcel at all. I have now come up with a better solution that using eval. I can construct the data structure (like c(1,2,3,4,5)) as an object in C# and pass it as the argument to the method inside the web service that will call R. Works fine. [[alternative HTML version

  1   2   >