Re: [R] Repost: Expressions returned by GlobalEnv functions and package functions

2012-06-01 Thread Oliver Ruebenacker
Hello Saptarshi, If two functions behave differently even though their definitions are identical, then it is because they refer to variables that were in scope when the functions were defined (i.e. lexical scoping). To prevent such differences, either define both functions in the same

Re: [R] Higher log-likelihood in null vs. fitted model

2012-06-01 Thread Brian S Cade
Had several instances of similar issues with weighted leasts squares and weighted logistic regression recently. It is important to remember that the log likelihoods for the weighted models include a term that is a function of the n weights and that these are not incorporated in deviances (or

Re: [R] Probably a good use for apply

2012-06-01 Thread ROLL Josh F
Yes you are correct. I want need to change my sample number specification to the number of elements in the vector. So sampleWorker function should be: sampleWorker - function(x) return(sample(c(TRUE,FALSE),length(x), replace = TRUE, prob = c(x, 1-x))) So this is where I get a little

[R] Question on meaning of '%+%', '%?%' (? = various single letter) in code

2012-06-01 Thread Mike Hilt
Hello. I’ve seen several uses of '%?%' in R code (with ? = a single letter or other characters used as the middle character in a 3 character string with '%' as the 1st and 3rd characters). I’ve also recently seen ‘%+%’ usage at: http://vita.had.co.nz/papers/ggplot2-wires.pdf on p. 7 of the

Re: [R] Optimizing variables represented in a matrix

2012-06-01 Thread nataraj
Thanks David and rest of people for replying to my problem posted here. Basically this is my attempt to estimate the variables of a Gaussian random field model using maximum likelihood method. I have examples of using optim command to optimize one or more variables in a function, the optim

[R] [urgent]arranging data in descending order in each column

2012-06-01 Thread QAMAR MUHAMMAD UZAIR
Dear R users, I have data in the following manner [,1][,2][,3][,4] 6 2 2 2 5 4 4 3 6 35 2 13 7 32 3 5 4 4 423 3 3 6 4 5 5 6 5 3 I want to arrange all the data

[R] Need help in function itemFrequency() function - Apriori Algorithm

2012-06-01 Thread santoshdvn
Hi , I am trying the to implement Apriori algorithm with a sample data set . i am trying to find the itemFrequency of the items in the data set . but i am getting the error as below . i load the data from excel and save the dataset in mydata * itemFrequency(mydata) Error in function (classes,

Re: [R] How to create a floating bar plot

2012-06-01 Thread Roberto Brunelli
Thanks to both of you, close to the solution, but I think that your proposals do not address the case when a bar is completely positive (or negative): I do not think that the histogram can not be extended easily to this case ... I had a look at the likert function but it is not clear to me if it

[R] Fit lines in intxplot

2012-06-01 Thread arun
Dear R help, I tried to add linear fit lines in intxplot by adding index.cond = function(x,y) coef(lm(y ~ x))[1] inside the intxplot().  It didn't help.  I would appreciate any help. My dataset and codes are pasted below. Thanks, A.K. datGreen- read.table(text= Time,    DarkSt,    LightSt 0, 

Re: [R] anova of lme objects (model1, model2) gives different results depending on order of models

2012-06-01 Thread Chris Beeley
Well that's that cleared up then. Thanks to all. Chris B. On 31/05/2012 17:51, Albyn Jones wrote: No, both yield the same result: reject the null hypothesis, which always corresponds to the restricted (smaller) model. albyn On Thu, May 31, 2012 at 12:47:30PM +0100, Chris Beeley wrote:

Re: [R] strucchange Fstats() example

2012-06-01 Thread Achim Zeileis
On Thu, 31 May 2012, Mabille, Geraldine wrote: Thanks a lot for your answer Achim, this helped a lot. I have done a lot of reading, following your recommendations and I think I have a better idea of what I should use. My dataset contains binary data on survival of the calf depending on the

Re: [R] Question on meaning of '%+%', '%?%' (? = various single letter) in code

2012-06-01 Thread peter dalgaard
On Jun 1, 2012, at 00:30 , Mike Hilt wrote: Could someone help me out and let me know what ‘%?%’ (where ? = a single letter in a 3 character string with ‘%’ being the 1st and 3rd characters), and/or ‘%+%’ does in R code/function? They are just a vehicle for defining binary operators:

Re: [R] [urgent]arranging data in descending order in each column

2012-06-01 Thread Ben Bolker
QAMAR MUHAMMAD UZAIR d029307 at polito.it writes: Dear R users, I have data in the following manner [,1] [,2][,3][,4] 6 2 2 2 5 4 4 3 [snip] I want to arrange all the data in descending order. I have 92 columns in my actual data set. It is

Re: [R] Silencing the output of install.packages()

2012-06-01 Thread Uwe Ligges
On 01.06.2012 07:17, Tejas Kale wrote: Dear Uwe Many thanks for your reply. I agree with you but I need the silencing of output for a particular reason. I am working on a statistical package called VOStat which uses a Java based GUI to get the data and parameters of the test to be executed

Re: [R] Separate Array Variable Content

2012-06-01 Thread Akkara, Antony (GE Energy, Non-GE)
Hi iLai, What you showed below, almost same like I am also expecting. There is two matrix, 1) 1st - matrix contain values like this, ABC XYZ PQR ABC_CHECK XYZ_CHECK PQR_CHECK

[R] R as a shared library only

2012-06-01 Thread francogrex
Hello, I know how to embed R in other applications by linking my applications to the R.dll shared library. For example I can use R from within a Lisp program by having the foreign function interface in lisp connect directly to R.dll lib. However I still need all R (the other libs and supporting

[R] Redefine multiple columns (using grep) as factor variables

2012-06-01 Thread Johannes Radinger
Hi, I have a dataframe with around 100 columns. Now I want to redefine some of the columns as factors (using as.factor). Luckily all the names of the columns I want to redefine start with crast. Thus I thought I can use grep() for that purpose... ...I found an example for redefining a single

[R] getting the name of the working .Rdata file

2012-06-01 Thread Vito Muggeo (UniPa)
dear all, I do not if it is a nonsense question.. Is it possible in the R session to get the name of the current .Rdata file that I ran? I mean: suppose I double click the file myfile.Rdata. ls() returns the names of the objects in the current workspace (that is saved in myfile.Rdata). In

Re: [R] Redefine multiple columns (using grep) as factor variables

2012-06-01 Thread Rui Barradas
Hello, Sorry, I've just answered to Johannes without Cc to r-help. Repeat: See the difference. # helper function make.df - function(){ x - as.data.frame(matrix(1:24, ncol=6)) names(x) - c(paste0(crast, 1:2), A, B, paste0(crast, 5:6)) x } DF - make.df() (ix - grep(^crast,

[R] Finding multiple breakpoints - 'segmented' ?

2012-06-01 Thread Peter Hoitinga
Hello, I'm attempting to find multiple breakpoints in an association of my response variable (R.AUC) with two explanatory variables ('s.size' and 'bedekking'). The association between 's.size' and 'R.AUC' shows a plateau, but the value when this plateau is reached is differs for different values

Re: [R] Redefine multiple columns (using grep) as factor variables

2012-06-01 Thread Rui Barradas
I've made a mistake, I should have used 'lapply' not 'sapply' DF - make.df() str(DF) DF[, ix] - lapply(DF[, ix], as.factor) str(DF)# crast1: Factor w/ 4 levels I should have looked further... Rui Barradas Em 01-06-2012 10:10, Rui Barradas escreveu: Hello, Sorry, I've just answered to

Re: [R] getting the name of the working .Rdata file

2012-06-01 Thread Duncan Murdoch
On 12-06-01 5:05 AM, Vito Muggeo (UniPa) wrote: dear all, I do not if it is a nonsense question.. Is it possible in the R session to get the name of the current .Rdata file that I ran? I mean: suppose I double click the file myfile.Rdata. ls() returns the names of the objects in the current

Re: [R] [urgent]arranging data in descending order in each column

2012-06-01 Thread QAMAR MUHAMMAD UZAIR
Yes this is what i wanted. thanks indeed!!! On Fri, 1 Jun 2012 07:40:49 + Ben Bolker bbol...@gmail.com wrote: QAMAR MUHAMMAD UZAIR d029307 at polito.it writes: Dear R users, I have data in the following manner [,1][,2][,3][,4] 6 2 2 2 5 4 4

[R] POT Package

2012-06-01 Thread Yogs
Hi, I have a problem in fitting GPD distribution. i generate random numbers from gpd distribution from specific parameters using pot packege then i used fitgpd function to estimete the parameters.The estimated parameters are not matched with the given parameters i.e.from which i generate random

[R] r-project, votre plateforme transfert de fichier

2012-06-01 Thread Y. Ledroit
[1]transfert [2]transfert [3]fichier [4]fichier [5]sécurisé [6]sécurisé Bonjour, Vous êtes plus de 200 000 utilisateurs à échanger vos fichiers professionnels en

[R] Subtracting test string from vectors

2012-06-01 Thread Cren
Hi all, let I have two text string: *one - c(ciao,zio,caio,bello) two - c(caio,zio)* I would like to obtain a new text string which is* one - two* like this one: [1] ciao bello because caio and zio elements have been subtracted from *one*. What's the most efficient way to obtain this? Thank

Re: [R] Subtracting test string from vectors

2012-06-01 Thread Rui Barradas
Hello, ?setdiff setdiff(one, two) Hope this helps, Rui Barradas Cren wrote Hi all, let I have two text string: *one - c(ciao,zio,caio,bello) two - c(caio,zio)* I would like to obtain a new text string which is* one - two* like this one: [1] ciao bello because caio and zio

Re: [R] Subtracting test string from vectors

2012-06-01 Thread Cren
Rui Barradas wrote Hello, ?setdiff setdiff(one, two) Thank you for your help, Rui. But * setdiff(one,two) [1] ciao* Where's bello? -- View this message in context: http://r.789695.n4.nabble.com/Subtracting-test-string-from-vectors-tp4632049p4632053.html Sent from the R help mailing

Re: [R] strucchange Fstats() example

2012-06-01 Thread Mabille, Geraldine
Hi and thanks again for your answer. I have just a last question regarding the choice of the functional...if you have time to help on that again. I have tried running the sctest using the functionals you recommended sctest(gmass2,functional=meanL2BB)

Re: [R] How to create a floating bar plot

2012-06-01 Thread Sarah Goslee
On Friday, June 1, 2012, Roberto Brunelli wrote: Thanks to both of you, close to the solution, but I think that your proposals do not address the case when a bar is completely positive (or negative): I do not think that the histogram can not be extended easily to this case ... Why not?

[R] help to find or fix a SMAPE (Symmetric mean absolute percentage error ) with correction to avoid zero value in the series

2012-06-01 Thread gianni lavaredo
Dear Researchers, I am looking for a library or a function to calculate SMAPE with same doneminator to avoid a problem to the presence of 0 values in the series. I find this variotion of SMAPE called mSMAPE mSMAPE page 13 http://www.stat.iastate.edu/preprint/articles/2004-10.pdf yesterday

Re: [R] strucchange Fstats() example

2012-06-01 Thread Achim Zeileis
On Fri, 1 Jun 2012, Mabille, Geraldine wrote: Hi and thanks again for your answer. I have just a last question regarding the choice of the functional...if you have time to help on that again. I have tried running the sctest using the functionals you recommended

Re: [R] strucchange Fstats() example

2012-06-01 Thread Mabille, Geraldine
Thanks! I had seen this section but hadn't understood that the dashed line represented the mean. Does that mean in my case (two tests hardly significant P=0.03 and one NS) that I should reject the hypothesis of different levels of survival probability for different groups of females??

Re: [R] strucchange Fstats() example

2012-06-01 Thread Achim Zeileis
On Fri, 1 Jun 2012, Mabille, Geraldine wrote: Thanks! I had seen this section but hadn't understood that the dashed line represented the mean. Does that mean in my case (two tests hardly significant P=0.03 and one NS) that I should reject the hypothesis of different levels of survival

[R] Day or Month difference between dates???

2012-06-01 Thread Tammy Ma
HI, R-Users: I got a questions. have been struggling so long time I have this data: m1$Year_Month 201009 201010 201011 201101 201102 min(m1$Year_Month) 201009 I want to calculate the following two answers, how do I program it? difference in Month? [1] 0 1 2 4 5 difference

Re: [R] POT Package

2012-06-01 Thread Özgür Asar
Hi, You assumed scale=229678.21 and shape=0.41 and the procedure estimated \hat{scale}=427196.6 and \hat{shape}=0.2092887 I think these estimates are natural, since 1) you use a simulated generated data with n=100, and 2) the true value your scale parameter is very large. Hope this helps

