[R] Query regarding Windows based statistical software development using R as programming language

2010-09-03 Thread Soumen Pal
Hi, I am a beginner in R. I have a query as below: Is it possible to develop a Windows based statistical software (user-friendly) like SPSS using R as a programming language? Otherwise, is it possible to use R code directly (no command-line execution) in Windows based programming language such a

Re: [R] Package wavelets

2010-09-03 Thread Marize Simões
Hi, In the decomposition of the dwt When I generate the out their levels goes of the 0 to 15 in the decompositions And i like to known how i do to visualise In the out the most concern levels for me for exemple levels 7 to 14. I like to can say what levels I want visualise. Is it possible in t

Re: [R] R program google search

2010-09-03 Thread Waverley @ Palo Alto
My question is how to use R to program google search. I found this information: "The SOAP Search API was created for developers and researchers interested in using Google Search as a resource in their applications." Unfortunately google no longer supports that. They are supporting the AJAX Search

Re: [R] R program google search

2010-09-03 Thread David Winsemius
On Sep 4, 2010, at 1:20 AM, Dennis Murphy wrote: Hi: Do you mean something like RSiteSearch('loess predict') [opens up a web page with 53 matches to the request] or package(sos) findFn('multiple imputation') ? If not, could you be more specific about what you're after? One further op

Re: [R] R program google search

2010-09-03 Thread Dennis Murphy
Hi: Do you mean something like > RSiteSearch('loess predict') [opens up a web page with 53 matches to the request] or package(sos) findFn('multiple imputation') ? If not, could you be more specific about what you're after? HTH, Dennis On Fri, Sep 3, 2010 at 2:23 PM, Waverley @ Palo Alto <

