[R] TWS and R

2012-11-15 Thread abcd1234
Hi all, The TWS on my system is unable to connect to my R session. Here is the error that I'm getting: /> tws<-twsConnect() Error in socketConnection(host = host, port = port, open = "ab", blocking = blocking) : cannot open the connection In addition: Warning message: In socketConnection(host =

Re: [R] lubridate concatenation issue

2012-11-15 Thread Peter Ehlers
On 2012-11-15 18:36, Andre Zege wrote: I took a look at Hadley's lubridate which seems a very neat package, but i am having a small problem with concatenating lubridates to build vectors of it. Namely when function c( ) is applied to lubridate seems to change time to a local timezone in this

Re: [R] Dealing with factors ???

2012-11-15 Thread Berend Hasselman
On 16-11-2012, at 03:18, eric wrote: > The table is much bigger than what was shown. I just displayed a few rows. > Seems like there should be a better way that the approach you are proposing. > What is also not clear to me is why the factors are coming at all. I do a > read.csv on a table full o

Re: [R] Dealing with factors ???

2012-11-15 Thread Jeff Newmiller
Your numeric data appears to have commas (thousands separators) in it. You don't say where you got the data, but Excel does this, and if this is the case then a straightforward way to fix it is to load it in Excel and set the formatting of all numeric columns to "general" before saving again. Y

Re: [R] Code works, but not as function.

2012-11-15 Thread Peter Langfelder
On Thu, Nov 15, 2012 at 5:48 PM, Benjamin Ward (ENV) wrote: > Hi, > > I have some values in a list format generated by the following: > Path_Number <- 0010 > ID.Path <- formatC(0001:Path_Number, width=4, flag=0) # Make vector of ID's. > No_of_Effectors <- sample(1:550, length(ID.Path), replace=TRU

[R] lubridate concatenation issue

2012-11-15 Thread Andre Zege
I took a look at Hadley's lubridate which seems a very neat package, but i am having a small problem with  concatenating lubridates to build vectors of it. Namely when function c( )  is applied to lubridate seems to change time to a local timezone in this particular case changing the date to pre

[R] Code works, but not as function.

2012-11-15 Thread Benjamin Ward (ENV)
Hi, I have some values in a list format generated by the following: Path_Number <- 0010 ID.Path <- formatC(0001:Path_Number, width=4, flag=0) # Make vector of ID's. No_of_Effectors <- sample(1:550, length(ID.Path), replace=TRUE) # Define Number of Effectors each individual gets. Effectors <- spli

[R] Dealing with factors ???