Re: [R] Fit lines in intxplot

2012-06-01 Thread Peter Ehlers
On 2012-05-31 21:41, arun wrote: Dear R help, I tried to add linear fit lines in intxplot by adding index.cond = function(x,y) coef(lm(y ~ x))[1] inside the intxplot(). It didn't help. I would appreciate any help. My dataset and codes are pasted below. Thanks, A.K. datGreen-

Re: [R] Finding multiple breakpoints - 'segmented' ?

2012-06-01 Thread Vito Muggeo (UniPa)
dear Peter, Currently segmented handles multiple breakpoints for several variables (the limit discussed in the msg 2006 has been fixed..). However you are looking for a somewhat complicated model where the breakpoint of the relationship 's.size' and 'R.AUC' depends on another covariate

Re: [R] How to create a floating bar plot

2012-06-01 Thread Rmh
yes it handles completely on one side. your sample included that case. Sent from my iPhone On Jun 1, 2012, at 2:15, Roberto Brunelli roby.brune...@gmail.com wrote: Thanks to both of you, close to the solution, but I think that your proposals do not address the case when a bar is completely

Re: [R] Finding multiple breakpoints - 'segmented' ?

2012-06-01 Thread Peter Hoitinga
Dear Vito, Thanks for the quick reply. In the case of splitting up the data, would it be advisable to independently fit a GLM on the subsets of the data, or use one single GLM for comparison in the 'segmented' function? Kind regards, Peter On Fri, Jun 1, 2012 at 2:21 PM, Vito Muggeo (UniPa)

