Re: [R] Problems understanding use of regular expression (in gsub) for manipulating currency

2012-11-21 Thread Mauricio Cornejo
Arun, thanks for both of your suggestions. I played with your second idea some more and seemed to have found a more general solution (If not a digit nor period then replace with blank).  x <- "\"$ 1,200,300,400.50\""  gsub("[^0-9|.]", "", x, perl=TRUE) [1] "1200300400.50" Regards, Mauricio

[R] rapache memory problem

2012-11-21 Thread mrzung
Hi all; Now I'm developing web application by using rapache in ubuntu. My problem is that as users execute the application, the server PC cumulates memory. After users close or refresh the application page, the server PC memory is still cumulated. Now I'm renewing apache machine by manually in term

Re: [R] ROCR package not installing

2012-11-21 Thread Pascal Oettli
Hello, What is the version of R you use ? Regards, Pascal Le 22/11/2012 15:02, Philip Robinson a écrit : I have tried installing the package (ROCR) with this command: Install.packages(ROCR) And with this command on the command line R CMD INSTALL ROCR_1.0-4.tar.gz But both times I

[R] ROCR package not installing

2012-11-21 Thread Philip Robinson
I have tried installing the package (ROCR) with this command: Install.packages(ROCR) And with this command on the command line R CMD INSTALL ROCR_1.0-4.tar.gz But both times I get exactly the same error shown below, I don't understand what is wrong, is this an error in the package c

Re: [R] printing difftime summary