2012-11-15 Thread eric
I have a data frame x that came from read.csv. It seemed to read in ok but then I tried doing some plotting of the values and ran into difficulties. The plot command seems to be plotting factors instead of the values. How do I get rid of these factors ? The plot command I use is : plot (x$dat, x$T

[R] R-Square in WLS

2012-11-15 Thread frespider
Hi, I am fitting a weighted least square regression and trying to compute SSE,SST and SSReg but I am not getting SST = SSReg + SSE and I dont know what I am coding wrong. Can you help please? xnam <-colnames(X) # colnames Design Matrix

Re: [R] Dealing with factors ???

2012-11-15 Thread eric
The table is much bigger than what was shown. I just displayed a few rows. Seems like there should be a better way that the approach you are proposing. What is also not clear to me is why the factors are coming at all. I do a read.csv on a table full of numbers from excel and I'm seeing factors eve

[R] Split data frame and create a new column

2012-11-15 Thread Zlatan
I need to split a data frame into 3 columns. The column I want to split contains indices of lag (prefix L1 or L2 and suffix 01, 03, 04), station name (shown in the sample data as capitalized G, P and S) and pollutant name. Names with no “L” prefix or 01/04 suffix are lag 0. Lag 01 is average of lag

[R] Creating dates to plot

2012-11-15 Thread eric
I have a dataframe that looks like this: head(x) Period AP AlMA BB All 1 200812 903,231 1,985,460 905,422 3,312,088 7,106,201 2 200901 880,491 1,924,111 892,980 3,006,050 6,703,631 3 200902 883,994 1,926,169

Re: [R] additive interaction for a dichotomous dependent variable (i.e. risk difference)

2012-11-15 Thread sarahw
Did you ever get a response to this or resolve this yourself? Many thanks! -- View this message in context: http://r.789695.n4.nabble.com/additive-interaction-for-a-dichotomous-dependent-variable-i-e-risk-difference-tp4635842p4649687.html Sent from the R help mailing list archive at Nabble.com

Re: [R] problem with XML package

2012-11-15 Thread Duncan Temple Lang
Hi Arvin 2.9.2 is very old. 2.13 is still old. Why not upgrade to 2.15.*? However, the problem is that you the object you are passing to xmlName() is NULL. This will give an error in the latest version of the XML package and most likely any version of the XML package. I imagine the structure

Re: [R] strip.custom() with more than one conditioning variable

2012-11-15 Thread ilai
dotplot(variety ~ yield | year+ site, barley, strip = function(...,which.given,factor.levels) { if(which.given==2){ strip.default(which.given,factor.levels=substr(levels(barley$site), 1, 1),style=4,...) } else{ strip.default(which.given=which.given,factor.levels=factor.levels,s

Re: [R] strip.custom() with more than one conditioning variable

2012-11-15 Thread p_connolly
Thanks Duncan, but it's of no use. It still leaves space for two strips and doesn't use the first one. I don't actually want a style = 4. I used it as an example of when a factor.levels vector might be wanted. In my case I want a vector of expressions which can't be made factor levels. If I d

Re: [R] Adding two different factors to one observation?

2012-11-15 Thread arun
Hi, If you want to convert from the first way to the second way suggested by Jean: dat1<-read.table(text="  Obs. dishes  1   saucer  2   cup  2   saucer  3 cup  4  plate  ",sep="",header=TRUE,stringsAsFactors=TRUE) library(reshape2) dat2<-dcast(dat1,Obs.~dishes,value.var="Obs.")  dat2[,2:4]<-ifel

Re: [R] Selecting the "non-attribute" part of an object

2012-11-15 Thread Jonathan Dushoff
Thanks for all of these useful answers. Thanks also to Ben Bolker, who told me offline that c() is a general way to access the "main" part of an object (not tested). I also tried: > identical(matrix(tm), matrix(tmm)) [1] TRUE which also works, but does _not_ solve the problem Rolf warns about b

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

2012-11-15 Thread Jose Iparraguirre
Always look at the help page. If you type, in this case, ?scatterplot, you'll see that all you need to add is the argument smooth=FALSE to omit the loess line. Jose From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of nprause [n

Re: [R] assigning NULL to a list element without changing the length of the list

2012-11-15 Thread arun
HI, You could try these: tmp1<-list(a=1,b=NA,c=3,d=NA)  lapply(tmp1,function(x) if(is.na(x)) NULL else x)  #changing NA to NULL #$a #[1] 1 # #$b #NULL # #$c #[1] 3 # #$d #NULL #other case; tmp2<-list(a=1,b=3,c=4,d=5)  #want to change list elements "a", "c" to NULL tmp3<-lapply(tmp2,function(x) {

Re: [R] Step-wise method for large dimension

2012-11-15 Thread R. Michael Weylandt
Probably you just want Y ~ . where "." means everything which doesn't appear elsewhere in the formula. Michael On Thu, Nov 15, 2012 at 8:45 PM, farnoosh sheikhi wrote: > > > Hi , > > I want to apply the following code fo my data with 400 predictors. > I was wondering if there ia an alternative

Re: [R] Selecting the "non-attribute" part of an object

2012-11-15 Thread Rolf Turner
I think that what you are looking for is: all.equal(tm,tmm,check.attributes=FALSE) But BEWARE: m <- matrix(1:36,4,9) mm <- matrix(1:36,12,3) all.equal(m,mm,check.attributes=FALSE) gives TRUE!!! I.e. sometimes attributes really are vital characteristics. cheers,

Re: [R] Stepwise

2012-11-15 Thread arun
Hi, May be this helps: set.seed(232) mat1<-matrix(sample(1:100,80,replace=TRUE),ncol=8) #with 8 columns dat1<-data.frame(mat1)  names(dat1)[1]<-"Y"  form1<-as.formula(paste("Y~",paste(names(dat1)[2:8],collapse="+"))) #should change "8" to "400" fit.final<-lm(form1,data=dat1) fit.final #Call: #lm

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

2012-11-15 Thread nprause
scatterplot() is autogenerating a regression and loess line. I want to remove the loess line, but can only find samples for how to add it. I definitely do not have code that adds it (see below), so I am puzzling... scatterplot(Aroused ~ anxious | group, data=data, xlab="Aroused",

[R] Error when launching rJava

2012-11-15 Thread Roman Wigger
Hi all I'd like to launch rJava but get that error: library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/home/cloudera/R/x86_64-redhat-linux-gnu-library/2.15/rJava/libs/rJava.so': libjvm.s

[R] problem with XML package

2012-11-15 Thread Torus Insurance
Hi List, I have used XML in R version 2.9.2. The code is working fine using Rv2.9.2 and its related XML package. Now I am using Rv2.13.1 and its related XML package, but I get the following error: Error in UseMethod("xmlName", node) : no applicable method for 'xmlName' applied to an object of c

[R] Step-wise method for large dimension

2012-11-15 Thread farnoosh sheikhi
Hi , I want to apply the following code fo my data with 400 predictors. I was wondering if there ia an alternative way instead of typing 400 predictors for the following code. I really appreciate your help. fit0<-lm(Y~1, data= mydata) fit.final<- lm(Y~X1+X2+X3+.+X400, data=mydata) ??? step

Re: [R] cluster analysis in R

2012-11-15 Thread Jose Iparraguirre
Have a look at the package mclust. Jose From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Ingmar Visser [i.vis...@uva.nl] Sent: 15 November 2012 21:10 To: KitKat Cc: r-help@r-project.org Subject: Re: [R] cluster analysis in R D

Re: [R] create function to solve derivative

2012-11-15 Thread Rolf Turner
On 16/11/12 02:40, e-letter wrote: Readers, A data set comprises A B C 10 6 .2 20 7 .4 30 8 .16 40 9 .0256 My requirement is to obtain the derivative for values of A with respect to B, create a function in R and plot this derivative again

Re: [R] strip.custom() with more than one conditioning variable

2012-11-15 Thread Duncan Mackay
Hi Patrick Not sure what you finally want to achieve but will this do? I have reduced the size of the text to make them readible dotplot(variety ~ yield | year+ site, barley, strip = strip.custom(which.given = 2, style = 4, factor.levels = paste(levels(bar

Re: [R] Can you have a by variable in Lag function as in SAS

2012-11-15 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of ramoss > Sent: Thursday, November 15, 2012 11:56 AM > To: r-help@r-project.org > Subject: [R] Can you have a by variable in Lag function as in SAS > > Hello, > > I want to use l

Re: [R] how to create a 95 percent confidence interval using the diference of the mean using Bootstrap

2012-11-15 Thread Rui Barradas
Hello, Try the following. ?boot::boot x <- scan(text=" 4 69 87 35 39 79 31 79 65 95 68 62 70 80 84 79 66 75 59 77 36 86 39 85 74 72 69 85 85 72") y <- scan(text=" 62 80 82 83 0 81 28 69 48 90 63 77 0 55 83 85 54 72 58 68 88 83 78 30 58 45 78 64 87 65") diffmeans <- function(x, i) mean(x[i,

Re: [R] Installing R on Ubuntu

2012-11-15 Thread Suzen, Mehmet
Try Prof. Wilkinson's recent blog entry: http://darrenjw.wordpress.com/2012/11/10/keeping-r-up-to-date-on-ubuntu-linux/ On Thu, Nov 15, 2012 at 5:14 PM, Karel van Duijvenboden wrote: > Hello R-help team, > > I seek your help (for what is most likely a very simple problem). I'm new > to Ubuntu a

Re: [R] how to view source code of a function inside a package?

2012-11-15 Thread Suzen, Mehmet
It might be a C code wrapped around. -m On Thu, Nov 15, 2012 at 8:21 PM, C W wrote: > Dear list, > I am trying to look at the function inside a package. I know that > methods() would do the trick, but what if the function is hidden? I have a > problem displaying the hidden function. > > Say, fo

Re: [R] Selecting the "non-attribute" part of an object

2012-11-15 Thread William Dunlap
all.equal() will give some details on the differences between your objects. If you don't care that some attribute will differ, either ignore all.equal's output concerning it or remove it before giving the object to all.equal. E.g., if you don't care about dimnames but do care about dimensions do

Re: [R] survreg & gompertz

2012-11-15 Thread David Winsemius
On Nov 15, 2012, at 5:38 AM, Matthias Ziehm wrote: > Hi all, > > Sorry if this has been answered already, but I couldn't find it in the > archives or general internet. A Markmail/Rhelp search on: gompertz survreg ...brings this link to a reply by Terry Therneau. Seems to address everything

Re: [R] depmixS4 prediction

2012-11-15 Thread Ingmar Visser
Dear EJ, The depmixS4 package has no forecasting or predict functions, but as you note, the forecast distribution is a relatively straightforward function of the parameters. The posterior function provides you with the probability distribution over the states at the end of your sequence and the tr

Re: [R] cluster analysis in R

2012-11-15 Thread Ingmar Visser
Dear KitKat, After installing R and reading some introductory material on getting started with R you may want to check the CRAN task view on cluster analysis: http://cran.r-project.org/web/views/Cluster.html which has many useful references to all kinds and flavors of clustering techniques, hierar

Re: [R] assigning NULL to a list element without changing the length of the list

2012-11-15 Thread William Dunlap
tmp0 <- list(a=1, b=2, c=3) tmp0["b"] <- list(NULL) # single [, list(NULL), not double [[ and bare NULL str(tmp0) # List of 3 # $ a: num 1 # $ b: NULL # $ c: num 3 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:

[R] assigning NULL to a list element without changing the length of the list

2012-11-15 Thread Gonçalo Ferraz
Hi, I have a list: tmp0 <- list(a=1, b=2, c=3) And I realize that I can append a NULL element to the end of this list, just by writing: length(tmp0) <- 4 Now, the question is, how can I assign NULL to one of the existing list elements without changing the length of the list? Please note I a

[R] strip.custom() with more than one conditioning variable

2012-11-15 Thread p_connolly
Suppose I wanted to plot the barley data like this: dotplot(variety ~ yield | year+ site, barley, strip = strip.custom(style = 4)) The factor levels are far too long for that to be useful. I can overcome that problem if I shorten the levels like this: dotplot(variety ~ yield

Re: [R] Selecting the "non-attribute" part of an object

2012-11-15 Thread Bert Gunter
max(abs(x-y)) < numerical tolerance of your choice -- Bert On Thu, Nov 15, 2012 at 11:52 AM, Jonathan Dushoff wrote: > I have two matrices, generated by R functions that I don't understand. > I want to confirm that they're the same, but I know that they have > different attributes. > > If I wa

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread arun
HI, But, this replace second column NAs to 1.  May be, the na.replace() should be applied to df1[,-1] df1<-read.table(text=" col1 col2 col3 A   15.5   8.5 A   8.5    7.5 A   NA NA B   8.0   6.0 B   NA NA B   9.0   10.0 ",sep="",header=TRUE,stringsAsFactors=FALSE) df2<-df1[,-1] na.replace

[R] how to create a 95 percent confidence interval using the diference of the mean using Bootstrap

2012-11-15 Thread Tania Patiño
Hello all, could you please tell me how to create a 95 percent confidence interval using R, if I have the next data: > blue [1] 4 69 87 35 39 79 31 79 65 95 68 62 70 80 84 79 66 75 59 77 36 86 39 85 74 [26] 72 69 85 85 72 > red [1] 62 80 82 83 0 81 28 69 48 90 63 77 0 55 83 85 54 72 58 68 88

[R] Selecting the "non-attribute" part of an object

2012-11-15 Thread Jonathan Dushoff
I have two matrices, generated by R functions that I don't understand. I want to confirm that they're the same, but I know that they have different attributes. If I want to compare the dimnames, I can say > identical(attr(tm, "dimnames"), attr(tmm, "dimnames")) [1] FALSE or even: > identical(d

[R] cluster analysis in R

2012-11-15 Thread KitKat
I have two issues. 1-I am trying to use morphology to identify gender. I have 9 variables, both continuous and categorical. I was using two-step cluster analysis in SPSS because two-step could deal with different types of variables. But the output tells me that an animal is in cluster 1 or 2, it

Re: [R] 'scan' in a script?

2012-11-15 Thread yofiffy
It looks like you are trying to use the scan function to pause some script being called with the source function until you provide user input. To do this, you need to specify the argument file="stdin" when scan runs inside a process. EG scan(file='stdin', nmax=1). In my Linux terminal, at least,

Re: [R] Importing Data for a two sample t-test

2012-11-15 Thread arun
Hi, Not sure why you wanted to separate A and B for a two sample t-test. dat1<-read.table(text=" weights  company 1  A 2  A 2  B 3  B ",sep="",header=TRUE,stringsAsFactors=FALSE)  t.test(weights~company,data=dat1) #    Welch Two Sam

Re: [R] Switch "Groups" in ehplot (x-axis)

2012-11-15 Thread DusanP
Hello Peter, I checked for the "levels()" and "reorder()", but I can't make it work. R classifies the "Groups" (factor) by alphabetical order, but I would just like to make him understand that it is ordered (is.ordered()) in my data frame. Here is my code : abs1<-spleen*p1*p2*cd8 length(abs1) #

[R] Changing start and end in a time serie

2012-11-15 Thread Laura Catalina Echeverri Guzmán
Hello everyone, I have a time serie created with the function ts(), starting in 2006/01 and ending in 2011/01. If I want to use the same data of the firsts two years of that serie in a new one that starts and ends in years later, say 2012/01 and 2013/12, how can I do it? Thanks in advance! -- La

[R] R KNN Regression Help

2012-11-15 Thread bonjovi
Hi Experts,I'm writing up my thesis on open source data mining at the moment and I have to do some simple R experiments; however, I have very little experience with R.. And I am hoping one of you can please help me out:)I need need to run a regression task that uses the KNN algorithm with k = 5 and

[R] confidence intervals with glmmPQL

2012-11-15 Thread Sally_roman
Hi - I am using R version 2.13.0. I have run several GLMMs using the glmmPQL function to model the proportion of fish caught in one net to the total caught in both nets by length. I started with a polynomial regression full model with three length terms: l, l^2, and l^3 (l=length). The length te

Re: [R] combine similar variables in chart

2012-11-15 Thread Jean V Adams
You've included three "I want"s in your message, but no question. Are you looking for functions? Try searching ... in R, on google, on http://rseek.org/, ... Have you tried some code, but can't get it to work? Send your code with error messages, and tell us precisely what you trying to get yo

Re: [R] how to view source code of a function inside a package?

2012-11-15 Thread C W
thanks all. The mcmc:::foo is exactly what I am looking for. On Thu, Nov 15, 2012 at 2:35 PM, Duncan Murdoch wrote: > On 15/11/2012 2:21 PM, C W wrote: > >> Dear list, >> I am trying to look at the function inside a package. I know that >> methods() would do the trick, but what if the function

[R] Can you have a by variable in Lag function as in SAS

2012-11-15 Thread ramoss
Hello, I want to use lag on a time variable but I have to take date into consideration ie I don't want days to overlap ie: I don't want my first time of today to match my last time of yeterday. In SAS I would use : data x; set y; by date tim; previous=lag(tim); if first.date then d

Re: [R] Adding two different factors to one observation?

2012-11-15 Thread Jean V Adams
Florian, There are a number of different ways to handle data like this. Two that come to my mind are shown below. You could allow each observation to be represented by multiple rows in the data frame: obs dishes 11 saucer 22cup 32 plate 42 saucer 53cup 63

Re: [R] Optimizing

2012-11-15 Thread Sam Asin
Hey, It's actually not homework, what gave you that impression? I graduated in May and studied Math, economics, and international relations, so I don't have much of a programming background. This is a project that I'm working on out of personal interest. Obviously, I've tried doing some homewor

Re: [R] how to view source code of a function inside a package?

2012-11-15 Thread Sarah Goslee
This is R FAQ 7.40, and that document gives some good pointers: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-access-the-source-code-for-a-function_003f I prefer to simply download the source code version of the package from CRAN, so that comments aren't stripped, but there are several oth

Re: [R] how to view source code of a function inside a package?

2012-11-15 Thread Duncan Murdoch
On 15/11/2012 2:21 PM, C W wrote: Dear list, I am trying to look at the function inside a package. I know that methods() would do the trick, but what if the function is hidden? I have a problem displaying the hidden function. Say, for example the MCMC package. How do you view the code of that

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread soon yi
#Data df<-data.frame(id=letters[1:10],var1=rnorm(10,10,5),var2=rnorm(10,5,2),var3=rnorm(10,1,1)) #Missing df$var1[2]<-df$var2[c(2,6)]<-df$var3[c(2,5)]<-NA na.replace<-seq(1:ncol(df))-1 df[,names(df)]<-sapply(1:dim(df)[2], function(ii) {ifelse(is.na(df[,ii]),na.replace[ii],df[,ii])} ) David Ro

[R] how to view source code of a function inside a package?

2012-11-15 Thread C W
Dear list, I am trying to look at the function inside a package. I know that methods() would do the trick, but what if the function is hidden? I have a problem displaying the hidden function. Say, for example the MCMC package. How do you view the code of that function? something like this: >

Re: [R] Compraring two independent samples

2012-11-15 Thread Peter Ehlers
On 2012-11-15 10:17, David Arnold wrote: Hi, In my reading of pairing means of two independent samples, I read statements such as the standard error of the meanof X1 minus the mean of X2 is the square root of s1^2/n1+s2^2/n2. Then I read: "We could now derive the two independent samples confide

Re: [R] Importing Data for a two sample t-test

2012-11-15 Thread Peter Ehlers
On 2012-11-14 20:52, nilsonern wrote: I am trying to do a two sample t-test with data that i received in a text document. one list has the slab weights and the second has the company it is associated with. here is an example. weights company 1 A 2 A 2

[R] Compraring two independent samples

2012-11-15 Thread David Arnold
Hi, In my reading of pairing means of two independent samples, I read statements such as the standard error of the meanof X1 minus the mean of X2 is the square root of s1^2/n1+s2^2/n2. Then I read: "We could now derive the two independent samples confidence interval and test statistic. However, a

Re: [R] merge dataframes with condition

2012-11-15 Thread jim holtman
Is this what you want: > animal<-c("bear","bear","lion","monkey","fish","monkey","bear","zebra","zebra") > val<-c(2,42,67,5,12,9,87,1,12) > place<-c("S","N","N","Z","R","O","E","I","Q") > df1<-data.frame(animal,val,place) > animal<-c("bear","bear","lion","monkey","fish","monkey","bear","zebra","ze

Re: [R] Can't see what i did wrong..

2012-11-15 Thread Jessica Streicher
Guess it has something t do with the values in prob.model. The classifiers with bad predicitons have positive values and the ones with good predictions have negative values. On 15.11.2012, at 17:18, Jessica Streicher wrote: > I'll try .. lets see > > dput(dframe) > structure(list(PC1 = c(-112.

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread William Dunlap
Replace your NA's column by column, not all at once. In your first example, of the form ifelse(condition, numbers, data.frame) the second and third arguments are replicated to the length of the first. A data.frame's length is the number of columns it has, so ifelse repeats its columns, not

[R] Installing R on Ubuntu

2012-11-15 Thread Karel van Duijvenboden
Hello R-help team, I seek your help (for what is most likely a very simple problem). I'm new to Ubuntu and tried to install R using the Ubuntu Software Center. However, after clicking the install command, I always get prompted with the error " Failed to download package files --- check your intern

Re: [R] RMySQL install on windows

2012-11-15 Thread Gabor Grothendieck
On Thu, Nov 15, 2012 at 7:49 AM, sbarandiaran wrote: > Uwe, I set the variable with single backslashes, but the output remains the > same. The last part reads: > > "gcc -m64 -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o > RS-MySQL.o C:\Program Files\MySQL\MySQL Server 5.5/bin/libmysql.d

[R] Adding two different factors to one observation?

2012-11-15 Thread Florian Ahrweiler
In a data frame, I would like to assign two or more factors to one observation. Is it possible? If so, how? Example: In the variable $ dishes, there are several levels: "cup", "plate", "saucer". In my first observation, I see a saucer only. But in the second one, I see a cup and a saucer. In

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread Stendera, Sonja, Dr.
Hi everyone, please put me off that list!!! The unsubscribe function does not function... THANKS!!! BW Sonja -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von David Romano Gesendet: 15 November 2012 12:19 An: r-help@r-project

Re: [R] Importing Data for a two sample t-test

2012-11-15 Thread arun
HI, If you need to separate into two datasets,  dat1[dat1$company=="A",] #  weights company #1   1   A #2   2   A #or  dat1[dat1$company=="B",] #or split into a list  split(dat1,dat1$company) A.K. - Original Message - From: nilsonern To: r-help@r-project.org Cc:

[R] merge dataframes with condition

2012-11-15 Thread Geophagus
Hi @ all, I wamnt to combine two dataframes including a condition. I have two dataframes like the following: animal<-c("bear","bear","lion","monkey","fish","monkey","bear","zebra","zebra") val<-c(2,42,67,5,12,9,87,1,12) place<-c("S","N","N","Z","R","O","E","I","Q") df1<-data.frame(animal,val,plac

[R] finding the lowest which is not an outlier

2012-11-15 Thread przemek
Hello, If I have a series of numbers, and I want to find the level (the lowest value) on which each series is becam significant in the meaning of of frequency. In other words, how to find the value of lowest point (number) which is not an outlier? Thanks in advance Przemek -- View this messa

Re: [R] Confidence intervals in Ripley's K function - a little challenge...

2012-11-15 Thread AMFTom
Sorry - CSR = Complete Spatial Randomness. -- View this message in context: http://r.789695.n4.nabble.com/Confidence-intervals-in-Ripley-s-K-function-a-little-challenge-tp4649392p4649597.html Sent from the R help mailing list archive at Nabble.com.

[R] Stepwise regression scope: all interacting terms (.^2)

2012-11-15 Thread Mark Ebbert
Dear Gurus, Thank you in advance for your assistance. I'm trying to understand scope better when performing stepwise regression using "step." I have a model with a binary response variable and 10 predictor variables. When I perform stepwise regression I define scope=.^2 to allow interactions be

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread arun
Hi, df1<-read.table(text=" col1 col2 col3 A   15.5   8.5 A   8.5    7.5 A   NA NA B   8.0   6.0 B   NA NA B   9.0   10.0 ",sep="",header=TRUE,stringsAsFactors=FALSE)  str(df1) #'data.frame':    6 obs. of  3 variables: # $ col1: chr  "A" "A" "A" "B" ... # $ col2: num  15.5 8.5 NA 8 NA 9 # $

Re: [R] Can't see what i did wrong..

2012-11-15 Thread Jessica Streicher
I'll try .. lets see dput(dframe) structure(list(PC1 = c(-112.131127281872, -116.596689350263, -128.974817313418, 1196.74257699487, 1216.80975908625, -162.017759589637, -85.3191578683763, -130.528496524968, -6.27985683466795, -110.832877061623, -127.466759201992, -106.169095838249, -135.615623

Re: [R] GUI Development reg

2012-11-15 Thread Bert Gunter
Vijayan: Choose one or both from the following. 1. You don't . R is a programming language that you learn. Read the Intro to R Tutorial to start learning. 2. See the R GUI page on CRAN here: http://www.sciviews.org/_rgui/ There are several GUI's available for R and you can choose one that suits

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread Bert Gunter
David: You seem to be getting lost in basic R tasks. Have you read the Intro to R tutorial? If not, do so, as this should tell you how to do what you need. If so, re-read the sections on indexing ("["), replacement, and NA's. Also read about character vectors and factors. -- Bert On Thu, Nov 15,

Re: [R] How to modify a S4 function (in the package NADA)

2012-11-15 Thread maxbre
Ok, this is my finally (hopefully) clean session my.ex<-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072), LR = c(FALSE, FALSE, TRUE, FALSE, TRUE, FALSE)), .Names = c("TEC","LR"), row.names = c(NA, -6L), class = "data.frame") library("NADA") xx<-with(my.ex, cenfit(TEC,LR)

Re: [R] using ifelse to remove NA's from specific columns of a data frame containing strings and numbers

2012-11-15 Thread David Romano
Thanks for the suggestion, Bert; I just re-read the introduction with particular attention to the sections you mentioned, but I don't see how any of it bears on my question. Namely -- to rephrase: What constraints are there on the form of the "yes" and "no" values required by ifelse? The introd

Re: [R] problem in fitting model in NLS function

2012-11-15 Thread U30A J C Nash
Bad scaling will waste a lot of everyone's time. I put the data in a data frame mdat, then library(nlmrt) mdat<-read.csv("muzzamil.csv", header=T) fmn <- nlxb(y~a * (x^b), data=mdat, start=c(a=1,b=1), trace=T) fm <- nls(y~a * (x^b), data=mdat, start=c(a=1,b=1), trace=T) fmn2 <- nlxb(y~a2 * ((x-1

Re: [R] Can't see what i did wrong..

2012-11-15 Thread Sarah Goslee
Hi Jessica, Talking may help you, but it's kind of a waste of time for the thousands of readers of R-help unless you provide a reproducible example and full context. We'd like to help, but can't without adequate information. Sarah On Thu, Nov 15, 2012 at 9:48 AM, Jessica Streicher wrote: > Now

Re: [R] Extracting list names within a looped function

2012-11-15 Thread Ista Zahn
Hi Stan, On Thu, Nov 15, 2012 at 6:02 AM, Gaj Stan (BIGCAT) wrote: > Hello Berend, > > Thanks for your quick response. > > I am aware of the names() function, but this is not the answer to my > question, since it will not work within the foo function. > > Let me try to explain it again! (: > > I

Re: [R] Multiple groups barplot

2012-11-15 Thread michele caseposta
Hi Jim, thanks again for your support. Yes, I meant the subject codes; I will add a new variable and set the color to white all over. Thanks, Michele On Nov 15, 2012, at 1:13 AM, Jim Lemon wrote: > On 11/15/2012 07:21 AM, michele caseposta wrote: >> Back again. >> Is there a quick way to add the

[R] hessian fails for box-constrained problems when close to boundary?

2012-11-15 Thread Matthieu Stigler
Hi I am trying to recover the hessian of a problem optimised with box-constraints. The problem is that in some cases, my estimates are very close to the boundary, which will make optim(..., hessian=TRUE) or optimHessian() fail, as they do not follow the box-constraints, and hence estimate the func

Re: [R] configure: error: --with-x=yes (default) and X11 headers/libs are not a

2012-11-15 Thread Prof Brian Ripley
On 15/11/2012 14:28, Sarah Goslee wrote: Then you need to install the x11 headers for your Unix (linux?) system. I can't tell you what or how without knowing more about your particular setup. But note that the manual does cover a lot of the possibilities. From the INSTALL file: 'The main sour

Re: [R] Send Email from R

2012-11-15 Thread Prof Brian Ripley
On 15/11/2012 11:49, R_Antony wrote: We had no context. This is R-help, not a Nabble forum. THE ERROR WAS : "ERROR: compilation failed for package 'base64'" Problem is with version. Any idea, how can we do this without any packages ? Does searching not work for you? ??email returned util

Re: [R] How to modify a S4 function (in the package NADA)

2012-11-15 Thread Martin Morgan
On 11/15/2012 06:10 AM, Sarah Goslee wrote: Hi, Your reproducible example isn't reproducible for me, as I get an error message. But regardless, the easiest thing to do is write your own wrapper, something like: mycenfit <- function(x, y) { result <- cenfit(x, y) c(result, sum = result$n

Re: [R] Can't see what i did wrong..

2012-11-15 Thread Jessica Streicher
Now i let it run for one specific set and got the same bad result, then i deactivated the probabilities and got a good result, then i activated the probabilities again and got a good result .. huh??? On 15.11.2012, at 15:32, Jessica Streicher wrote: > Its not scaling.. so.. > > I guess i'll s

[R] Can't see what i did wrong..

2012-11-15 Thread Jessica Streicher
with pred.pca<-predict(splits[[i]]$pca,trainingData@samples)[,1:nPCs] dframe<-as.data.frame(cbind(pred.pca,class=isExplosive(trainingData,2))); results[[i]]$classifier<-ksvm(class~.,data=dframe,scaled=T,kernel="polydot",type="C-svc", C=C,kpar=list(degree=degree,scale=scale,offset=

Re: [R] How to modify a S4 function (in the package NADA)

2012-11-15 Thread Sarah Goslee
Thanks for the clarification, Martin. Since I couldn't reproduce the example, I didn't get to see what was actually being returned (and was, admittedly, too lazy to dig through the help). > library(NADA) > my.ex<-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072), LR = + c(0L, 0L, 1L,

Re: [R] How to modify a S4 function (in the package NADA)

2012-11-15 Thread maxbre
sorry sarah you are right, my fault, this is the correct reproducible example (a misinterpretation of LR type occurred in previous reproducible example) my.ex<-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072 ), LR = c(FALSE, FALSE, TRUE, FALSE, TRUE, FALSE)), .Names = c("TEC", "LR

Re: [R] configure: error: --with-x=yes (default) and X11 headers/libs are not a

2012-11-15 Thread Sarah Goslee
Then you need to install the x11 headers for your Unix (linux?) system. I can't tell you what or how without knowing more about your particular setup. By far the easiest thing to do if you're not familiar with compiling your own software, headers and such, is to install the binary for your linux d

[R] SVM? Comparison method wanted: 3 Groups, Microarray data

2012-11-15 Thread Peter Kupfer
Dear all, i have microarray data of 3 classes of patients. It's not a time course experiment only steady state. I used a rule-based method to classify the groups by the expression of the genes. This works out so far. Nevertheless I want to check my results with an other method. Therefore I look

Re: [R] Can't see what i did wrong..

2012-11-15 Thread Jessica Streicher
Its not scaling.. so.. I guess i'll stay severely frustrated, and yes i know this is probably not enough information for anyone to help. Still, talking helps ;) On 15.11.2012, at 15:15, Jessica Streicher wrote: > with > > pred.pca<-predict(splits[[i]]$pca,trainingData@samples)[,1:nPCs] > dfra

[R] survreg & gompertz

2012-11-15 Thread Matthias Ziehm
Hi all, Sorry if this has been answered already, but I couldn't find it in the archives or general internet. Is it possible to implement the gompertz distribution as survreg.distribution to use with survreg of the survival library? I haven't found anything and recent attempts from my side wer

Re: [R] RMySQL install on windows

2012-11-15 Thread sbarandiaran
Uwe, I set the variable with single backslashes, but the output remains the same. The last part reads: "gcc -m64 -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:\Program Files\MySQL\MySQL Server 5.5/bin/libmysql.dll -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/Rcompil

Re: [R] Extracting list names within a looped function

2012-11-15 Thread Marcella Meerkerk
No this doesn't seem like what I want. As you can see in the dataset sometimes there are the same species on different locations. First I want to make a chart on how many of a single species there are in this dataset and preferrably for all species in one chart. Second I want to make such a chart

  1   2   >