Re: [R] RScript.exe and map directory issue

2012-06-01 Thread Erich Neuwirth
To put double quotes in a string in VBA one has to use double double quotes str = a string with a quoted word On Jun 1, 2012, at 12:26 AM, Duncan Murdoch wrote: On 12-05-31 4:40 PM, Bert Jacobs wrote: Hi, I'm trying to run on Windows 7 a scriptfile with Rscript.exe from within Excel 2010

Re: [R] Fit lines in intxplot

2012-06-01 Thread arun
Hi Peter, Thanks for the help.  It is exactly what I wanted. Sorry, I forgot to post the library name. A.K. - Original Message - From: Peter Ehlers ehl...@ucalgary.ca To: arun smartpink...@yahoo.com Cc: R help r-help@r-project.org Sent: Friday, June 1, 2012 7:32 AM Subject: Re: [R]

[R] R Error : Error in vector(list, gamma(n + 1)) : vector size specified is too large

2012-06-01 Thread ritwik_r
Dear R-listers, I am giving part of my R code : ### n=15 m=1 library(partitions) library(gregmisc) library(combinat) x = t(restrictedparts(n-m,m)) l = length(x[,1]) for(u in 1:l){ A= unique(matrix( unlist(permn(x[u,])), ncol=m,

Re: [R] Subtracting test string from vectors