2012-11-21 Thread Sam Steingold
Hi, > * arun [2012-11-21 14:04:36 -0800]: > > Are you looking for some other function (difftime2string) > ot just remove the quotes from the printed output? I am wondering what others do when they want to see a summary of difftime. > If it is the latter, then this should do it. > res<-do.call(d

Re: [R] Problems understanding use of regular expression (in gsub) for manipulating currency

2012-11-21 Thread jim holtman
Here is another approach: > x <- "\"$ 1,200,300,400.50\"" > x [1] "\"$ 1,200,300,400.50\"" > gsub("[,$ \"]", "", x) [1] "1200300400.50" > as.numeric(gsub("[,$ \"]", "", x)) [1] 1200300401 > On Wed, Nov 21, 2012 at 4:41 PM, Mauricio Cornejo wrote: > x <- "\"$ 1,200,300,400.50\"" -- Jim Holt

Re: [R] lmer model specification

2012-11-21 Thread Ben Bolker
Roy comcast.net> writes: > > I am running version 2.15.2 64 bit version on 64 bit Windows 7. I have a > data set with the following structure: > Fixed Effect: locationFact > Random Effects: datefact, timefact nested in datefact, interactions of > datefact and timefact with locationFact I th

Re: [R] Listing elements of a 4D array

2012-11-21 Thread arun
Hi, I tested the first two snippets of data. #Try this: junk.melt1<-junk.melt[order(junk.melt[,1]),]  y<-cast(junk.melt1, Site ~ Rep ~ Especie ~ Año) #Seems ordered to me. A.K. From: Andrea Goijman To: arun Sent: Wednesday, November 21, 2012 8:53 PM Subj

Re: [R] Efficiently creating/defining new variables transformations

2012-11-21 Thread David Winsemius
On Nov 21, 2012, at 4:35 PM, nprause wrote: > I would like to add an extension to the current name of a variable to create > a new variable that is its sqrt transform. Each piece of the equation below > works independently, but the left side definition fails on run. I also tried > creating the va

Re: [R] ifelse + numeric

2012-11-21 Thread jim holtman
Try leaving the quote marks off the NA: data[,4] <- ifelse(data[,3]<1,data[,1]/(1-data[,3]),NA) You are putting a character value with the "NA" which converts everything else to a character. If you had examined the dataframe with 'str(data)' you would probably have seen the problem. On Wed, Nov

Re: [R] Problems understanding use of regular expression (in gsub) for manipulating currency

2012-11-21 Thread David Winsemius
On Nov 21, 2012, at 1:41 PM, Mauricio Cornejo wrote: > Hello, > > After reading help file, various threads on this board, and other online > tutorials, I've attempted to use gsub (using Perl-like syntax) to change a > currency string into something that can be converted to numeric type using

Re: [R] Removing default loess line from scatterplot ({car})

2012-11-21 Thread nprause
Thanks, this was not as clear from the help when I looked, but I see it now. -- View this message in context: http://r.789695.n4.nabble.com/Removing-default-loess-line-from-scatterplot-car-tp4649668p4650400.html Sent from the R help mailing list archive at Nabble.com. _

[R] Efficiently creating/defining new variables transformations

2012-11-21 Thread nprause
I would like to add an extension to the current name of a variable to create a new variable that is its sqrt transform. Each piece of the equation below works independently, but the left side definition fails on run. I also tried creating the variable name first, but ended up with an object that to

Re: [R] Updating Tom Short's R Reference Card, contacting him?

2012-11-21 Thread Duncan Murdoch
On 12-11-21 5:20 PM, Matthew Baggott wrote: I am uncertain about how to acknowledge the fact that $ can do partial matching in the space of about 30 characters. One option is this: x[["name"]] column named "name" x$name same as above (almost always) How about "as above (with p

Re: [R] Regression: standardized coefficients & CI

2012-11-21 Thread Torvon
Bert, If I am not mistaken the CI provided by confint(fit) are for the unstandardized beta weights, not the standardized. Although I found a tutorial for getting the standardized beta weights ( http://polisci.msu.edu/jacoby/msu/pls802/handouts/stdized/Stdized%20Coeffs%20in%20R,%20Handout.pdf), I s

Re: [R] cluster analysis in R

2012-11-21 Thread KitKat
Thanks, I have been trying that site and another one (http://www.statmethods.net/advstats/cluster.html) I don't know if I should be doing mclust or mcclust, but either way, the codes are not working. I am following the guidelines online at: mcclust - http://cran.r-project.org/web/packages/mcclust/

[R] Updating Tom Short's R Reference Card, contacting him?

2012-11-21 Thread Matthew Baggott
I am uncertain about how to acknowledge the fact that $ can do partial matching in the space of about 30 characters. One option is this: x[["name"]] column named "name" x$name same as above (almost always) Is that better or worse than ignoring this issue, or is there an even bett

[R] ifelse + numeric

2012-11-21 Thread djbanana
Hi, I have a data frame and I need to add another column. I am using: data[,4] <- ifelse(data[,3]<1,data[,1]/(1-data[,3]),"NA") This is returning values but are in quotation marks. The error I am getting is "non-numeric argument to binary operator" I need column four in data to be numeric. Trie

Re: [R] Regression: standardized coefficients & CI

2012-11-21 Thread Bert Gunter
?confint -- Bert On Wed, Nov 21, 2012 at 3:55 PM, Torvon wrote: > Bert, > > Please excuse me, and let me rephrase: > > How do I obtain the confidence intervals of the _standardized_ beta weights > for predictors in a linear regression in R? > > Thank you. > Torvon > > > On 21 November 2012 16:10

Re: [R] plotting 1000 simulations, error message: plot.new has not been called yet

2012-11-21 Thread Michael Weylandt
On Nov 21, 2012, at 6:07 PM, Maximilian Lklweryc wrote: > Hi, > I know this is not a mailing list for r, It's not? I'm confused then! > but I posted my question on > several help pages and did not get any help. I really don't know how > to solve my problem, maybe you could help me? > > want

Re: [R] Regression: standardized coefficients & CI

2012-11-21 Thread Torvon
Bert, Please excuse me, and let me rephrase: How do I obtain the confidence intervals of the _standardized_ beta weights for predictors in a linear regression in R? Thank you. Torvon On 21 November 2012 16:10, Bert Gunter wrote: > 1. This is a statistics, not an R, question. Post on a statis

Re: [R] update fit (removing insignificant variables)

2012-11-21 Thread soon yi
170 predictors - perhaps try lasso regression -- View this message in context: http://r.789695.n4.nabble.com/Re-update-fit-removing-insignificant-variables-tp4650379p4650394.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pr

[R] Listing elements of a 4D array

2012-11-21 Thread Andrea Goijman
Dear list, I'm having trouble to see how my elements on a 4 dimensional array are listed. For example, I generated the following array: junk.melt=melt(occ.data,id.var=c("Especie", "Site", "Rep", "Año"), measure.var="Pres") y=cast(junk.melt, Site ~ Rep ~ Especie ~ Año) Now, I want to be able to

[R] Making part of a data frame into a time series

2012-11-21 Thread andrewH
Dear folks – I have a bunch of data frames where columns 1:(n-1) contain information about a county, and columns n and higher contain a time series of monthly observations on that county. I wanted to get the data in columns n and higher to be recognized as a bunch of time series. So I wrote a func

[R] Question about VAR (Vector Autoregression) in differences.

2012-11-21 Thread Keith Weintraub
Folks, I have been using the VAR {vars} program to find a fit for the following bi-variate time series (subset): bivariateTS<-structure(c(0.950415958293559, 0.96077848972081, 0.964348957109053, 0.967852884998915, 0.967773510751625, 0.970342843688257, 0.97613937178359, 0.980118627997436, 0.98

[R] Lattice and a color problem

2012-11-21 Thread Peter Kupfer
Dear all, i have the attached data called "new" as data.frame. First I have only three columns called Var1, Var2 and Freq and with bind I attached the column test for a color specification (TEST DATA below). With this plot function (require packages lattice) dotplot(reorder(Var1, rep(scor

Re: [R] printing difftime summary

2012-11-21 Thread arun
Hello, Just a doubt.  Are you looking for some other function (difftime2string) ot just remove the quotes from the printed output? If it is the latter, then this should do it. res<-do.call(data.frame,lapply(s,difftime2string))  names(res)<-names(s)  res #   Min.   1st Qu.    Median Mean 

[R] Problems understanding use of regular expression (in gsub) for manipulating currency

2012-11-21 Thread Mauricio Cornejo
Hello, After reading help file, various threads on this board, and other online tutorials, I've attempted to use gsub (using Perl-like syntax) to change a currency string into something that can be converted to numeric type using only one regular expression.  Can anybody point out my error?  No

Re: [R] Integration in R

2012-11-21 Thread Ravi Varadhan
Send us a reproducible R code that shows what you actually tried. Ravi Varadhan, Ph.D. Assistant Professor The Center on Aging and Health Division of Geriatric Medicine & Gerontology Johns Hopkins University rvarad...@jhmi.edu 410-502-2619 [[alternative HTML ve

Re: [R] Reading PDF files

2012-11-21 Thread saskay
Thank you, Tony. Even in 2012, I still found your post useful. -- View this message in context: http://r.789695.n4.nabble.com/Reading-PDF-files-tp977248p4650374.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org ma

[R] Using doMC to run parallel SVM grid search?

2012-11-21 Thread Brian Feeny
Has anyone used doMC to speed up an SVM grid search? I am considering doing like so: library(doMC) registerDoMC() foreach (i=0:3) %dopar% { tuned_part1 <- tune.svm(label~., data = trainset, gamma = 10^(-10:-6), cost = 10^(-1:1)) tuned_part2 <- tune.svm(label~., data = trainset,

Re: [R] Weighted least squares

2012-11-21 Thread Mark Lamias
I'm guessing that you have more elements in your weights vector than you have observations?  It's hard to tell without seeing your data.   See below:   #Generate fake data y=rnorm(10) X1=rnorm(10) X2=rnorm(10) X3=rnorm(10)   #Create a 10 element vector of weights wts=abs(rnorm(10))   #weighted lm

Re: [R] Creating a frequency table for binomial varaible

2012-11-21 Thread arun
Hi, library(plyr) #sorry, forgot about that ?count() Anyway, Bill's solution is much easier and simple. You can also use this: set.seed(25)   bindat<-rbinom(20,15,0.1)  data.frame(value=0:5,freq=sapply(0:5,function(x,y=bindat) length(y[y==x]))) #  value freq #1 0    4 #2 1    7 #3 2

[R] lmer model specification

2012-11-21 Thread Roy
I am running version 2.15.2 64 bit version on 64 bit Windows 7. I have a data set with the following structure: Fixed Effect: locationFact Random Effects: datefact, timefact nested in datefact, interactions of datefact and timefact with locationFact I fit the model with the latest version of lm

Re: [R] Remove Column from matrix

2012-11-21 Thread arun
Hi, In this particular example, you may not be able to remove any columns: because: namVar <- c("TrlgWSST","TrlgWSSE","TrlgWSSR","SSdiff","TrlgWMSE","TrlgWR2","TrlgWR2adj","TrlgSSE","TrlgMSE","TrlgR2","TrlgR2adj","TrSSE","TrMSE","TrR2","TrR2adj","rdf2", "TelgSSE","TelgMSE","TelgR2","TelgR2adj",

Re: [R] Remove Column from matrix

2012-11-21 Thread frespider
Hi, I edited the code sorry, I forgot the line before Can you have look again please? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Remove-Column-from-matrix-tp4650334p4650348.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] update fit (removing insignificant variables)

2012-11-21 Thread arun
HI, I am not sure about the ?update() method. You could try this: set.seed(232) mat1<-matrix(sample(1:100,80,replace=TRUE),ncol=8) #with 8 columns dat1<-data.frame(mat1)  names(dat1)[1]<-"Y"  fit<-lm(Y~.,data=dat1) res<-coef(summary(fit))  res # Estimate Std. Error t value  

Re: [R] Finding a max

2012-11-21 Thread Ignacio Martinez
Thanks a lot! On Wed, Nov 21, 2012 at 12:51 PM, Rui Barradas wrote: > Hello, > > You're complicating what is simple: > > > prop3$effort[which.max(prop3$**Low)] # First maximum of Low > prop3$effort[which.max(prop3$**High)] # Ditto, of High > > which.max(prop3$Low) # Row number that maximizes

Re: [R] Integration in R

2012-11-21 Thread William Dunlap
But if you use a smaller sdlog value then integrate does get it wrong because it does not find the delta-like function hidden somewhere between 0 and infinity. > integrate(function(x){dlnorm(x,meanlog=-0.3,sdlog=0.00041)},0,Inf) 0 with absolute error < 0 > integrate(function(x){dlnorm(x,mea

Re: [R] [lattice] print only legend

2012-11-21 Thread David Winsemius
On Nov 21, 2012, at 1:45 AM, AnjaM wrote: > Is it possible to plot (and save) only the legend of a lattice plot? Of > course I could make the axes and axis labels transparent and use an empty > panel function, but additionally to being a very "dirty" solution, there > would be still a lot of free

Re: [R] Regression: standardized coefficients & CI

2012-11-21 Thread Bert Gunter
1. This is a statistics, not an R, question. Post on a statistics list, like stats.stackexchange.com Also... On Wed, Nov 21, 2012 at 12:39 PM, Torvon wrote: > I run 9 WLS regressions in R, with 7 predictors each. > > What I want to do now is compare: > (1) The strength of predictors within each

Re: [R] Integration in R

2012-11-21 Thread Rolf Turner
On 21/11/12 22:26, Rehena Sultana wrote: Dear R - Experts, I am trying to integrate lognormal distribution (mu = -0.3 and sigma2 = 0.00041.. ) based on the some hypothetical data. But I am getting 0 as the result. I have checked that my R-code is correct as code is giving me result for some o

[R] Regression: standardized coefficients & CI

2012-11-21 Thread Torvon
I run 9 WLS regressions in R, with 7 predictors each. What I want to do now is compare: (1) The strength of predictors within each model (assuming all predictors are significant). That is, I want to say whether x1 is stronger than x2, and also say whether it is significantly stronger. I compare st

Re: [R] Help: is there a R Package for L1-regression (not regression with L1-penalty)

2012-11-21 Thread cberry
"Chee Chen" writes: > Dear All, > Is there a R package for L1-regression (meaning, optimize the sum of > absolute deviations, NOT TO BE UNDERSTOOD as regression with > L1-penalty) ? Yes. > Any information will be appreciated. See http://cran.cnr.berkeley.edu/web/views/Robust.html HTH,

Re: [R] Remove Column from matrix

2012-11-21 Thread Rui Barradas
Hello, Three things: 1. You don't need an explicit comparison to TRUE, if(all(Asse[,"SSdiff"]==0)){ will do the same. 2. Your matrix Asse doesn't have colnames, try to see the output of colnames(Asse) You forgot to assign colnames(Asse) <- namVar. 3. Even if it did, SSdiff is the 4th column,

[R] Using doMC to run parallel SVM grid search?

2012-11-21 Thread Brian Feeny
Has anyone used doMC to speed up an SVM grid search? I am considering doing like so: library(doMC) registerDoMC() foreach (i=0:3) %dopar% { tuned_part1 <- tune.svm(label~., data = trainset, gamma = 10^(-10:-6), cost = 10^(-1:1)) tuned_part2 <- tune.svm(label~., data = trainset,

Re: [R] remote connection to an Oracle database - using RODBC - RMySQL..?

2012-11-21 Thread Marc Schwartz
On Nov 21, 2012, at 1:52 PM, Raffaello Vardavas wrote: > > Dear users, > > I can access an database oracle database using sql developer. This was done > by importing an xml file that contains the login details - username, password > and specifies that it uses the KERBEROS_AUTHENTICATION. >

Re: [R] cluster analysis in R

2012-11-21 Thread Brian Feeny
http://cran.r-project.org/web/views/Cluster.html might be a good start Brian On Nov 21, 2012, at 1:36 PM, KitKat wrote: > Thank you for replying! > I made a new post asking if there are any websites or files on how to > download package mclust (or other Bayesian cluster analysis packages) an

Re: [R] Scaling values 0-255 -> -1 , 1 - how can this be done?

2012-11-21 Thread S Ellison
> Subject: Re: [R] Scaling values 0-255 -> -1 , 1 - how can > this be done? #Also by taking advantage of numerical interpretation of booleans: x<- sample(255) #toy data 2*( x > 127.5 ) - 1 #S Ellison *** This email and any atta

Re: [R] Spider Graph

2012-11-21 Thread John Kane
is this link of any use? http://www.inside-r.org/packages/cran/fmsb/docs/radarchart John Kane Kingston ON Canada > -Original Message- > From: baronov...@bam.org > Sent: Wed, 21 Nov 2012 12:09:38 -0500 > To: r-help@r-project.org > Subject: Re: [R] Spider Graph > > Hi, > > Is the stars

Re: [R] Modify Y axis

2012-11-21 Thread David Winsemius
On Nov 21, 2012, at 9:44 AM, Elli wrote: How you can change the Y-axis intervals in a graph? Use and ylim command but this command only changes the minimum and maximum values ​​of the axis, I want to do is take the axis values ​​ from 10 to 10 for example How I can do? ?axis You will pr

Re: [R] Spider Graph

2012-11-21 Thread David Winsemius
On Nov 21, 2012, at 9:09 AM, Britt Aronovich wrote: Hi, Is the stars command in the base package No. or do I need to download? No I am looking to make star/radar/spider charts. The `stars` function is in the graphics package which is loaded by default. You should ahve been able to det

Re: [R] Modify Y axis

2012-11-21 Thread jim holtman
?axis On Wed, Nov 21, 2012 at 12:44 PM, Elli wrote: > How you can change the Y-axis intervals in a graph? > > Use and ylim command but this command only changes the minimum and maximum > values of the axis, I want to do is take the axis values from 10 to 10 > for example > How I can do? > > tha

Re: [R] histogram help

2012-11-21 Thread John Kane
i think we need some sample data. I would not have thought that you could calculate the percentage of a categorical data so perhaps a simple example of what you are doing would help. John Kane Kingston ON Canada > -Original Message- > From: rosario.scandu...@gmail.com > Sent: Wed, 21

Re: [R] Scaling values 0-255 -> -1 , 1 - how can this be done?

2012-11-21 Thread David Winsemius
On Nov 21, 2012, at 7:32 AM, Brian Feeny wrote: I have a dataframe in which I have values 0-255, I wish to transpose them such that: if value > 127.5 value = 1 if value < 127.5 value = -1 c(-1, 1)[ 1+(value > 127.5) ] I suspect most will find this less intuitive than `ifelse`, but I f

[R] remote connection to an Oracle database - using RODBC - RMySQL..?

2012-11-21 Thread Raffaello Vardavas
Dear users, I can access an database oracle database using sql developer. This was done by importing an xml file that contains the login details - username, password and specifies that it uses the KERBEROS_AUTHENTICATION. I'm trying to connect R - so that it can access this database - do sql

Re: [R] side by side boxplots

2012-11-21 Thread JoAnn Alvarez
Hi Charlie, I'm not sure what you mean by "opposite direction." It would be helpful if you include a simple, self-contained dataset here to illustrate your problem. For side-by-side boxplots, you can use tplot. JoAnn -- View this message in context: http://r.789695.n4.nabble.com/Re-side-by-

[R] printing difftime summary

2012-11-21 Thread Sam Steingold
Hi, I have a vector of difftime objects and I want to see its summary. Alas: --8<---cut here---start->8--- > summary(infl$delay) LengthClass Mode 9008386 difftime numeric --8<---cut here---end--->8--- this is almo

Re: [R] cluster analysis in R

2012-11-21 Thread KitKat
Thank you for replying! I made a new post asking if there are any websites or files on how to download package mclust (or other Bayesian cluster analysis packages) and the appropriate R functions? Sorry I don't know how this forum works yet -- View this message in context: http://r.789695.n4.n

[R] Bayesian cluster analysis - R functions

2012-11-21 Thread KitKat
I want to try Bayesian cluster analysis. Someone suggested using package mcclust. Is there a website that says how to install mcclust or another appropriate Bayesian package? Including the appropriate R functions that I can follow? I am trying to get probability of membership for each individual I

[R] plotting 1000 simulations, error message: plot.new has not been called yet

2012-11-21 Thread Maximilian Lklweryc
Hi, I know this is not a mailing list for r, but I posted my question on several help pages and did not get any help. I really don't know how to solve my problem, maybe you could help me? want to simulate stock paths. I have simulated 1000 paths with 22 trading days (1 starting value). Now I want

[R] histogram help

2012-11-21 Thread Rosario Scandurra
Hi, I want to generate an histogram and plot on the y axis the percentage of a categorical variable and on the x axis a nominal variable. I want to move the origin to have 2 categories below 0. Hope somebody could help me. Thanks. Best, -- Rosario Ivano Scandurra [[alternative HTML vers

[R] Remove Column from matrix

2012-11-21 Thread frespider
Hi,, Can I get help with this. I need to remove a column form the matrix if that specific column has his all entry zero, here the code I wrote but it is not working can you help me please namVar <- c("TrlgWSST","TrlgWSSE","TrlgWSSR","SSdiff","TrlgWMSE","TrlgWR2","TrlgWR2adj","TrlgSSE","TrlgMSE","T

[R] Modify Y axis

2012-11-21 Thread Elli
How you can change the Y-axis intervals in a graph? Use and ylim command but this command only changes the minimum and maximum values ​​of the axis, I want to do is take the axis values ​​from 10 to 10 for example How I can do? thanks -- View this message in context: http://r.789695.n4.nabble

Re: [R] Spider Graph

2012-11-21 Thread Britt Aronovich
Hi, Is the stars command in the base package or do I need to download? I am looking to make star/radar/spider charts. Thanks! Britt Britt Aronovich Marketing Analyst BAM (Brooklyn Academy of Music) ... Peter Jay Sharp Building 30 Lafayette Ave. Brooklyn, NY 11217-01486 ... P: 718.724.8038 E: b

Re: [R] help with if statement

2012-11-21 Thread David Winsemius
On Nov 21, 2012, at 9:05 AM, york8866 wrote: Hi all, I had a dataset A like: TIME DV 0 0 1 10 520 24 30 36 80 48 60 72 15 I would like to add 24 to those values higher than 24 in the TIME column. I did the following: If (A$TIME>=24) { A$TIME <- A$TIME+24} It did not work.

Re: [R] Remove Column from matrix

2012-11-21 Thread JoAnn Alvarez
Hi frespider, I think the problem is first that you are referring to column names that you haven't yet defined. To add the column names you can use the dimnames argument of the matrix function. Asse <- matrix(0,nrow=5,ncol=length(namVar), dimnames = list(NULL, namVar)) JoAnn -- View this mes

Re: [R] GEE - order of data?

2012-11-21 Thread JoAnn Alvarez
Hi Anna, In the geeglm help file, it states "Data are assumed to be sorted so that observations on a cluster are contiguous rows for all entities in the formula." I'm not sure if you are asking how to sort data, or how your data should be sorted. If your data come from a data frame called dat, it

Re: [R] Sourcing files with Umlaut in path no longer works

2012-11-21 Thread Ulrike Grömping
Duncan and Peter, thank you very much! Actually, I made a mistake with the path, due to my inexperience with Windows 7 (user instead of users). The R warning then confused me, because I was told that 'C:/user/grömping/documents/publicat/...' wasn't found. In fact, once the path was correct, s

Re: [R] Create BATCH file

2012-11-21 Thread FJ M
"C:\Program Files\R\R-2.15.1\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Projects\Current_Yield\Divs.txt" "C:\Users\Frank\Documents\R\Projects\Current_Yield\Divs.out" Divs.txt contains my R code and the output goes to Divs.out. I always check Divs.out first. If you want to write obj

Re: [R] Scaling values 0-255 -> -1 , 1 - how can this be done?

2012-11-21 Thread arun
HI, You could also use: set.seed(5)  x1<-data.frame(matrix(sample(0:255,80,replace=TRUE),ncol=10)) library(car)  do.call(cbind,lapply(x1,function(x) x<-recode(x,"0:127.5=-1;127.6:255=1"))) # X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 #[1,] -1  1 -1 -1 -1  1  1 -1  1  -1 #[2,]  1 -1  1 -1 -1 -1  1 -1  1   1

Re: [R] Finding a max

2012-11-21 Thread Bert Gunter
On Wed, Nov 21, 2012 at 9:51 AM, Rui Barradas wrote: > Hello, > > You're complicating what is simple: Fortune? (Well, it's a profound truism that we all should live by -- but I leave it to others to judge whether it meets Fortunes criteria). -- Bert > > > prop3$effort[which.max(prop3$Low)] # F

Re: [R] Finding a max

2012-11-21 Thread Rui Barradas
Hello, You're complicating what is simple: prop3$effort[which.max(prop3$Low)] # First maximum of Low prop3$effort[which.max(prop3$High)] # Ditto, of High which.max(prop3$Low) # Row number that maximizes Low which.max(prop3$High) # Row number that maximizes High Hope this helps, Rui Barr

[R] Help: is there a R Package for L1-regression (not regression with L1-penalty)

2012-11-21 Thread Chee Chen
Dear All, Is there a R package for L1-regression (meaning, optimize the sum of absolute deviations, NOT TO BE UNDERSTOOD as regression with L1-penalty) ? Any information will be appreciated. Regards, Chee [[alternative HTML version deleted]] __

Re: [R] Scaling values 0-255 -> -1 , 1 - how can this be done?

2012-11-21 Thread Rainer Schuermann
x <- as.data.frame( matrix( 0:255, nrow = 16 ) ) ifelse( x > 127.5, 1, -1 ) Is that what you want? Rgds, Rainer On Wednesday 21 November 2012 10:32:49 Brian Feeny wrote: > > I have a dataframe in which I have values 0-255, I wish to transpose them > such that: > > if value > 127.5 value = 1

Re: [R] installing Rmpi on centos 6 with mpich

2012-11-21 Thread Marc Schwartz
On Nov 21, 2012, at 11:36 AM, Ricardo Román Brenes wrote: > i've followed that guide already to no success That installation guide shows the installation taking place from the CLI outside of R, using R CMD INSTALL ..., not using install.packages() from within an R session, which is what you

Re: [R] Help with loop

2012-11-21 Thread Rui Barradas
Hello, If I understand it well, this might avoid a loop. dat <- read.table(text=" Salt time 1 35.65114 2003-07-19 2 35.64226 2003-07-20 3 35.62411 2003-07-21 4 35.62473 2003-07-22 5 35.65893 2003-07-23 6 35.70140 2003-07-24 7 35.62157 2003-07-25 8 35.64122 2003-07-26 9 35.63515 2

Re: [R] installing Rmpi on centos 6 with mpich

2012-11-21 Thread Ricardo Román Brenes
i've followed that guide already to no success On Wed, Nov 21, 2012 at 11:34 AM, Marc Schwartz wrote: > > On Nov 21, 2012, at 10:40 AM, Ricardo Román Brenes > wrote: > > > Hello everyone > > > > im trying to install Rmpi library on centos 6. I have already installed > > mpich2 1.4 > > > > [root@

Re: [R] installing Rmpi on centos 6 with mpich

2012-11-21 Thread Marc Schwartz
On Nov 21, 2012, at 10:40 AM, Ricardo Román Brenes wrote: > Hello everyone > > im trying to install Rmpi library on centos 6. I have already installed > mpich2 1.4 > > [root@localhost ~]# R --version >> R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" >> Copyright (C) 2012 The R Foundat

Re: [R] help with if statement

2012-11-21 Thread Rainer Schuermann
Does A$TIME <- ifelse( A$TIME >= 24, A$TIME + 24, A$TIME ) what you want? Rgds, Rainer On Wednesday 21 November 2012 09:05:39 york8866 wrote: > Hi all, > > I had a dataset A like: > > TIME DV > 0 0 > 1 10 > 520 > 24 30 > 36 80 > 48 60 > 72 15 > > I would like to add 24 to those

Re: [R] Create BATCH file

2012-11-21 Thread Suzen, Mehmet
Try this: http://stat.ethz.ch/R-manual/R-patched/library/utils/html/BATCH.html On Wed, Nov 21, 2012 at 11:58 AM, R_Antony wrote: > Hi, > > I have a ".R" file written many functions into that. My requirement what is, > i need to create a batch file for this. > No idea, how to create it. Tried it

Re: [R] help with if statement

2012-11-21 Thread Sarah Goslee
Use ifelse(). ifelse(A$TIME >= 24, A$TIME + 24, A$TIME) Please in the future use dput() to provide your data, and explain what "did not work" means. Sarah On Wed, Nov 21, 2012 at 12:05 PM, york8866 wrote: > Hi all, > > I had a dataset A like: > > TIME DV > 0 0 > 1 10 > 520 > 24 30 > 3

Re: [R] lists as matrix cells ?

2012-11-21 Thread Sarah Goslee
A matrix may only contain one data type. By not specifying when you created m, it was filled with logical values of NA. A logical value can't hold a list. You can see that with str(m) which returns: > str(m) logi [1:3, 1:2] NA NA NA NA NA NA - attr(*, "dimnames")=List of 2 ..$ : chr [1:3] "Ro

Re: [R] Scaling values 0-255 -> -1 , 1 - how can this be done?

2012-11-21 Thread Sarah Goslee
fakedata <- data.frame(matrix(sample(1:255, 50, replace=TRUE), ncol=5)) ifelse(fakedata > 127.5, 1, -1) Sarah On Wed, Nov 21, 2012 at 10:32 AM, Brian Feeny wrote: > > I have a dataframe in which I have values 0-255, I wish to transpose them > such that: > > if value > 127.5 value = 1 > if valu

Re: [R] Scaling values 0-255 -> -1 , 1 - how can this be done?

2012-11-21 Thread Marc Schwartz
On Nov 21, 2012, at 9:32 AM, Brian Feeny wrote: > > I have a dataframe in which I have values 0-255, I wish to transpose them > such that: > > if value > 127.5 value = 1 > if value < 127.5 value = -1 > > I did something similar using the "binarize" function of the biclust package, > this tr

[R] Finding a max

2012-11-21 Thread Ignacio Martinez
My data looks like this: X Y1(X) Y2(X) i want to find the values of x that maximize Y1 and Y2. Right now I'm getting the answer but I would like to know if there is a more efficient/elegant way of doing this. This code reproduces what I'm doing: [code] prop3<-structure(list(effort = c(0, 0.00898

[R] help with if statement

2012-11-21 Thread york8866
Hi all, I had a dataset A like: TIME DV 0 0 1 10 520 24 30 36 80 48 60 72 15 I would like to add 24 to those values higher than 24 in the TIME column. I did the following: If (A$TIME>=24) { A$TIME <- A$TIME+24} It did not work. How should I do it? Thanks, -- View this messag

[R] installing Rmpi on centos 6 with mpich

2012-11-21 Thread Ricardo Román Brenes
Hello everyone im trying to install Rmpi library on centos 6. I have already installed mpich2 1.4 [root@localhost ~]# R --version > R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" > Copyright (C) 2012 The R Foundation for Statistical Computing > ISBN 3-900051-07-0 > Platform: x86_64-redha

[R] Help with loop

2012-11-21 Thread Hefri
Hi, I have used R for some time, but managed to avoid writing loops. But this time I am afraid there is no way around it. I have a dataframe with time and salinity (see below). I would like to extract the time intervals where salinity changes by less than 0.05. So using the values below this wo

Re: [R] Creating a frequency table for binomial varaible

2012-11-21 Thread arun4
Thank you Bill Dunlap . This seems very simple. -- View this message in context: http://r.789695.n4.nabble.com/Creating-a-frequency-table-for-binomial-varaible-tp4650286p4650312.html Sent from the R help mailing list archive at Nabble.com. __ R-help

[R] installing Rmpi on centos 6 with mpich

2012-11-21 Thread Ricardo Román Brenes
Hello everyone im trying to install Rmpi library on centos 6. I have already installed mpich2 1.4 [root@localhost ~]# R --version > R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" > Copyright (C) 2012 The R Foundation for Statistical Computing > ISBN 3-900051-07-0 > Platform: x86_64-redha

Re: [R] Creating a frequency table for binomial varaible

2012-11-21 Thread arun4
Thank you A.K Btw in which package count() is available? -- View this message in context: http://r.789695.n4.nabble.com/Creating-a-frequency-table-for-binomial-varaible-tp4650286p4650305.html Sent from the R help mailing list archive at Nabble.com.

[R] Scaling values 0-255 -> -1 , 1 - how can this be done?

2012-11-21 Thread Brian Feeny
I have a dataframe in which I have values 0-255, I wish to transpose them such that: if value > 127.5 value = 1 if value < 127.5 value = -1 I did something similar using the "binarize" function of the biclust package, this transforms my dataframe to 0 and 1 values, but I wish to use -1 and 1

[R] lists as matrix cells ?

2012-11-21 Thread Asis Hallab
Dear R experts, since more or less half a year I am using R. In many of my computations I construct huge matrices. Often I do so using 'cbind' on named lists: do.call( 'cbind', list( "Column_A"=list("Row_one"=1.0, "Row_two"=2.0, "Row_three"=3.0), "Column_B"=list("Row_one"=4.0, "Row_two

Re: [R] creat an interactive graph

2012-11-21 Thread R. Michael Weylandt
I'd use ggplot2 and combine geom_bar() and coord_polar() Google the LearningR blog and find the consultant's chart entry. Michael On Wednesday, November 21, 2012, Henry Smith wrote: > Hello! > > Does anyone get any idea how to generate a following graph by using R? > > > http://www.fastcodesign

Re: [R] Stepwise analysis with fixed variables

2012-11-21 Thread PIKAL Petr
Hi I am not at all an expert in step. From the help page I inferred that step(lm1, scope=list(lower=~Catholic)) keeps Catholic in model. So something like step(RegModel, direction ="backward",scope=list(lower=~sex+height)) shall leave those two in a model. AFAIK there is no parameter alpha i

Re: [R] Stepwise analysis with fixed variables

2012-11-21 Thread Marc Schwartz
On Nov 21, 2012, at 6:41 AM, Einat wrote: > These are my questions: > > 1. For example, if this is my code: > >> RegModel = > lm(glucose~sex+BMI+height+weight+education+ses,weight=w_without_non_response) >> summary(RegModel) >> step(RegModel, direction ="backward",scope=list(lower=?,upper=?)

Re: [R] Creating a frequency table for binomial varaible

2012-11-21 Thread William Dunlap
> I know that the simple R function table() will do this, but I am afraid > that some times I may get zero frequency for some particular values Make a factor out of your data, specifying all the levels you want counts for, and pass that factor to table(). E.g., > x <- rep(0:6, c(5,2,0,3,0

Re: [R] Weighted least squares

2012-11-21 Thread Martyn Byng
Hi, That message usually means that an unknown argument has been supplied to the function. In this case you have spelt weights incorrectly. Best wishes Martyn -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of rbowman16 Sent: 21 Nov

Re: [R] dúvidas com matriz de correlação e covariancia

2012-11-21 Thread Rui Barradas
Olá É melhor escreveres em inglês, esta lista é anglófona. As for your file, r-help doesn't like attachments, use ?dput instead: dput( head(dados, 30) ) # paste the output of this in a post Hope this helps, Rui Barradas Em 21-11-2012 11:03, alanaro...@sapo.pt escreveu: > Bom dia eu chamo-me An

  1   2   >