[R] how to free memory? (gc() doesn't work for me)

2010-09-03 Thread Hyunchul Kim
Hi, all I have a huge object that use almost all of available memory. R> rm(a_huge_object) R> gc() doesn't free memory and ?gc doesn't show anything. Are there any suggestion? Thanks in advance, Regards, Hyunchul [[alternative HTML version deleted]]

Re: [R] Generation of uniform random numbers

2010-09-03 Thread Dennis Murphy
Hi: Here's a slightly different approach, using both mapply() in base (a la David) and mlply() in plyr. My thought was to put the arguments together into a three column data frame; the names were chosen to correspond to the first three arguments of runif(): params <- data.frame(n = as.vector(rat

Re: [R] R code output issues

2010-09-03 Thread Marcel Curlin
Thanks for the input Adding "print" took care of the first problem. The output looks like what I would expect, so I think the code is doing what I would like it to for the first 44 observations. > print(results.df) DR D.1 R.1 V1V2dif V1V4dif 1 68.92500 75.00

Re: [R] "pairs" with same xlim and ylim scale

2010-09-03 Thread Dejian Zhao
Well done! I was totally misled and trapped by the error message. Acturally the absence of "1.00" in the upper panel is an implicit indication that error occurred there. On 2010-9-3 13:02, Shi, Tao wrote: Hi Dejian, Thanks for the reply! I finally found the problem. It is actually in the "

Re: [R] R code output issues

2010-09-03 Thread jim holtman
first of all if you are 'sourcing' the file, put explicit print calls on your data frame; e.g., print(dataframe). Just because your input is 2149 lines long does not mean you results will necessarily be that long. You are using 'tapply' which will be aggregating your data. You need to provide som

Re: [R] rgl windows binary

2010-09-03 Thread Duncan Murdoch
On 03/09/2010 4:28 PM, Horace Tso wrote: Folks, the rgl 0.91 binary for windows seems corrputed. WinZip complains the downloaded zip file is not a valid archive. I had no luck with R-forge either. Could someone point me to the latest production ready binary? Why would you use WinZip? Just i

[R] R code output issues

2010-09-03 Thread Marcel Curlin
Hi all, I have a short R code file that I am using to perform calculations on a dataset. I am having a few issues with output: 1. Although my input data file is 2149 lines long, when I type "results.df" from the command line, I get the appropriate calculation results for only the first 46 rows.

Re: [R] how can I plot bar plots with all the bars (negative andpositive) in the same direction????

2010-09-03 Thread Robert Baer
It occurred to me after my initial post that you will need a little more "fixing" of your axis labels if you have data that is not trivial integers as in your example. Consider the following solution for some irrational random numbers: dat=rnorm(20) dat1=dat-min(dat) barplot(dat1,axes

[R] rmate osascript workaround for e-texteditor on windows?

2010-09-03 Thread dan . urban
First, thanks very much for making rmate available. I'm having trouble porting it to e-texteditor for windows, though, (specifically the send-line command) because osascript is mac-only. Is there a way to send selections in e-texteditor to the windows version of R.app? Thanks! Dan _

[R] R program google search

2010-09-03 Thread Waverley @ Palo Alto
Hi, Can someone help as how to use R to program google search in the R code? I know that other languages can allow or have the google search API If someone can give me some links or sample code I would greatly appreciate. Thanks. -- Waverley @ Palo Alto __

Re: [R] date conversion

2010-09-03 Thread Joshua Wiley
Hi, I think you just need to add the format = argument. Does this help? > x <- factor("01-11-2007") > as.character(x) [1] "01-11-2007" > as.Date(as.character(x), format = "%d-%m-%Y") [1] "2007-11-01" Cheers, Josh On Fri, Sep 3, 2010 at 2:11 PM, André de Boer wrote: > > Hello, > > I have a da

[R] date conversion

2010-09-03 Thread André de Boer
Hello, I have a dataframe with data such as: > dat$BEGINDATUM[3] [1] 13-09-2007 > dat$BEGINDATUM[4] [1] 01-11-2007 > class(dat$BEGINDATUM[3]) [1] "factor" Now I need to make calculation with these dates. But I get these result: > as.date(as.character(dat$BEGINDATUM[3])) [1] > as.date(as.charact

Re: [R] density() with confidence intervals

2010-09-03 Thread David Croll
Thank you very much for your help, Greg! Here's my ludicrous vision/attempt/whatever :o) ### Idea for making a density() with confidence interval ### xx <- faithful$eruptions xx.hist <- hist(xx, breaks="FD", freq=F) # plot(xx.hist$mids, xx.hist$density) # gives a rough "plot(density(xx))" out

[R] rgl windows binary

2010-09-03 Thread Horace Tso
Folks, the rgl 0.91 binary for windows seems corrputed. WinZip complains the downloaded zip file is not a valid archive. I had no luck with R-forge either. Could someone point me to the latest production ready binary? Thks. H [[alternative HTML version deleted]] __

Re: [R] how can I plot bar plots with all the bars (negative and positive) in the same direction????

2010-09-03 Thread John Kane
I believe that you will have to draw them in ggplot2 as someone mentioned or in base graphics. Here is a rough first attempt that may give you some ideas. xx <- -3:4 yy <- rep(-3,length(xx)) plot(xx,xx, type="n", xlim=c(-4, 5)) rect(xx, yy, xx+.5, xx ) ==

Re: [R] density() with confidence intervals

2010-09-03 Thread Greg Snow
Here is a simple approach that uses bootstrapping (this could probably be improved by using better bootstrap estimates and not ignoring the dependence between points): xx <- faithful$eruptions fit1 <- density(xx) fit2 <- replicate(1, { x <- sample(xx, replace=TRUE); density(x, fro

Re: [R] Package wavelets

2010-09-03 Thread stephen sefick
The package or wavelets in general? What do you want to do? 2010/9/3 Marize Simões : > > Hi user's > > Does anybody work with wavelets on R? > Please I need some help. > > Atte > Marize Simões > -- > View this message in context: > http://r.789695.n4.nabble.com/Package-wavelets-tp2526023

[R] Package wavelets

2010-09-03 Thread Marize Simões
Hi user's Does anybody work with wavelets on R? Please I need some help. Atte Marize Simões -- View this message in context: http://r.789695.n4.nabble.com/Package-wavelets-tp2526023p2526023.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] how can I plot bar plots with all the bars (negative and positive) in the same direction????

2010-09-03 Thread Robert Baer
As is often the case in R, just because you shouldn't do something, doesn't mean you can't do it. Still, I'd urge you to consider the "visual honesty" of what you propose. If you're still insistent: dat <- (-3:4) dat1=dat-min(dat) barplot(dat1,axes=FALSE) axis(2,dat1,labels=dat) Typically, ze

Re: [R] Function Gini or Ineq

2010-09-03 Thread John Kane
You installed the package but probably forgot to load the library. This works fine for me. = library(reldist) x<-c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261) G<-gini(x) ===

Re: [R] What solve() does?

2010-09-03 Thread Peng, C
If A is a squared matrix, solve(A) gives the inverse of A; if you have a system of linear equation AX=B, solve(A,B) gives the solution to this system of equations. For example: x-2y =1 -2x+3y=-3 > A=matrix(c(1,-2,-2,3), ncol=2, byrow=T) > B=c(1,-3) > > # to get the inverse of A > solve(A)

Re: [R] how can I plot bar plots with all the bars (negative and

2010-09-03 Thread Ted Harding
On 03-Sep-10 17:12:55, Zoppoli, Gabriele (NIH/NCI) [G] wrote: > Dear r-help mailing list, > > this seems stupid, but I actually don't find the solution: > > if I have a vector of numbers x of length n, ranging, say, > from -3 to 4, if I do > > barplot (x) > > all the values below 0 go downwards

Re: [R] how can I plot bar plots with all the bars (negative and positive) in the same direction????

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 1:12 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote: Dear r-help mailing list, this seems stupid, but I actually don't find the solution: if I have a vector of numbers x of length n, ranging, say, from -3 to 4, if I do barplot (x) all the values below 0 go downwards, and al

Re: [R] how can I plot bar plots with all the bars (negative and positive) in the same direction????

2010-09-03 Thread Joshua Wiley
Dear Gabriele, I suspect the reason you are having difficulty finding the solution is because barplots were meant to be anchored at 0. What information are you really trying to convey? There is probably a very clear, aesthetically pleasing way to achieve your goal without a barplot. For instanc

Re: [R] how can I plot bar plots with all the bars (negative and positive) in the same direction????

2010-09-03 Thread Peng, C
In the bar plot, the vertical axis is a numerical axis representing the frequency (the height of the vertival bar -= frequency). If you really want to have vertical bar corresponding to the negative values go downward, you need to make your own function to achieve the goal. -- View this message i

Re: [R] density() with confidence intervals

2010-09-03 Thread Peng, C
One can write an R function to produce a kernel density curve with a confidence band. See, for example, the steps of doing this in a technical report at http://fmwww.bc.edu/repec/usug2003/bsciker.pdf -- View this message in context: http://r.789695.n4.nabble.com/density-with-co

Re: [R] running an exe in the background

2010-09-03 Thread Greg Snow
?system #look at the wait parameter ?.First.lib I only checked the above for windows, you did not specify what platform you are using but referring to .exe implies windows. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 >

[R] how can I plot bar plots with all the bars (negative and positive) in the same direction????

2010-09-03 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Dear r-help mailing list, this seems stupid, but I actually don't find the solution: if I have a vector of numbers x of length n, ranging, say, from -3 to 4, if I do barplot (x) all the values below 0 go downwards, and all the positive values go upward. How can I make them all begin from the m

Re: [R] general question on binomial test / sign test

2010-09-03 Thread Greg Snow
Bert, Your null is still simple (it is your alternative that does not fit the standard), for any test statistic you just need to estimate the distribution of it under the null. If you cannot do this theoretically it is easy enough to simulate. Then all the theory around p-values still holds.

Re: [R] Function Gini or Ineq

2010-09-03 Thread Mestat
Hi Peng, I did that i installed the package RELDIST, but nothing happened. R does not recognize this function. Still looking for the solution. Thanks, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Function-Gini-or-Ineq-tp2525852p2525981.html Sent from the R help mailing l

Re: [R] Function Gini or Ineq

2010-09-03 Thread Peng, C
you need install and load package {reldist} before you call function gini(). HTH. -- View this message in context: http://r.789695.n4.nabble.com/Function-Gini-or-Ineq-tp2525852p2525966.html Sent from the R help mailing list archive at Nabble.com. __ R

Re: [R] 3d graph surface

2010-09-03 Thread Peng, C
?persp -- View this message in context: http://r.789695.n4.nabble.com/3d-graph-surface-tp2525859p2525958.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] 3d graph surface

2010-09-03 Thread Dieter Menne
Luis Felipe Parra wrote: > > Hello I have and 11 by 2 by 1200 matrix from which I would like to make a > surface graph. Check the example in the docs of surface3d or persp3d from the rgl package. Note that attachments cannot be sent to the list (pdf and a few others are the exception) Dieter

Re: [R] Making plots in big scatterplot matrix large enough to see

2010-09-03 Thread Greg Snow
Some thoughts on your question about having pairs increase the size of the device: The pairs function is fairly old (and plot even older) and fully adjustable graphics devices are actually fairly recent. I remember a time when the only way to get high quality color plots was to send the plot t

Re: [R] Function Gini or Ineq

2010-09-03 Thread Mestat
Hi Dimitris, I have already seen your code in another post. But, I would like to weight my data. So, I wish I could use the following command: gini(x, weights=rep(1,length=length(x))) Thanks anyway and I am trying to understand your gini function in order to apply a weigth. Marcio -- View this

Re: [R] Function Gini or Ineq

2010-09-03 Thread Dimitris Rizopoulos
for the Gini coefficient you can use this function: gini <- function(x, unbiased = TRUE, na.rm = FALSE){ if (!is.numeric(x)) { warning("'x' is not numeric; returning NA") return(as.numeric(NA)) } if (any(na.ind <- is.na(x))) { if (!na.rm) stop("'x'

Re: [R] 'seq' help page: seq_length -> seq_len?

2010-09-03 Thread Peter Ehlers
On 2010-09-03 2:05, Niels Richard Hansen wrote: In the Value section of the 'seq' help page it says 'seq_along' and 'seq_length' always return an integer vector. I believe it should be 'seq_along' and 'seq_len' always return an integer vector. as there are no seq_length functi

[R] 3d graph surface

2010-09-03 Thread Luis Felipe Parra
Hello I have and 11 by 2 by 1200 matrix from which I would like to make a surface graph. the first element of the first column represents the date, which means I've got 1200 dates. I would like to graph the 11 elements of the second column for each date. Does anybody know how can I do this? attache

[R] Function Gini or Ineq

2010-09-03 Thread Mestat
Hi listers, Does it necessary to install any package in order to use the GINI or INEQ functions. If I use the following command the R tells me that didn't find the GINI function. x<-c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261) G<-gini(x) Thanks in advance, Marcio -- View this

[R] density() with confidence intervals

2010-09-03 Thread David Croll
Hello R users & R friends, I just want to ask you if density() can produce a confidence interval, indicating how "certain" the density() line follows the true frequency distribution based on the sample you feed into density(). I've heard of loess.predict(loess(y ~ x), se=TRUE) which gives yo

[R] vglm help

2010-09-03 Thread choonhong ang
Hi All, I am using vglm & the fitted values is NA. As in the R documentation that for Pareto1, if the estimate of k is less than or equal to unity then the fitted values will be NA. what is NA means ? how to solve it ? how to get the k estimate ? (in the R document the estimate of alpha is f.

Re: [R] Generation of uniform random numbers

2010-09-03 Thread Gavin Simpson
Sarah, Here's a version using two nested loops: rate_number = matrix(c(5, 15, 60, 15, 5, 0, 20, 60, 20,0, 10, 20, 40, 20, 10), nrow = 5, ncol = 3) range_mat = matrix(c(6.25, 6.75, 7.25, 8.75, 9.25, 9.75, 8.5, 9, 9.5, 10.5, 11, 11.5, 4.25, 4.75, 5.25, 5.75, 6.25, 6.75), nrow = 6, ncol = 3) set.s

Re: [R] readLines and writeLines

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 8:39 AM, raje...@cse.iitm.ac.in wrote: I have a socket connection where I do -socketConnection -writeLines and then wait for the server to send data through the socket. so I have to wait on a readLines.But when I say str<-readLines(con) it executes immediately and str gets

Re: [R] general question on binomial test / sign test

2010-09-03 Thread Bert Gunter
Ah, the plot thickens! The p-value imbroglio again. I won't comment except to note that all of this so far assumes a simple null. What if you have a composite null? --e.g. My null is that the data are drawn from a normal with unknown mean and variance versus they are drawn from mixture of 2 normal

Re: [R] Interactions in GAM

2010-09-03 Thread Simon Wood
> My main doubts are: > 1.Is the use of "by" and "te" right with the negative binomial > distribution and with the binomial distribution? -- yes! These things specify the `linear predictor' of the model --- the correctness of the linear predictor does not usually depend on the response di

Re: [R] testing for emptyenv

2010-09-03 Thread Peng, C
Thanks -- View this message in context: http://r.789695.n4.nabble.com/testing-for-emptyenv-tp2432922p2525757.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

Re: [R] general question on binomial test / sign test

2010-09-03 Thread Greg Snow
Ted, I agree that we are measuring discrepancies and that large discrepancies correspond to p-values near 0 and small discrepancies correspond to large p-values. But interpreting discrepancies on a p-value scale leads more to confusion than understanding. If you are interested in the discrepa

Re: [R] How to use lm() output for systemfit() 'Seemingly unrelated regression'

2010-09-03 Thread Arne Henningsen
On 3 September 2010 12:03, zbynek.jano...@gmail.com wrote: > > I am having problem using output of lm() function for further analysing using > systemfit package. > > Basicaly, the problem s following - I generate several formulas using lm() >> fo1 <- lm(r98[,2] ~ f98[,1] + f98[,2] + ... + f98[,43]

[R] readLines and writeLines

2010-09-03 Thread raje...@cse.iitm.ac.in
Hi, I have a socket connection where I do -socketConnection -writeLines and then wait for the server to send data through the socket. so I have to wait on a readLines.But when I say str<-readLines(con) it executes immediately and str gets nothing.what do i do for this? [[alternative HT

Re: [R] Generation of uniform random numbers

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 6:32 AM, Sarah Sanchez wrote: Dear R helpers I have following dataset rate_number = matrix(c(5, 15, 60, 15, 5, 0, 20, 60, 20,0, 10, 20, 40, 20, 10), nrow = 5, ncol = 3) range_mat = matrix(c(6.25, 6.75, 7.25, 8.75, 9.25, 9.75, 8.5, 9, 9.5, 10.5, 11, 11.5, 4.25, 4.7

[R] Interactions in GAM

2010-09-03 Thread Lucia Cañas
Hello R users, I am working with the GAM to inspect the effect of some factors (year, area) and continuous variables (length, depth, latitude and longitude) on the intensity and prevalence of the common parasite Anisakis. I would like introduce interaction in my models, both "continuous variabl

Re: [R] R CMD check Package(Windows): Error in inDL(x, as.logical(local), as.logical(now), ...) :

2010-09-03 Thread raje...@cse.iitm.ac.in
After the R CMD check is done and an R CMD INSTALL is done, where does the external dll have to be?..what can i do to make it move around with the package? can I zip it with the package? if so in what folder? - Original Message - From: Duncan Murdoch To: raje...@cse.iitm.ac.in Cc: r-he

Re: [R] Generation of uniform random numbers

2010-09-03 Thread jim holtman
Try this: > result <- list() # holds the numbers for each column > for (i in seq(ncol(rate_number))){ + ans <- NULL + for (j in seq(nrow(rate_number))){ + ans <- c(ans, runif(rate_number[j, i], range_mat[j, i], range_mat[j + 1, i])) + } + result[[i]] <- ans + } > result [[

Re: [R] function to compare numbers

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 9:33 AM, Hyunchul Kim wrote: Hi, all is there a built-in function to compare two numbers? something like following function cmp <- function(x, y){ value <- 0 if (x > y){ value <- 1 }else if (x == y){ value <- 0 }else { value <- -1 } r

Re: [R] function to compare numbers

2010-09-03 Thread jim holtman
> x <- 2 > y <- 3 > ifelse(x > y, 1, ifelse(x < y, -1, 0)) [1] -1 On Fri, Sep 3, 2010 at 9:33 AM, Hyunchul Kim wrote: > Hi, all > > is there a built-in function to compare two numbers? > > something like following function > > cmp <- function(x, y){ >    value <- 0 >    if (x > y){ >        valu

Re: [R] function to compare numbers

2010-09-03 Thread Sarah Goslee
You could potentially use sign() > sign(3 - 5) [1] -1 > sign(5 - 3) [1] 1 > sign(5 - 5) [1] 0 But... this could fail when you think two numbers are equal and the computer doesn't, due to floating point precision. (Your version could fail in exactly the same way.) > x <- .3 - .2 > x [1] 0.1 > sig

Re: [R] Matrix to list

2010-09-03 Thread Henrique Dallazuanna
Try this: sapply(dat, '[', 1:max(sapply(dat, length))) On Fri, Sep 3, 2010 at 10:31 AM, Ron Michael wrote: > Thanks Henrique and Marc for your reply, both worked. > > However I need one more suggestion on from list to matrix > > dat <- vector("list", 3) > dat[[1]] <- rnorm(5) > dat[[2]] <- rnor

Re: [R] how to get row name of matrix when result is a vector

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 9:08 AM, syrvn wrote: Hi, the R code: a <- matrix (c(1,5,4,3,7,10,34,4,3,8,6,5,12,17,45,3,2,45,46,47,3,4,22,12,21), nrow=5) rownames(a) <- c("a","b","c","d","e") a a[which(a[,3] < 8), ] a[which(a[,3] < 6), ] It wasn't exactly clear and possible that you wanted only r

Re: [R] function to compare numbers

2010-09-03 Thread Ivan Calandra
Hi! Maybe something like this: x <- 2 y <- 3 #since FALSE will be converted to 0 and TRUE to 1 you can do as.numeric(x>y) as.numeric(x Hi, all > > is there a built-in function to compare two numbers? > > something like following function > > cmp<- function(x, y){ > value<- 0 > if (x>

[R] Generation of uniform random numbers

2010-09-03 Thread Sarah Sanchez
Dear R helpers I have following dataset rate_number = matrix(c(5, 15, 60, 15, 5, 0, 20, 60, 20,0, 10, 20, 40, 20, 10), nrow = 5, ncol = 3) range_mat = matrix(c(6.25, 6.75, 7.25, 8.75, 9.25, 9.75, 8.5, 9, 9.5, 10.5, 11, 11.5, 4.25, 4.75, 5.25, 5.75, 6.25, 6.75), nrow = 6, ncol = 3) > rate_

[R] How to use lm() output for systemfit() 'Seemingly unrelated regression'

2010-09-03 Thread zbynek.jano...@gmail.com
I am having problem using output of lm() function for further analysing using systemfit package. Basicaly, the problem s following - I generate several formulas using lm() > fo1 <- lm(r98[,2] ~ f98[,1] + f98[,2] + ... + f98[,43]) > fo2 <- lm(r98[,1] ~ f98[,1] + f98[,2] + ... + f98[,43]) and than

Re: [R] Matrix to list

2010-09-03 Thread Ron Michael
Thanks Henrique and Marc for your reply, both worked.   However I need one more suggestion on from list to matrix   dat <- vector("list", 3) dat[[1]] <- rnorm(5) dat[[2]] <- rnorm(15) dat[[3]] <- rnorm(3) > dat [[1]] [1] 0.7615421 0.4151374 0.6534402 1.5999338 1.4131837 [[2]]  [1]  0.7364765  2.078

Re: [R] draw a graph of the semi-partial R-squared /CAH

2010-09-03 Thread Yan leeuw
Dear r-help, > > I am using CAH. I would cut my dendogram. What is the command in R that > allows draw a graph of the semi-partial R-squared ? > I did this: d3=read.table("dd.txt", header=TRUE,dec=',',row.names='variable') don<-scale(d3, center = TRUE, scale = TRUE) #Calcul du Matrice de simi

[R] function to compare numbers

2010-09-03 Thread Hyunchul Kim
Hi, all is there a built-in function to compare two numbers? something like following function cmp <- function(x, y){ value <- 0 if (x > y){ value <- 1 }else if (x == y){ value <- 0 }else { value <- -1 } return(value) } Thanks in advance, Hyunchu

Re: [R] how to get row name of matrix when result is a vector

2010-09-03 Thread Ivan Calandra
Hi! I don't really understand your goal, but if you want to extract the row names, rownames(a[which(a[,3] < 8), ]) does it. But I think you've already tried it. Maybe it's just me... HTH Ivan Le 9/3/2010 15:08, syrvn a écrit : > Hi, > > the R code: > > a<- matrix(c(1,5,4,3,7,10,34,4,3,8,6,5,

Re: [R] how to get row name of matrix when result is a vector

2010-09-03 Thread Peng, C
R doesn't simply treat a row vector as a matrix. -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-row-name-of-matrix-when-result-is-a-vector-tp2525631p2525666.html Sent from the R help mailing list archive at Nabble.com. __ R-

Re: [R] how to get row name of matrix when result is a vector

2010-09-03 Thread syrvn
Hi, I do not understand the code right now but it does its job. Thanks a lot! Best, syrvn -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-row-name-of-matrix-when-result-is-a-vector-tp2525631p2525657.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Help on Select.list

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 8:59 AM, Ravi S. Shankar wrote: Hi David, Thank you for your response. But that wasn't what I was looking for. names=c("Ravi", "Raj","Shubha","Nivriti") select.list(names) gives a pop up with the 4 names. I just wanted in the pop up a heading (say BOYS) followed by two names

Re: [R] how to get row name of matrix when result is a vector

2010-09-03 Thread Henrique Dallazuanna
Try this: a[a[,3] < 6,, drop = FALSE] On Fri, Sep 3, 2010 at 10:08 AM, syrvn wrote: > > Hi, > > the R code: > > a <- > matrix(c(1,5,4,3,7,10,34,4,3,8,6,5,12,17,45,3,2,45,46,47,3,4,22,12,21), > nrow=5) > rownames(a) <- c("a","b","c","d","e") > a > a[which(a[,3] < 8), ] > a[which(a[,3] < 6), ] >

[R] how to get row name of matrix when result is a vector

2010-09-03 Thread syrvn
Hi, the R code: a <- matrix(c(1,5,4,3,7,10,34,4,3,8,6,5,12,17,45,3,2,45,46,47,3,4,22,12,21), nrow=5) rownames(a) <- c("a","b","c","d","e") a a[which(a[,3] < 8), ] a[which(a[,3] < 6), ] produces the following output: > a [,1] [,2] [,3] [,4] [,5] a1 10633 b5 345

Re: [R] Matrix to list

2010-09-03 Thread Henrique Dallazuanna
Try this: unclass(as.data.frame(mat)) On Fri, Sep 3, 2010 at 9:48 AM, Ron Michael wrote: > Dear all, suppose I have following matrix: > > > mat <- matrix(rnorm(25), 5) > > > > mat > [,1] [,2][,3] [,4] [,5] > [1,] 0.97056228 -1.3278509 -0.73511792 2.16506

Re: [R] Matrix to list

2010-09-03 Thread Marc Schwartz
On Sep 3, 2010, at 7:48 AM, Ron Michael wrote: > Dear all, suppose I have following matrix: > >> mat <- matrix(rnorm(25), 5) >> >> mat > [,1] [,2][,3] [,4] [,5] > [1,] 0.97056228 -1.3278509 -0.73511792 2.1650629 -0.4411997 > [2,] 0.58613700 -0.2559899 -1

Re: [R] change the type of lines and colours in interaction.plot

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 7:02 AM, Lathouri, Maria wrote: Dear all, I want to plot 8 chemical variables in the same plot. I have used the interaction.plot command: interaction.plot(speclong$Date,speclong$time2,speclong $outcome,xaxt="n",type="l",pch=20,xlab="", log="y", ylab="Concentration (ug

Re: [R] Help on Select.list

2010-09-03 Thread Ravi S. Shankar
Hi David, Thank you for your response. But that wasn't what I was looking for. names=c("Ravi", "Raj","Shubha","Nivriti") select.list(names) gives a pop up with the 4 names. I just wanted in the pop up a heading (say BOYS) followed by two names and another heading (say GIRLS) and the remaining two

[R] Matrix to list

2010-09-03 Thread Ron Michael
Dear all, suppose I have following matrix:   > mat <- matrix(rnorm(25), 5) > > mat     [,1]   [,2]    [,3]   [,4]   [,5] [1,]  0.97056228 -1.3278509 -0.73511792  2.1650629 -0.4411997 [2,]  0.58613700 -0.2559899 -1.18334248 -1.4990907  1.8138846 [3,] -1.0313  2.0227887 

Re: [R] Help on Select.list

2010-09-03 Thread David Winsemius
On Sep 3, 2010, at 3:55 AM, Ravi S. Shankar wrote: Hi R, I am using select.list names=c("Ravi", "Raj","Shubha","Nivriti") select.list(names) provides a drop down to choose one of the 4 names. However I would like to know if it is possible to create a classification something like this

Re: [R] specify the covariance matrix for random effect

2010-09-03 Thread Ben Bolker
Ben Bolker gmail.com> writes: > > Qiu, Weiyu ualberta.ca> writes: > > > > > Hi, > > > > I'm doing a generalized linear mixed model, and I currently use an > > R function called "glmm". > > If you could get by with an AR or ARMA structure then you could > use lme() with the 'correlation'

Re: [R] R CMD check Package(Windows): Error in inDL(x, as.logical(local), as.logical(now), ...) :

2010-09-03 Thread Duncan Murdoch
raje...@cse.iitm.ac.in wrote: After the R CMD check is done and an R CMD INSTALL is done, where does the external dll have to be? See my message below. ..what can i do to make it move around with the package? can I zip it with the package? if so in what folder? R isn't designed to hand

Re: [R] testing for emptyenv

2010-09-03 Thread Duncan Murdoch
Peng, C wrote: Is there a complete list of these very handy and power functions in the base R? ls("package:base") will list all the objects exported from base, but it doesn't rate them to let you know which ones are handy and which ones are a waste of space. We like to think they're all use

[R] change the type of lines and colours in interaction.plot

2010-09-03 Thread Lathouri, Maria
Dear all, I want to plot 8 chemical variables in the same plot. I have used the interaction.plot command: > interaction.plot(speclong$Date,speclong$time2,speclong$outcome,xaxt="n",type="l",pch=20,xlab="", > log="y", ylab="Concentration (ug/L)",trace.label="",col=rainbow(8)) However, what it giv

Re: [R] define colors for groups in lattice xyplot

2010-09-03 Thread geert . demeyer
Thanks to Chris and Dennis. My problem is solved although it will take some additional time before I fully understand the solution. Cheers Geert De Meyer _ Bayer BioScience N.V. BioInformation Management Zwijnaarde Company Identification Number BE042252

Re: [R] Ordering data by variable

2010-09-03 Thread Joshua Wiley
On Thu, Sep 2, 2010 at 2:33 PM, Greg Snow wrote: > Suggestion:  use the power of R. > > If x and y are independent then sorting y based on x is meaningless. > > If sorting y based on x is meaningful, then they are not independent. > > Trying to force non-independent things to pretend that they are

Re: [R] Power analysis

2010-09-03 Thread Dieter Menne
Lewis G. Dean wrote: > >> post-hoc power analysis on a Wilcoxon test. > There is a (somewhat dated) list of "why-not" papers in http://www.childrens-mercy.org/stats/size/posthoc.asp Dieter -- View this message in context: http://r.789695.n4.nabble.com/Power-analysis-tp2524729p2525333.h

Re: [R] define colors for groups in lattice xyplot

2010-09-03 Thread Dieter Menne
Geert, thanks for providing a nice example. When use see "groups" in xyplot, you should switch to the documentation (and use) panel.superpose. Which has a somewhat different philosophy (your looks more like ggplot2 would do it). The docs of panel.superpose say (tersely...) col: graphical param

Re: [R] define colors for groups in lattice xyplot

2010-09-03 Thread Dennis Murphy
Hi: The 'easy' solution is to define the colors corresponding to the genotypes directly in lattice: xyplot( result ~ time | location, data=dataset, groups=genotype, pch=19, type="b", col = c('red', 'green', 'blue')) The problem with trying to use color as a variable to 'match' to genotype is tha

Re: [R] define colors for groups in lattice xyplot

2010-09-03 Thread Chris Campbell
Hi Geert ### dataset <- data.frame ( time = rep(1:5,times=9), genotype = factor(rep(rep (c("A","B","C"),each=5),times=3 )), location= factor(rep (paste("LOC",1:3),each=15)), color = rep (rep (c("red","green","blue"),each=5),times=3 ),

[R] 'seq' help page: seq_length -> seq_len?

2010-09-03 Thread Niels Richard Hansen
In the Value section of the 'seq' help page it says 'seq_along' and 'seq_length' always return an integer vector. I believe it should be 'seq_along' and 'seq_len' always return an integer vector. as there are no seq_length function? Best, Niels -- Niels Richard Hansen

Re: [R] Using library and lib.loc

2010-09-03 Thread Martin Maechler
> "o" == omerle > on Thu, 2 Sep 2010 10:30:49 +0200 (CEST) writes: o> Hi, o> I didn't find any post on this subject so I ll ask you some advices. o> Let's say that I have two library trees. o> Number 1 is the default R library tree on path1 o> Number 2 is anoth

[R] Help on Select.list

2010-09-03 Thread Ravi S. Shankar
Hi R, I am using select.list names=c("Ravi", "Raj","Shubha","Nivriti") select.list(names) provides a drop down to choose one of the 4 names. However I would like to know if it is possible to create a classification something like this select.list(names) should give Boys Ravi

Re: [R] Why is vector assignment in R recreates the entire vector ?

2010-09-03 Thread Martin Maechler
> "NM" == Norm Matloff > on Thu, 2 Sep 2010 12:20:44 -0700 writes: NM> Tal wrote: >> A friend recently brought to my attention that vector assignment actually >> recreates the entire vector on which the assignment is performed. NM> ... NM> I brought this up in r-