2012-06-01 Thread Rui Barradas
Hello, It works with me. one - c(ciao,zio,caio,bello) two - c(caio,zio) setdiff(one, two) [1] ciao bello Are you sure of the values in your 'one' and 'two'? Rui Barradas Cren wrote Rui Barradas wrote Hello, ?setdiff setdiff(one, two) Thank you for your help, Rui. But

Re: [R] Subtracting test string from vectors

2012-06-01 Thread arun
Hi, one - c(ciao,zio,caio,bello) two-c(ciao,zio) setdiff(one,two) [1] caio  bello A.K. - Original Message - From: Cren oscar.soppe...@bancaakros.it To: r-help@r-project.org Cc: Sent: Friday, June 1, 2012 6:13 AM Subject: Re: [R] Subtracting test string from vectors Rui Barradas

[R] Converting sp to maps ?/Map projection in sp-package?

2012-06-01 Thread Jari Haukka
Dear All, I hava maps in sp fomat and I like to use different map projection. SHouls I somehow convert sp to maps and make projection and ploting there? Or, is ther any tools to make new map project in sp? Cheers, Jari H Department of Public Health Faculty of Medicine University of Helsinki

Re: [R] registry vulnerabilities in R

2012-06-01 Thread ipstone
how about just removing those network related package (including CRAN) from your copy of R? R can be used portably, as long as you have the package you need installed already within your R. -- View this message in context:

[R] time-series statistics collection

2012-06-01 Thread Pierre Antoine DuBoDeNa
Hello, I am trying to collect several global measures or statistics for time-series as well as packages of R that can compute them. I have found several of them in papers and books, but the literature is so big i am sure i am missing several of them. skewness kurtosis min max mean SD

Re: [R] time-series statistics collection

2012-06-01 Thread Nicolas Iderhoff
One of the most important concepts is most certainly Stationarity (see “unit root test). the most common r-package will be: tseries. see: Brockwell/Davis (2006): Time Series: Theory and Models. Brockwell/Davis (2002): Introduction to Time Series and Forecasting. Cowpertwait/Metcalfe (2009):

[R] Error: package 'myLib' is not installed for 'arch=i386'

