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

2012-11-15 Thread Jeff Newmiller
?subset --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#..

Re: [R] R.dll Reference Guide?

2012-11-15 Thread Prof Brian Ripley
On 14/11/2012 23:10, BayesForever wrote: Is there a reference guide to the complete set of functions and their arguments that are available in the R.dll library for Windows, i.e. the set of functions that includes Rf_initEmbeddedR and Rf_endEmbeddedR listed in section 8.2.2 of the Writing R

Re: [R] Replacing string in matrix with zero

2012-11-15 Thread Nick Duncan
Dear Rolf, You are of course quite right, however I wish the diagonal to be ignored by setting the value to zero. The inf was just recognising the flow value from self to self. A very fair point though. Best, Nick On 15 November 2012 04:10, Rolf Turner rolf.tur...@xtra.co.nz wrote: On 15/11/12

[R] Function for extracting Lambda Sets

2012-11-15 Thread Nick Duncan
Dear All, I would like to extract Lambda Sets from a binary matrix that represents a social network. The calculation of Lambda Sets is set out in Borgatti 1990 (which can be downloaded freely). The package SNA goes part of the way with the function MaxFlow but does not have the Lambda

[R] Extracting list names within a looped function

2012-11-15 Thread Gaj Stan (BIGCAT)
Hello all, I have the following problem: 1) A list was defined as 'a' a - list(var1=c(100:1), var2=c(1:100), var3=rnorm(100)) 2) a function 'foo' was defined that extracts the variable name assigned to x using the deparse(substitute()) functionality. This name will then be used within the

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

2012-11-15 Thread Berend Hasselman
On 15-11-2012, at 11:14, Gaj Stan (BIGCAT) wrote: Hello all, I have the following problem: 1) A list was defined as 'a' a - list(var1=c(100:1), var2=c(1:100), var3=rnorm(100)) 2) a function 'foo' was defined that extracts the variable name assigned to x using the

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

2012-11-15 Thread Gaj Stan (BIGCAT)
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 want to analyze several datasets in a similar fashion and stored all data as

Re: [R] Getting information encoded in a SAS, SPSS or Stata command file into R.

2012-11-15 Thread Anthony Damico
What I do not understand is how SAS knows where the variables begin and end. I managed to break off a little hunk of the beginning of my file and look at it in an editor, and it is numbers without any obvious delimiters. Is the delimiter a particular numeric string? I thought the SAS command

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

2012-11-15 Thread maxbre
I want to get access to the code of an S4 method in order to possibly modify a function to accomplish my particular needs: in my case the function in is cenfit() from the package NADA Now, given my reproducible example: my.ex-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072), LR =

Re: [R] R exponential regression

2012-11-15 Thread PIKAL Petr
Hi your model f - function(x,a,b) {a * I(x^b)} can be expressed as log(a)+b*log(x) and for that it shall result in straight line and you can use lm for estimate of b and log(a) It is also better to use 1:33 instead of 1980:2012 Based on values you get from linear realation you can set

Re: [R] heatmap with symbols

2012-11-15 Thread Jean V Adams
Use the col= argument to the heatmap() function to specify the three colors you want. For example: x - matrix(rnorm(50), ncol=5) heatmap(x, col=1:3) Jean furor furor1...@gmail.com wrote on 11/14/2012 03:31:42 AM: Hi all, I've made a heatmap using '-', '=' and '+' as

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

2012-11-15 Thread Sarah Goslee
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 * result$mean) } No need to change anything in

Re: [R] Send Email from R

2012-11-15 Thread R_Antony
THE ERROR WAS : ERROR: compilation failed for package 'base64' Problem is with version. Any idea, how can we do this without any packages ? - Thanks Antony. -- View this message in context: http://r.789695.n4.nabble.com/Send-Email-from-R-tp4645565p4649585.html Sent from the R help

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

2012-11-15 Thread arunkumar1111
Hi I'm trying to install R-2.15.2 in Unix environment and when i run ./configure i'm getting the following error configure: error: --with-x=yes (default) and X11 headers/libs are not available. i just unzip .tar file and ran ./configure. I'm not able to get x11() anywhere. Please help me

[R] correct use with fligner test

2012-11-15 Thread gaiarrido
Hi R users, Iwant to run a model, but want to know previously if my data present homoscedascity: the model is something like this: glm(ax~a*b*c*d) I´ve found four different ways to test for homoscedascity, but i want to know which is correct: 1.-fligner.test(glm(x~a*b*c*d)) 2.-

[R] combine similar variables in chart

2012-11-15 Thread Marcella
I want to make a chart on variables which are taken in 2 different years on 2 the same locations, at different depths, where for every location the species and the amount of species are determined. The first chart I want to make is to see how much of every species is collected in total in a bar

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

2012-11-15 Thread David Romano
Hi everyone, I have a data frame one of whose columns is a character vector and the rest are numeric, and in debugging a script, I noticed that an ifelse call seems to be coercing the character column to a numeric column, and producing unintended values as a result. Roughly, here's what I tried

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

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

[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

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]

[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] 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

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] 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,

[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,

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

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] 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

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

[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

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

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) stan@maastrichtuniversity.nl 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

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

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 *

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

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 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] 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

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,

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 # $ col3: num 

[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

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] 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

[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,place)

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 nilson...@gmail.com To:

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] 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 the

Re: [R] RMySQL install on windows

2012-11-15 Thread Gabor Grothendieck
On Thu, Nov 15, 2012 at 7:49 AM, sbarandiaran sbaran...@gmail.com 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

[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

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

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 =

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,zebra) val-c(21,45,78,6,18,77,89,17,28)

[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] 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

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

[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] 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

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

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

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

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

[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

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 murdoch.dun...@gmail.comwrote: 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

Re: [R] combine similar variables in chart

2012-11-15 Thread Jean V Adams
You've included three I wants 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

[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

[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

[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! --

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) # = 13

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 Sample

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,

[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

[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:

[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

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]

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 dush...@mcmaster.ca 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

[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 ~

[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 am

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

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,

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

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 you

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] 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 tmrs...@gmail.com 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

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 viera...@gmail.com wrote: Hello R-help team, I seek your help (for what is most likely a very simple problem). I'm

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, 1] -

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 lag on a

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 =

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

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

[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) ???

[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

[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':

[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,

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(formula =

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] 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 farnoosh...@yahoo.com wrote: Hi , I want to apply the following code fo my data with 400 predictors. I was wondering if there ia

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] 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

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

  1   2   >