Re: [R] 3D plot

2010-02-19 Thread Jim Lemon
On 02/19/2010 03:43 AM, David A.G wrote: Dearl list, can anyone point me to a function or library that can create a graph similar to the one in the following powerpoint presentation? http://bmi.osu.edu/~khuang/IBGP705/BMI705-Lecture7.ppt (pages 36-37) In order to try to explain the graph, t

Re: [R] Deleting colmuns with 0's and also writing multple csv files

2010-02-19 Thread DarioAustralia
Hi Anna, A column with all 0s will have a column sum of zero. So do this : dataset1[, which(colSums(dataSet1 > 0))] If you have a list of data.frames you could do this for(index in 1:10) { write.csv(yourListOfTables[[index]], file = paste("Dataset", index, ".csv", sep = ""), row.names

[R] Date label lost while inverting y axis.

2010-02-19 Thread Jeremie Smaga
Good morning, I am currently displaying a time series with the time on the Y axis, and the values on the X axis. The problem is that I wanted to reverse the Y axis (that is, to have the latest date the closest to the X axis). So I looked for a way to do this on this mailing list and I found a resp

[R] How to use same function for diffrent input values

2010-02-19 Thread Madhavi Bhave
Dear R helpers   I have written some function (the actual code I have pasted at the end of mail) like say   indiv_rate = function(n, rate_name, rate, rate_rf1, rate_rf2, rate_rf3, rateprob1, rateprob2, rateprob3) { some R commands   return(data.frame(rate_name, rates = round(rate_data, d

[R] Underlay Mapoutlines with Googlemapspictures

2010-02-19 Thread Malte Christian
Hello, i created a picture with the outlines of mosambik. Does anyone now, how i could mack a background the outlines with a map from mosambik from googlemaps? library(maps) library(mapdata) library(akima) map("worldHires", "Moz") regads Malte _

Re: [R] Deleting colmuns with 0's and also writing multple csv files

2010-02-19 Thread K. Elo
Hi! Right, my solution did not take into accound paired negative values summing up to zero. This should work in all cases: df[, which(colSums(df!=0)!=0)] Kind regards, Kimmo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] How to use same function for diffrent input values

2010-02-19 Thread Barry Rowlingson
On Fri, Feb 19, 2010 at 8:20 AM, Madhavi Bhave wrote: > rates = indiv_rate(n = read.csv('number.csv')$n, rate_name = > read.csv('rate.csv')$rate_name, rate = read.csv('rate.csv')$rate, rate_rf1 = > read.csv('rate_rf.csv')$rate_rf1, > rate_rf2 = read.csv('rate_rf.csv')$r

Re: [R] problem with multiple plots (mfrow, mar)

2010-02-19 Thread Jim Lemon
On 02/19/2010 04:10 AM, Peter Neuhaus wrote: Dear R-users, I often stack plots that have the same x-axis. To save space and have the plots themselves as large as possible I like to minimize the margins between the plots to zero. I use the "mfrow" and "mar" parameters to achieve this. However, t

Re: [R] Use of R in clinical trials

2010-02-19 Thread Dieter Menne
Bert, I like your comments. There is one issue, however, that drives me crazy whenever I meet a customer asking "You are not using SAS? Too bad, we need validated results." Bert Gunter wrote: > > ... > Also to reiterate, it's not only > statistical/reporting functionality but even more the int

Re: [R] ellipsis-related error: used in an incorrect context, no ... to look in

2010-02-19 Thread lith
Does nobody have an advice concerning that problem? If it is a FAQ, I'd appreciate a pointer to a discussion of this issue. With the docs accessible to me, I wasn't able to solve that problem. >     require(lattice) >     f.barchart <- function(...) { >         barchart(..., >             panel =

[R] Quadprog help

2010-02-19 Thread Araujo-Enciso, Sergio Rene
I am having some problems using Quadprog in R. I want to minimize the objective function : 200*P1-1/2*10*P1^2+100*P2-1/2*5*P2^2+160*P3-1/2*8*P3^2+50*P4-1/2*10*P4^2+50*P 5-1/2*20*P5^2+50*P6-1/2*10*P6^2, Subject to a set of constrains including not only the variables P1, P2, P3, P4, P5, P6,

[R] Error using update.packages

2010-02-19 Thread Göran Broström
I'm updating packages by $ sudo R --vanilla . > update.packages() when I (finally) get the error message: Error in unloadNamespace(pkg_name) : name space 'survival' is still used by: 'eha' * removing '/usr/local/lib64/R/library/survival' * restoring previous '/usr/local/lib64/R/library/sur

[R] How to specify R CMD INSTALL arguments

2010-02-19 Thread Patrick Connolly
I've become a bit rusty using R CMD INSTALL from the shell prompt since the install.packages normally works so well. One of the arguments to R CMD INSTALL is --configure-args=ARGS >From looking at the rsprng package's configure file, it would seem that I need to be able to get this line to work:

[R] Update RMySQL and ... it's no more running

2010-02-19 Thread PtitBleu
Hello, I updated the RMySQL (and DBI) package but, since, it doesn't run anymore. I followed the advices given here http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL but with no success. I also copied the libMySQL.dll in the bin directory of R. Also no good result. The error message (in french

Re: [R] Error message when using error.bars(x,add=TRUE)

2010-02-19 Thread Peter Ehlers
On 2010-02-18 8:22, fussel wrote: Hey hey, I`m analyzing a data set containing the element contentrations of various samples... I wanted to construct notched boxplots and got quite ugly results for some of the boxplots. The notches are often larger then the hinges which resulted in weird looking

Re: [R] ellipsis-related error: used in an incorrect context, no ... to look in

2010-02-19 Thread Felix Andrews
The problem is related to the processing of the 'groups' argument, which is subject to non-standard evaluation. The groups argument is substitute()d and evaluated in a special context ('data' etc). But this gets messed up if you are not passing the symbol directly. The work-around is to rewrite the

[R] Plotting multiple table automatically

2010-02-19 Thread KennyL
Hi All, I have a slight issue getting R to plot a series of tables automatically. Essentially I have a series of tables that I wish to plot. They are named on_2, on_3 etc. based on the file name when they were read in. I have filelist <- list.files() to give me list of the table names. I wish to

Re: [R] Plotting multiple table automatically

2010-02-19 Thread Jim Lemon
On 02/19/2010 10:32 PM, KennyL wrote: Hi All, I have a slight issue getting R to plot a series of tables automatically. Essentially I have a series of tables that I wish to plot. They are named on_2, on_3 etc. based on the file name when they were read in. I have filelist<- list.files() to give

Re: [R] Underlay Mapoutlines with Googlemapspictures

2010-02-19 Thread Roger Bivand
(Note that you did not follow the posting guide - please always start a new thread/question by creating a new message - do not simply reply to an existing posting erasing the subject; such a message stays in the old thread and is hard to find in the archives) See package RgoogleMaps on your neare

Re: [R] Plotting multiple table automatically

2010-02-19 Thread Paul Hiemstra
KennyL wrote: Hi All, I have a slight issue getting R to plot a series of tables automatically. Essentially I have a series of tables that I wish to plot. They are named on_2, on_3 etc. based on the file name when they were read in. I have filelist <- list.files() to give me list of the table na

[R] dot-dot-dot as an actual argument

2010-02-19 Thread Jyotirmoy Bhattacharya
I could not find any documentation of how dot-dot-dot works when used as an argument in a function call (rather than as a formal argument in a definition). I would appreciate some references to the rules governing situations like: f1<-function(x,y,...){   print(x) } f2<-function(...){   f1(...) }

Re: [R] Plotting multiple table automatically

2010-02-19 Thread KennyL
Thanks to you both, Both methods work, I was trying to do what you have suggested earlier Paul, but got in a mess, thanks for the code I can see why it was all going wrong now! Kenny -- View this message in context: http://n4.nabble.com/Plotting-multiple-table-automatically-tp1561478p1561507.

Re: [R] dot-dot-dot as an actual argument

2010-02-19 Thread Gabor Grothendieck
It likely has to do with the fact that barchart uses unevaluated arguments. Look at its source by entering its name without arguments: barchart This does work: library(lattice) f.barchart2 <- function(...) eval.parent(substitute(barchart(...))) x <- data.frame(a = c(1,1,2,2), b = c(1,2,3,4), d

Re: [R] dot-dot-dot as an actual argument

2010-02-19 Thread Paul Hiemstra
Jyotirmoy Bhattacharya wrote: I could not find any documentation of how dot-dot-dot works when used as an argument in a function call (rather than as a formal argument in a definition). I would appreciate some references to the rules governing situations like: f1<-function(x,y,...){ print(x) }

[R] Confused about appending to list behavior...

2010-02-19 Thread Jason Rupert
Through help from the list and a little trial and error (mainly error) I think I figured out a couple of ways to append to a list. Now I am trying to access the data that I appended to the list. The example below shows where I'm trying to access that information via two different methods. I

Re: [R] Extracting values from a list

2010-02-19 Thread Paul Hiemstra
chipmaney wrote: Thanks, as a follow-up, how do i extract the list element name (ie, 4-2 or 44-1) Look at names(your_list) cheers, Paul thanks, chipper Date: Thu, 18 Feb 2010 11:56:45 -0800 From: ml-node+1560750-540257540-69...@n4.nabble.com To: chipma...@hotmail.com Subject: Re: Extracti

Re: [R] Use of R in clinical trials

2010-02-19 Thread John Sorkin
Bert, There is a lesson here. Just as intolerance of any statistical analysis program (or system) other than SAS should lead to our being drive crazy, so to should intolerance of any statistical analysis program (or system) other than R. John >>> Dieter Menne 2/19/2010 3:46 AM >>> Bert, I

[R] Rgui.exe cannot be set as default program under Vista wtih R2.10.1

2010-02-19 Thread Schmitt, H. (Heike)
Dear moderators, when I installed the latest version of R (R2.10.1) under Microsoft Vista (service pack 2), I ran into problems associating Rgui.exe with .RData files. On doubleckicking such files in explorer, they open in a Rterm window. Trying to associate Rgui.exe with the Rdata files via co

Re: [R] dot-dot-dot as an actual argument

2010-02-19 Thread lith
> I could not find any documentation of how dot-dot-dot works when used > as an argument in a function call (rather than as a formal argument in > a definition). You might also be interested in other thread regarding this problem: http://groups.google.com/group/r-help-archive/msg/5c6ea5eb593337b4

Re: [R] problem with multiple plots (mfrow, mar)

2010-02-19 Thread Peter Neuhaus
Jim Lemon wrote: Hi Peter, The two par arguments "fin" and "pin" allow a solution. What you want is for the second values in "pin" (Plot dimensions in INches) to be the same for all your plots. You can get an approximation by using the layout function instead of mfrow and setting the height v

[R] BMDP and SAS (was R in clinical trials)

2010-02-19 Thread Terry Therneau
I used both BMDP and SAS in my earlier years, side by side. At that time the BMDP statistical methods were much more mature and comprehensive: we treated them as the standard when the two packages disagreed. (It was a BMDP manual that clearly explained to me what the hypothesis of "Yate's weigh

Re: [R] Rgui.exe cannot be set as default program under Vista wtih R2.10.1

2010-02-19 Thread Dieter Menne
-- View this message in context: http://n4.nabble.com/Rgui-exe-cannot-be-set-as-default-program-under-Vista-wtih-R2-10-1-tp1561598p1561649.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat

Re: [R] Rgui.exe cannot be set as default program under Vista wtih R2.10.1

2010-02-19 Thread Dieter Menne
Schmitt, H. (Heike) wrote: > > .. > Trying to associate Rgui.exe with the Rdata files via control panel / > default programs does not work - Rgui is not added to the list of > recommended programs. > .. > When your right-click/Open With on an rdata-file in Explorer, there is a "Search" (Duch

[R] eha aftreg performance

2010-02-19 Thread Philipp Rappold
Göran, thanks for the update, I'm just about to install it! Just wanted to drop you a short line about performance (as you once requested): aftreg takes ages on my windows machine to calculate a small set of 7 observations which are not even grouped together by "id". To be a bit more precise, it

Re: [R] Update RMySQL and ... it's no more running

2010-02-19 Thread PtitBleu
Hello again, After 'googling', I set the environment variable MYSQL_HOME value to the path to MYSQL with the command below. I get a warning (is it a problem or not ???) but I managed to connect to my databases. But when I close and open again R, the connection is lost. I have to run the command

[R] Bind field of a list

2010-02-19 Thread statquant
Hello all I am new in R and so easy stuff are difficult... let say that I have a list test <- list(a=c("x","v"),b=c("n","m")) how can I without a loop get test$a bind with test$b (obviously in real life their would be many fields) Cheers and thanks -- View this message in context: http://n4.na

[R] lty dots pdf issue

2010-02-19 Thread Roger Koenker
I'm trying to redo an old plot with: > sessionInfo() R version 2.11.0 Under development (unstable) (2010-02-09 r51113) x86_64-apple-darwin9.8.0 When I do: pdf("lty.pdf",height = 6, width = 8) u <- 1:100/100 y <- matrix(rep(1:10,each = 100),100) matplot(u,y,lwd = 2,type ="l") dev.off() the l

Re: [R] Bind field of a list

2010-02-19 Thread Philipp Rappold
is this what you're looking for? test <- data.frame(a=c("x","v"),b=c("n","m")) test statquant wrote: Hello all I am new in R and so easy stuff are difficult... let say that I have a list test <- list(a=c("x","v"),b=c("n","m")) how can I without a loop get test$a bind with test$b (obviously in

Re: [R] Confused about appending to list behavior...

2010-02-19 Thread Dieter Menne
JustADude wrote: > > > ... > > By any chance is there more documentation out there on lists and this > behavior, as I would like to try to better understand what is really going > on and why one approach works and another doesn't. > > ... > Example reproduced below > You forgot an assig

Re: [R] Update RMySQL and ... it's no more running

2010-02-19 Thread PtitBleu
Just to say that I found the place to set the environment variables (Computer/Properties/Advanced/Environment variables). The warning is still there but the connection seems ok. Concerning the warning, do you think I have to install an older version of mysql ? By the way, I also copied RMySQL.dl

Re: [R] lty dots pdf issue

2010-02-19 Thread Ken Knoblauch
Roger Koenker uiuc.edu> writes: > I'm trying to redo an old plot with: > > sessionInfo() > R version 2.11.0 Under development (unstable) (2010-02-09 r51113) > x86_64-apple-darwin9.8.0 > When I do: > > pdf("lty.pdf",height = 6, width = 8) > u <- 1:100/100 > y <- matrix(rep(1:10,each = 100),100)

Re: [R] Date label lost while inverting y axis.

2010-02-19 Thread David Winsemius
On Feb 19, 2010, at 2:20 AM, Jeremie Smaga wrote: Good morning, I am currently displaying a time series with the time on the Y axis, and the values on the X axis. The problem is that I wanted to reverse the Y axis (that is, to have the latest date the closest to the X axis). So I looked

Re: [R] Bind field of a list

2010-02-19 Thread statquant
Hello, Thank you but I think not what I would like to get as an answer is the list ("x","v","n","m") + what you gave me could work for 2 fields but if I have 200... What I want is a vectorize way to do bindlists <- function(x){ output = c(); for (i in 1:length(x)) {

Re: [R] Bind field of a list

2010-02-19 Thread baptiste auguie
Hi, Try this, unlist(test) or do.call(c, test) HTH, baptiste On 19 February 2010 15:19, statquant wrote: > > Hello all > I am new in R and so easy stuff are difficult... > let say that I have a list > test <- list(a=c("x","v"),b=c("n","m")) > how can I without a loop get test$a bind with te

Re: [R] Bind field of a list

2010-02-19 Thread David Winsemius
On Feb 19, 2010, at 9:49 AM, statquant wrote: Hello, Thank you but I think not what I would like to get as an answer is the list ("x","v","n","m") + what you gave me could work for 2 fields but if I have 200... What I want is a vectorize way to do bindlists <- function(x){ outpu

Re: [R] Set Colour of Histogram Bars (lattice)

2010-02-19 Thread Dieter Menne
DarioAustralia wrote: > > > I have a bunch of histogram bars that I'd like the first to be a certain > colour, second to be another colour, third to be a third colour, and > repeat for all my 39 bars. > >> levels(forPlot$type) > [1] "Blah" "Blah 2" "Blah 3" > > trellis.par.set("plot.polygon$

Re: [R] Bind field of a list

2010-02-19 Thread statquant
Bravo baptiste it works what does do.call do exactly ?? -- View this message in context: http://n4.nabble.com/Bind-field-of-a-list-tp1561676p1561745.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list htt

Re: [R] Bind field of a list

2010-02-19 Thread Colin.Umansky
Hello, Thank you but I think not what I would like to get as an answer is the list ("x","v","n","m") + what you gave me could work for 2 fields but if I have 200... What I want is a vectorize way to do bindlists <- function(x){ output = c(); for (i in 1:length(x)) {

[R] order two dataframes by an integer column from either data frame

2010-02-19 Thread Paul Rigor (ucla)
Hi, I'm an R nooob! So please pardon this easy question! I have two data frames that share a common column, data1.name and data2.name. How would I be able to order the other based on an integer column from either data frame? For example, how do I order data2 based on data1.age? Or data1 based

Re: [R] order two dataframes by an integer column from either data frame

2010-02-19 Thread Dieter Menne
Paul Rigor (ucla) wrote: > > I have two data frames that share a common column, data1.name and > data2.name. > How would I be able to order the other based on an integer column from > either data frame? > > For example, how do I order data2 based on data1.age? Or data1 based on > data2.salary

[R] Generate Univariate Normal Mixtures???

2010-02-19 Thread vaibhav dua
Hi, I'm trying to generate a mixture from 2 univariate normal distributions and would like to put a constrained on the means (Equal) of the two distributions. Here is my shot at the code: library(nor1mix) X <- norMix(mu=c(50, 60 ), sig2=c(5,10), w=c(0.5, 0.5)) mixData <- rnorMix(1000, X) p

Re: [R] order two dataframes by an integer column from either data frame

2010-02-19 Thread Paul Rigor (gmail)
Thanks, I ended up using that method! On Fri, Feb 19, 2010 at 7:53 AM, Dieter Menne wrote: > > > Paul Rigor (ucla) wrote: > > > > I have two data frames that share a common column, data1.name and > > data2.name. > > How would I be able to order the other based on an integer column from > > eithe

Re: [R] lty dots pdf issue

2010-02-19 Thread RKoenker
Thanks Ken, that was it. I've updated to R version 2.11.0 Under development (unstable) (2010-02-18 r51149) x86_64-apple-darwin9.8.0 and everything looks fine now. Thanks too to Simon for sorting this out! Roger -- View this message in context: http://n4.nabble.com/lty-dots-pdf-issue-tp1561

Re: [R] popbio and stochastic lambda calculation

2010-02-19 Thread Shawn Morrison
That is a big help Chris - thank you very much for your assistance. I also ran your code (below) for the example in Caswell (2001, ~p300) and got matching results. I'd like to add my vote for including this method in the next version of popbio - I think it would be a very useful addition. Th

Re: [R] Update RMySQL and ... it's no more running

2010-02-19 Thread Gabor Grothendieck
If you only need it while in R you can use the RENVIRON file or the .Rprofile or Rprofile.site file. Use help in R to find more on this. environment variables can also be set through the control panel. Google to get instructions. Another possibility is the free command line Windows utility seten

[R] tiff() and antialias option

2010-02-19 Thread Andrew Yee
I was wondering if someone could help with the antialias option in tiff(). I'm running R 2.9.2 on a Linux machine. I'm working on creating a tiff file and have tried different antialias parameters, e.g. default, none, gray, and subpixel, but don't seem to be seeing a difference in the output. Or

Re: [R] svm and RMSE

2010-02-19 Thread Uwe Ligges
On 19.02.2010 01:29, Amy Hessen wrote: Hi Thank you very much for your reply. I meant I got different RMSE with different runs to the same program without any change for the dataset or the parameters of SVM. This is my code: library(e1071) readingmydata<- as.matrix(read.delim("mydataset.tx

Re: [R] R-commands for MDS

2010-02-19 Thread Uwe Ligges
On 18.02.2010 11:24, Oduor Olande wrote: Hello I am using the following command but not able to text the values on the graph can someone please make suggestions for improvement Perhaps dist.r does not have row.names(dist.r) nor colnames(dist.r)? We cannot know since we do not have dist.r.

Re: [R] tiff() and antialias option

2010-02-19 Thread Uwe Ligges
On 19.02.2010 17:44, Andrew Yee wrote: I was wondering if someone could help with the antialias option in tiff(). I'm running R 2.9.2 on a Linux machine. I'm working on creating a tiff file and have tried different antialias parameters, e.g. default, none, gray, and subpixel, but don't seem

Re: [R] crhon compile directive faul in version x64, in Intel i7?

2010-02-19 Thread Uwe Ligges
On 17.02.2010 22:13, Juan Santiago Ramseyer wrote: ==> CRASH INSTALLING PACKAGES CHRON IN: Intel(R) Core(TM) i7 CPU 860 @ 2800GHz ==> IT'S COMPILED DIRECTIVE WRONG? REGARD YOUR ATENTION ==> I RUN: SO:Linux 2.6.31.12-174.2.19.fc12.x86_64 x86_64 Fedora release 12 (Constantine) ==> AND RE

[R] inverse lexicographical ordering

2010-02-19 Thread Evgenia
Dear users, I have a matrix b as [,1] [,2] [,3] [,4] [1,]0000 [2,]0011 [3,]0101 [4,]0112 [5,]1001 [6,]1012 [7,]1102 [8,]1113 with last column the rowSums(b) I w

[R] retrieve from function

2010-02-19 Thread threshold
Hi, say I got the function: > x=function(nbr){y<-rnorm(nbr);y1 <- mean(y);plot(y)} how can I retrieve value of y1, when I need it. I don't want: > x=function(nbr){y<-rnorm(nbr);y1 <<- mean(y);plot(y)} > y1 I want someting like: "x$y1" and then I get the value Many thanks, robert -- View

[R] What is the difference between expression and quote when used with eval()?

2010-02-19 Thread blue sky
I made the following example to see what are the difference between expression and quote. But I don't see any difference when they are used with eval()? Could somebody let me know what the difference is between expression and quote? expr=expression(2*3) quo=quote(2*3) eval(expr) str(expr) class(

Re: [R] inverse lexicographical ordering

2010-02-19 Thread Daniel Malter
Hi, see the code below. Next time, please provide self-contained code to generate the matrix (read the posting guide) so that we can just copy-paste it into R to get the matrix. x=rep(c(0,1),4) y=rep(c(0,0,1,1),2) z=rep(c(0,1),each=4) m=cbind(z,y,x) w=rowSums(m) m=cbind(m,w) m m[order(w,x,y,z

Re: [R] retrieve from function

2010-02-19 Thread Ista Zahn
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] retrieve from function

2010-02-19 Thread Ista Zahn
Hi Robert, You need to modify your function to return a value. Something like x <- function(nbr){ y<-rnorm(nbr) y1 <- mean(y) plot(y) return(y1) } -Ista __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] Use of R in clinical trials

2010-02-19 Thread Marc Schwartz
On Feb 19, 2010, at 6:56 AM, John Sorkin wrote: > Bert, > There is a lesson here. Just as intolerance of any statistical analysis > program (or system) other than SAS should lead to our being drive crazy, so > to should intolerance of > any statistical analysis program (or system) other than R.

[R] Accessing values of a matrix

2010-02-19 Thread statquant
hello all, thank you for taking the time I have a matrix A that have column names (let say n columns), I want to reduce the matrix to have just a few of those column (p colums, this is trivial), but for the lines I want only the lines such that A(i,J) is part of a list (J is fixed and known) I a

Re: [R] Use of R in clinical trials

2010-02-19 Thread Bert Gunter
Gentlemen: Thankyou for your comments. I know I promised not to respond, but I just wanted to clarify something that Dieter mentioned below, not defend my remarks. I understand "validate code" per 21 CFR part 11 complance to mean that for **ANY** code that is written, be it in SAS, R, VB, or what

Re: [R] retrieve from function

2010-02-19 Thread threshold
Thank you for response. The problem is that using return(y1) in my function formula always returns y1, but what I want is to return it only when I wish, like p.value in t.test(rnorm(100),rnorm(100))$p.value robert -- View this message in context: http://n4.nabble.com/retrieve-from-function-tp15

Re: [R] Accessing values of a matrix

2010-02-19 Thread Sarah Goslee
Hi Colin, You'll get a better answer if you provide an actual example, including what you tried that didn't work. It looks to me like you want to subset a data frame based on column names, though I'm not sure what A(i, J) is supposed to be. if so, then this is one approach: > A <- data.frame(A =

Re: [R] retrieve from function

2010-02-19 Thread Henrique Dallazuanna
Try this: nbr <- 30 lapply(body(x), eval)[[grep("y1", body(x))]] On Fri, Feb 19, 2010 at 3:39 PM, threshold wrote: > > Hi, say I got the function: >> x=function(nbr){y<-rnorm(nbr);y1 <- mean(y);plot(y)} > > how can I retrieve value of y1, when I need it. > > I don't want: >> x=function(nbr){y<-r

Re: [R] Use of R in clinical trials

2010-02-19 Thread John Sorkin
Marc, A thoughtful, well reasoned discussion. I welcome this kind of analysis. (I was not criticizing Bert, I was using his post as an example of an unreasonable statement made to, but not by him, that can serve as an object lesson for all of us.) I feel unhappy about posts which attack SAS, R o

Re: [R] What is the difference between expression and quote when used with eval()?

2010-02-19 Thread Peter Dalgaard
blue sky wrote: I made the following example to see what are the difference between expression and quote. But I don't see any difference when they are used with eval()? Could somebody let me know what the difference is between expression and quote? Expressions are vectors of unevaluated express

[R] how to make R plot under Linux

2010-02-19 Thread xinwei
Hi, I am using R in Linux environment. How can i make plot in Linux just like in windows? thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.ht

Re: [R] how to make R plot under Linux

2010-02-19 Thread Ista Zahn
On 02/19/10 xin...@stat.psu.edu wrote: > Hi, I am using R in Linux environment. How can i make plot in Linux just > like in windows? There shouldn't be much difference, but we're going to need a lot more information. What version of linux, what version of R, what exactly is the problem you are h

Re: [R] multi-argument returns

2010-02-19 Thread Randall Wrong
Thanks to Patrick Burns, Bert Gunter, Steve Lianoglou, and Professor Brian Ripley. 2010/2/17 Prof Brian Ripley > On Wed, 17 Feb 2010, Randall Wrong wrote: > > Dear R users, >> >> I have multi-argument returns in a function and I am warned by the program >> they are deprecated. >> > > Defunct as

Re: [R] how to make R plot under Linux

2010-02-19 Thread Vojtěch Zeisek
On Linux You can use Rkward http://rkward.sourceforge.net/ - very nice and good graphical user interface for R. Dne Pá 19. února 2010 19:39:53 xin...@stat.psu.edu napsal(a): > Hi, I am using R in Linux environment. How can i make plot in Linux just > like in windows? > > thanks > >

Re: [R] Replicating output from a function

2010-02-19 Thread Greg Snow
The replicate function will run code multiple times and return the output as a list (or possibly something simplified). You can then use lapply, sapply, or other tools to summarize those results. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.o

[R] "Legend" question

2010-02-19 Thread Lu Wang
Hi, I want to get a histogram with the legend for my data. I drew a normal density curve and kernel density curve in the histogram, and I also label mean and median in the X axis. From the code, I got two legend: One shows "Normal Density" and "Kernel Density" and their corresponding lines, the

Re: [R] What is the difference between expression and quote when usedwith eval()?

2010-02-19 Thread Bert Gunter
> as.list(expression( 2*3)) [[1]] 2 * 3 > as.list(quote( 2*3)) [[1]] `*` [[2]] [1] 2 [[3]] [1] 3 > identical(as.list(expression( 2*3))[[1]],quote(2*3)) [1] TRUE expression() wraps the call into an expression object (as pointed out to me by Gabor Grothendieck). Bert Gunter Genentech Nonclinica

Re: [R] What is the difference between expression and quote whenusedwith eval()?

2010-02-19 Thread William Dunlap
I think of quote(something) as being equivalent to expression(something)[[1]]. eval() goes through the outermost expression layer > eval(expression(expression(noSuchFunction(noSuchValue expression(noSuchFunction(noSuchValue)) > eval(eval(expression(expression(noSuchFunction(noSuchValue))

[R] "legend" question

2010-02-19 Thread Lu Wang
Hi, Sorry to forget providing the data before. I want to get a histogram with the legend for my data. I drew a normal density curve and kernel density curve in the histogram, and I also label mean and median in the X axis. From the code, I got two legend: One shows "Normal Density" and "Kernel De

Re: [R] "legend" question

2010-02-19 Thread Sarah Goslee
I still can't tell exactly what you want, but maybe something like this? > legend(30,0.08, c("Normal density","Kernel > density"),col=c("red","blue"),lty=1:1,lwd=1:1,bty="n") > legend(30,0.06, c(paste("Mean =",round(mean(CDR3),1)),paste("Median > =",median(CDR3))),col=c("red","black"),pch=19:19,

[R] ggplot2 X axis levels

2010-02-19 Thread Felipe Carrillo
Hi all: I've done this before with factors but can't figure how to do it with a continuous variable. I am trying to reorder the sequence of my weeks along the X axis. I want to start with week 27 to 52 and then 1 to 26. I guess I could use levels along with seq() but doesn't seem to work for me. Th

Re: [R] What is the difference between expression and quote when used with eval()?

2010-02-19 Thread blue sky
On Fri, Feb 19, 2010 at 12:39 PM, Peter Dalgaard wrote: > blue sky wrote: >> >> I made the following example to see what are the difference between >> expression and quote. But I don't see any difference when they are >> used with eval()? Could somebody let me know what the difference is >> betwee

[R] Running R scripts via Java R Interface (JRI)

2010-02-19 Thread Ralf B
Hi R enthusiasts, I am using JRI which is great to run R commands from Java. (Please let me know if this is the wrong forum for those questions). Its straightforward to run single R commands via JRI, but what I really would like to do is running existing R scripts from that interface. Does any of

Re: [R] Checking the assumptions for a proper GLM model

2010-02-19 Thread Greg Snow
The best validation of assumptions is a good knowledge of the origin of your data. And with 18 bullet points below, if you do all of these every time you are going to end up with a lot of false positives when all your assumptions are met. Understanding your data so that you know which assumpti

Re: [R] Error of Stepwise Regression with number of rows in use has changed: remove missing values?

2010-02-19 Thread Greg Snow
Have you considered the implications of that solution? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Kum-Ho

[R] r help date format changes with c() vs. rbind()

2010-02-19 Thread Tim Clark
Dear List, I am having a problem with dates and I would like to understand what is going on. Below is an example. I can produce a date/time using as.POSIXct, but I am trying to combine two as.POSIXct objects and keep getting strange results. I thought I was using the wrong origin, but accord

[R] is GEE2 for continuous outcome implemented in R?

2010-02-19 Thread COURVOISIER Delphine
hi, surprisingly, I haven't found an implementation of GEE2 in R, except in the orth package but only for binary outcome. There was a post in 2004 that asked the same question: is there any package in R can do the GEE2? thanks in advance, delphine __

Re: [R] What is the difference between expression and quote whenused with eval()?

2010-02-19 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of blue sky > Sent: Friday, February 19, 2010 12:11 PM > To: Peter Dalgaard > Cc: r-h...@stat.math.ethz.ch > Subject: Re: [R] What is the difference between expression > and quote w

[R] Omitting members of a sequence

2010-02-19 Thread Stuart Luppescu
Hello, this is just a point of curiosity with me. I want a sequence of numbers from 64 to 70, omitting the 2nd and 4th numbers. I can do it these ways: > seq(64, 70)[-c(2, 4)] [1] 64 66 68 69 70 > foo <- 64:70 > foo[-c(2, 4)] [1] 64 66 68 69 70 But how come this doesn't work? > 64:70[-c(2, 4)] [

[R] plot circular histogram

2010-02-19 Thread T.D. Rudolph
In conducting studies of animal orientation and displacement, I need to produce circular histograms of angles (bearings in radians 0-2pi) where the centre of the circle indicates very few observations for a given bin of angles and outwardly concentric circles indicate greater frequencies of observ

Re: [R] retrieve from function

2010-02-19 Thread Dennis Murphy
Hi: Perhaps you want this: f <- function(nbr){ y<-rnorm(nbr) y1 <- mean(y) plot(y) list(y1 = y1) } f(100) prints out the mean and executes the plot w <- f(100) executes the plot > w$y1 [1] 0.06965205 returns the mean as a component of the object w. HTH, Dennis On Fri, Feb 19,

Re: [R] Omitting members of a sequence

2010-02-19 Thread Sarah Goslee
Order of operations. Since you didn't specify the order you wanted by using parentheses, R chose, and it wasn't what you wanted. > 64:70[-c(2, 4)] # what you said [1] 64 65 66 67 68 69 70 > (64:70)[-c(2, 4)] # what you thought you said [1] 64 66 68 69 70 > 64:(70[-c(2, 4)]) # what R thought you

Re: [R] plot circular histogram

2010-02-19 Thread Sarah Goslee
You can probably adapt stars() to give something similar to what you want. Otherwise, you need to give us examples of what you've tried and how it diverges from what you need. Sarah On Fri, Feb 19, 2010 at 4:34 PM, T.D. Rudolph wrote: > > In conducting studies of animal orientation and displace

Re: [R] plot circular histogram

2010-02-19 Thread Greg Snow
Look at the circular and CircStats packages. Look at the kernel density plots. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project

Re: [R] Omitting members of a sequence

2010-02-19 Thread Gabor Grothendieck
See ?Syntax noting from the list of operators there that : is of lower precedence than [. On Fri, Feb 19, 2010 at 4:33 PM, Stuart Luppescu wrote: > Hello, this is just a point of curiosity with me. I want a sequence of > numbers from 64 to 70, omitting the 2nd and 4th numbers. I can do it > these

[R] Print table in lme

2010-02-19 Thread Daniel
Hello, I'm trying to add lme results in a table with lm coef results, but as I know, estout or xtabel cannot support lme objects. I'm a new in R and I'll appreciate some helpful comments. -- Daniel Marcelino Phone: (647) 8910939 [[alternative HTML version deleted]]

  1   2   >