2012-06-01 Thread ikuzar
Hello, I 'd like to use some functions in myLib. So I do: library(myLib) Then I get this message: Error: package 'myLib' is not installed for 'arch=i386' sessionInfo() R version 2.13.2 (2011-09-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=French_France.1252

[R] Converting a pdataframe into dataframe

2012-06-01 Thread Apoorva Gupta
a - data.frame(name=c(rep(a,5), rep(b,5)), year=c(1989:1993, 1989:1993), var=c(1:10)) str(a) b - pdata.frame(a, index=c(name,year)) str(b) Now, I want to convert b into a data frame and have a structure similar to a. How do I do that? -- Apoorva Gupta Consultant National Institute of Public

[R] Stratified Sampling with randomForest Regression

2012-06-01 Thread Josh Browning
Hi All, I'm using R's randomForest package (and it's quite awesome!) but I'd really like to do some stratified sampling with a regression problem. However, it appears that the package was designed to only accommodate stratified sampling for classification purposes (see

Re: [R] Stratified Sampling with randomForest Regression

2012-06-01 Thread Liaw, Andy
Yes, you need to modify both the R and the underlying C code. It's the the source package on CRAN (the .tar.gz file). Andy -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Josh Browning Sent: Friday, June 01, 2012 10:48 AM To:

[R] Add rank column to data frame as in SQL...

2012-06-01 Thread Brigid Mooney
Hopefully this is an easy problem... I'm trying to add a partitioned rank column to a data frame where the rank is calculated separately across a partition by categories, the way you could easily do in SQL. I found this solution in the archives that looked like it might work:

Re: [R] Day or Month difference between dates???

2012-06-01 Thread Eik Vettorazzi
Hi Tammy, I suspect that the first 4 digits compose the year, so with Year_Month-c(2010*100+9:11,2011*100+1:2) #check composition Year_Month ym-(Year_Month%/%100*12+Year_Month%%100) ym-ym[1] should give the difference in months. Differences in Days are a bit trickier, since not all months have

Re: [R] Error: package 'myLib' is not installed for 'arch=i386'

2012-06-01 Thread Jeff Newmiller
You need the package compiled for your platform. You may also need to have a version of R that is compatible with that package, depending on how that package was constructed. You can either obtain the source for the package and install RTools and compile it yourself, or convince whoever

Re: [R] Separate Array Variable Content

2012-06-01 Thread ilai
Antony, I am now utterly confused. The conditions involve column names of X1. In your first post I assumed you just meant check for each row of x not columns. After Arun replied I realized that may have been a wrong assumption, but I just don't understand how you get, for example the last TRUE

[R] R studio web-based console ?

2012-06-01 Thread Langston, Jim
Hi all, My console is no longer responding to commands, I'm using the web-based console running off of a server. I have tried to interrupt R, I have deleted the data and profile files in the user directory, and restarted the server, relogged in, flushed the cache on the browser, but the

Re: [R] Converting a pdataframe into dataframe

2012-06-01 Thread Peter Ehlers
On 2012-06-01 07:09, Apoorva Gupta wrote: a- data.frame(name=c(rep(a,5), rep(b,5)), year=c(1989:1993, 1989:1993), var=c(1:10)) str(a) b- pdata.frame(a, index=c(name,year)) str(b) Now, I want to convert b into a data frame and have a structure similar to a. How do I do that? I assume that

Re: [R] R studio web-based console ?

2012-06-01 Thread Jeff Newmiller
Ask the RStudio developers. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live:

Re: [R] Converting a pdataframe into dataframe

2012-06-01 Thread Peter Ehlers
Whoops, forgot one line of code; below. On 2012-06-01 09:37, Peter Ehlers wrote: On 2012-06-01 07:09, Apoorva Gupta wrote: a- data.frame(name=c(rep(a,5), rep(b,5)), year=c(1989:1993, 1989:1993), var=c(1:10)) str(a) b- pdata.frame(a, index=c(name,year)) str(b) Now, I want to convert b into a

[R] Violation of sample independence in Pearson's product-moment correlation

2012-06-01 Thread Justin Montemarano
Hi all: There was a concern raised by reviewers of a manuscript of mine over the proper execution of a Pearson's correlation. In brief, this was undertaken in order to determine the relationship between the extent of wheel running (y axis) and ethanol intake (x axis) across three, separate 10 day

Re: [R] Day or Month difference between dates???

2012-06-01 Thread Rui Barradas
Hello, Try library(zoo) # needed for as.yearmon x - c(201009, 201010, 201011, 201101, 201102) (y - as.Date(paste(x, 01, sep=), format=%Y%m%d)) y - y[1] 12*(as.yearmon(y) - as.yearmon(y[1])) Note that to have a time difference between dates we need days (paste). Hope this helps, Rui Barradas

Re: [R] Violation of sample independence in Pearson's product-moment correlation

2012-06-01 Thread Bert Gunter
The reviewers are right. But this is not an R question at all. Post on a statistics list like stats.stackexchange.com. Much better yet, consult a local statistician, as it is abundantly clear that you have insufficient statistical background to properly analyze your data. Cheers, Bert On Fri,

Re: [R] R studio web-based console ?

2012-06-01 Thread Langston, Jim
Thanks - figured it out, I rebooted the physical server and everything is back to normal. Guess would be state is held somewhere that a restart of the R server didn't clear, probably /tmp, I have the server on a Linux system. Jim On 6/1/12 12:38 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote:

[R] Is there an HDF explorer in R?

2012-06-01 Thread Michael
So that we could explore the structure of a HDF5 file? Thanks a lot! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Adding a column into the file

2012-06-01 Thread pigpigmeow
Dear all, I have a lot of problems on R-programming. for example my csv. file is .. Date wrfRH wrfsolar wrfwindspeed wrfrain wrftd wrfta 21/10/2010 92.97 22.11 53.27 0 1546.337861 61.00852664 22/10/2010 87.35 21.99 40.89 0 1300.408288 62.85352227 23/10/2010 88.38 21.71 28.04 0.01

Re: [R] please help! Extract the row to the new file by using if-statment

2012-06-01 Thread pigpigmeow
Thank, it OK now but I don't understand what is the meaning of y - y[!is.na(y[5]),] Thank in advance! -- View this message in context: http://r.789695.n4.nabble.com/please-help-Extract-the-row-to-the-new-file-by-using-if-statment-tp4631957p4632090.html Sent from the R help mailing list archive

[R] Missing times chron

2012-06-01 Thread Rick Admiraal
Dear all, As a novice user of R I ran into a problem that's quite hard for me to resolve. I have a database containing data of a clinical trial in which patients are included that survived or died: x - matrix(data=c(1:5,0, 1/1/2012 00:00:00,0,0,1/7/2012 00:00:00), nrow=5, ncol=2, dimnames=

Re: [R] Using RDF/OWL with R?

2012-06-01 Thread Oliver Ruebenacker
Hello James, Thanks for the pointer, but Rredland is not maintained any more. Take care Oliver On Thu, May 31, 2012 at 8:21 PM, J Toll jct...@gmail.com wrote: On Thu, May 31, 2012 at 6:40 AM, Oliver Ruebenacker cur...@gmail.com wrote:     Hello,  Is there a convenient way

[R] regsubsets (Leaps)

2012-06-01 Thread farmedgirl
Hi i need to create a model from 250 + variables with high collinearity, and only 17 data points (p = 250, n = 750). I would prefer to use Cp, AIC, and/or BIC to narrow down the number of variables, and then use VIF to choose a model without collinearity (if possible). I realize that having a

Re: [R] passing known medoids to clara() in the cluster package

2012-06-01 Thread BAHKO
Hello Martin, I am not sure that PAM works with pre-defined medoids. The avg.width is always the same and when i check the medoids that were used for the calculation they are the same as before, i.e. before defining my own medoids. Please advise BAHKO -- View this message in context:

[R] scaling of parameter errors in a weighted regression using nls

2012-06-01 Thread Hengstberger Florian
I noticed that nls treats weights as relative and that the absolute size of the weights w in the following script has therefore no influence on the errors of the parameters reported in the summary a-1 b-3 x--100:100 y-a*x+b yeps-y+rnorm(length(x),sd=1) w-rep(1,length(x)) plot(x,yeps)

[R] Row count on criteria

2012-06-01 Thread Filoche
Hi everyone. I would like to count number of row higher than 0 for each column in a dataframe. For instance, I was using something like: YY = replicate(5, rnorm(10)) apply(YY,2,,0) This give me a boolean matrix, but how to have the count of row with numbers 0 by column? Thank in advance,

[R] Multiply variable by condition

2012-06-01 Thread jfca283
Hi I need to do something very simple. I have 2 variables, Y and M. I need to multiply Y by 1 if M=1, by 2 if M=3 and by 3.6678 if M=9. How do i make it? Thanks for your time and interest -- View this message in context: http://r.789695.n4.nabble.com/Multiply-variable-by-condition-tp4632086.html

Re: [R] regsubsets (Leaps)

2012-06-01 Thread Filoche
Hi. I would take a look to the /forward.se/l function in the /packfor/ package. http://r-forge.r-project.org/R/?group_id=195 Good luck, Phil -- View this message in context: http://r.789695.n4.nabble.com/regsubsets-Leaps-tp4632083p4632102.html Sent from the R help mailing list archive at

Re: [R] regsubsets (Leaps)

2012-06-01 Thread farmedgirl
thanks Phil, I will give it a try! -Kim -- View this message in context: http://r.789695.n4.nabble.com/regsubsets-Leaps-tp4632083p4632105.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Add rank column to data frame as in SQL...

2012-06-01 Thread arun
Hi, Couldn't find any problems if I understand what you mean. A.K. DF -within(DF,rank-ave(Salary,Company,FUN=function(x)rev(order(x DF    Company Person    Salary rank 1   GM  A  7067.905    4 2 Ford  B  9946.616    3 3   GM  C 31627.171    8 4   Toyota  D

Re: [R] time-series statistics collection

2012-06-01 Thread Pierre Antoine DuBoDeNa
Great thanks. If anyone else have an idea of statistics that can represent different aspects of time-series please let me know. -- Hello, I am trying to collect several global measures or statistics for time-series as well as packages of R that can compute them. I have found several of them in

Re: [R] Row count on criteria

2012-06-01 Thread Rui Barradas
Hello, Try colSums(apply(...etc...)) Hope this helps, Rui Barradas Em 01-06-2012 18:37, Filoche escreveu: Hi everyone. I would like to count number of row higher than 0 for each column in a dataframe. For instance, I was using something like: YY = replicate(5, rnorm(10)) apply(YY,2,,0)

[R] Fwd: regsubsets (Leaps)

2012-06-01 Thread Bert Gunter
Frank -- where are you?! (To the OP: Your post leaves me simply breathless. You are embarked on a fool's errand. Filoche's help will continue you down that path. IMHO only of course. Bottom line: You CANNOT do what you wish to do. Or to quote John Tukey: The combination of some data and an

[R] trouble with append() in a for loop

2012-06-01 Thread Benjamin Caldwell
Hello all, * * I'm having some difficulty, and I think the problem is with how I'm using append() nested inside a for loop. The data are: y,x 237537.61,873 5007.148438,227 17705.77306,400 12396.64369,427 228703.4021,1173 350181.9752,1538 59967.79376,630 140322.7774,710 42650.07251,630

Re: [R] please help! Extract the row to the new file by using if-statment

2012-06-01 Thread Sarah Goslee
Hi, On Fri, Jun 1, 2012 at 12:05 PM, pigpigmeow gloryk...@hotmail.com wrote: Thank, it OK now but I don't understand what is the meaning of y - y[!is.na(y[5]),] Thank in advance! This is very basic R syntax. You should definitely read the Introduction to R, and also ?[ ?! ?is.na Sarah --

Re: [R] Adding a column into the file

2012-06-01 Thread Sarah Goslee
Hi, On Fri, Jun 1, 2012 at 12:27 PM, pigpigmeow gloryk...@hotmail.com wrote: Dear all, I have a lot of problems on R-programming. for example my csv. file is .. Date                  wrfRH wrfsolar wrfwindspeed wrfrain wrftd wrfta 21/10/2010 92.97 22.11 53.27 0 1546.337861 61.00852664

Re: [R] Multiply variable by condition

2012-06-01 Thread Sarah Goslee
There are several ways. The easiest to understand is probably using if() statements: see ?if for help and examples. Sarah On Fri, Jun 1, 2012 at 11:34 AM, jfca283 jfca...@gmail.com wrote: Hi I need to do something very simple. I have 2 variables, Y and M. I need to multiply Y by 1 if M=1, by

[R] Drop values of one dataframe based on the value of another

2012-06-01 Thread Sam Albers
Hello all, Let me first say that this isn't a question about outliers. I am using the outlier function from the outliers package but I am using it only because it is a convenient wrapper to determine values that have the largest difference between itself and the sample mean. Where I am running

Re: [R] trouble with append() in a for loop

2012-06-01 Thread Sarah Goslee
Hi, Look at this line: cross.val.error-append(cross.val.error.temp,value.temp) at each iteration you're overwriting cross.val.error with cross.val.error.temp and value.temp You probably actually need something like cross.val.error.temp - append(cross.val.error.temp,value.temp)

[R] CRAN: Package WGCNA unavailable for Mac OS

2012-06-01 Thread Peter Langfelder
Hi, not sure this is the right mailing list, but anyway - I maintain the WGCNA package, and was just alerted by a Mac user that it is not available. Looking at the error log at http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/WGCNA-00check.html reveals checking package dependencies

Re: [R] How can I get this function to work?

2012-06-01 Thread Paul Miller
Hello Bert and Sarah, Thank you for your replies. Helped me understand how people might perceive my question and why they might not respond. Spent some time learning about R's debugging tools this morning. Began to realize why my function didn't work. My second argument was the name of a

Re: [R] trouble with append() in a for loop

2012-06-01 Thread Benjamin Caldwell
Yes, that did it. Thanks. *Ben Caldwell* On Fri, Jun 1, 2012 at 11:41 AM, Sarah Goslee sarah.gos...@gmail.comwrote: Hi, Look at this line: cross.val.error-append(cross.val.error.temp,value.temp) at each iteration you're overwriting cross.val.error with cross.val.error.temp and

Re: [R] scaling of parameter errors in a weighted regression using nls

2012-06-01 Thread Oliver Ruebenacker
Hello Florian, The best fit only depends on the relative statistical errors. The estimated parameter error is a purely statistical error and can be estimated from the sample. Systematic parameter errors are not estimated. Yes, parameter errors grow with measurement errors. Take care

[R] Partial R-square in multiple linear regression

2012-06-01 Thread Jin Choi
Hello, I am trying to obtain the partial r-square values (r^2 or R2) for individual predictors of an outcome variable in multiple linear regression. I am using the 'lm' function to calculate the beta coefficients, however, I would like to know the individual % contributions of several indepenent

Re: [R] How can I get this function to work?

2012-06-01 Thread Sarah Goslee
Hi Paul, I think you're making it far too complicated. With some minor tweaking to your function, I can easily process the entire data frame you originally presented. nearTerms - function(rawtext, target, before, after){ Text - unlist(strsplit(rawtext, )) Target - grep(target, Text) if

Re: [R] How can I get this function to work?

2012-06-01 Thread Paul Miller
Hi Sarah, That I was making things too complicated doesn't surprise me. A skilled programmer makes everything look easy I think. And someone who is still learning does just the opposite. Am going to spend some time now looking through your tweaks. Thank you very much for your help. Paul

[R] how to add a 'label' column

2012-06-01 Thread Jason Love
Hello R users, I'd like to ask a question about how to add a new column. So, below is my situation. In order to perform the repeated ANOVA, I first imported the following table. score=read.csv(patients_tests.csv); subject test1 test2 test3 test4test5test6 test7 1

Re: [R] how to add a 'label' column

2012-06-01 Thread Rui Barradas
Hello, Try score2$subject - rep(score$subject, 7) Hope this helps, Rui Barradas Em 01-06-2012 20:47, Jason Love escreveu: Hello R users, I'd like to ask a question about how to add a new column. So, below is my situation. In order to perform the repeated ANOVA, I first imported the

Re: [R] Adding a column into the file

2012-06-01 Thread David Winsemius
On Jun 1, 2012, at 12:27 PM, pigpigmeow wrote: Dear all, I have a lot of problems on R-programming. for example my csv. file is .. That certainly does not look like any csv file I have ever seen. Date wrfRH wrfsolar wrfwindspeed wrfrain wrftd wrfta 21/10/2010 92.97 22.11

Re: [R] how to add a 'label' column

2012-06-01 Thread Marc Schwartz
Just to throw out an alternative using the ?reshape function: # See the example using 'df3' on the help page DF.Long - reshape(score, direction = long, idvar = subject, varying = 2:8, sep = ) head(DF.Long, 24) subject timetest ab.1 ab1 0.17687 cl.1

Re: [R] Add rank column to data frame as in SQL...

2012-06-01 Thread William Dunlap
Try using the rank function instead of the order function. rank(x) is order(order(x)) if there are no ties. Since you want reverse ranks do either rank(-x) or length(x)+1-rank(x). E.g., DF - within(DF, rank2 - ave(Salary, Company, FUN=function(x)rank(-x))) DF[DF$Company==Toyota,]

Re: [R] Multiply variable by condition

2012-06-01 Thread David Winsemius
On Jun 1, 2012, at 2:37 PM, Sarah Goslee wrote: There are several ways. The easiest to understand is probably using if() statements: see ?if for help and examples. Sarah I would have thought ifelse() to be the necessary function, but for such simple cases I find boolean math to be clearer.

  1   2   >