[R] MCMC sampling question

2009-08-11 Thread Thomas Mang
Hello, Consider MCMC sampling with metropolis / metropolis hastings proposals and a density function with a given valid parameter space. How are MCMC proposals performed if the parameter could be located at the very extreme of the parameter space, or even 'beyond that' ? Example to express i

Re: [R] How to label and unlabel points on scatterplot with mouse pointer

2009-08-11 Thread milton ruser
Hi Hitesh, while the rigth response not arrive, you can play with: id<-1:10 x<-runif(10) y<-runif(10) plot(x,y) identify(x, y , labels = id) Try give a look on spatstat help. I am not quite sure, but may be there you can find some solution (sorry if it is not true) cheers milton On Wed, Aug 1

Re: [R] pretty display or print for data frames ?

2009-08-11 Thread Patrick Connolly
On Wed, 12-Aug-2009 at 12:38PM +0800, Leon Yee wrote: > Hi, all > > I have a question of adjusting the output of a data frame with many > columns. By default, print() will print out several columns according to > the window size, and then it scrolls down and print out left columns. > How

Re: [R] paste first row string onto every string in column

2009-08-11 Thread milton ruser
Hi Jill, Completely not elegant, but may be usefull. Of course other colleagues will solve this with 1 line command :-) cheers milton df<-read.table(stdin(), head=T, sep=",") V1,V2,V3,V4 DPA1*,DPA1*,DPB1*,DPB1* 0103,0104,0401,0601 0103,0103,0301,0402 df.new<-as.matrix(df) for (i in 2:dim(df)[

Re: [R] R help from command line

2009-08-11 Thread Patrick Connolly
On Tue, 11-Aug-2009 at 02:43PM -0500, Peng Yu wrote: |> Hi, |> |> I frequently need to open multiple help pages in R, which requires the |> start of multiple R sessions. I am wondering if there is a way to |> invoke the help page from the command line just like 'man'. If you use ESS (with Emacs)

Re: [R] Re : How to Import Excel file into R 2.9.0 version

2009-08-11 Thread Moshe Olshansky
Alternatively download the xlsReadWrite package from http://treetron.googlepages.com/ install it an proceed as in older version of R. --- On Tue, 11/8/09, Inchallah Yarab wrote: > From: Inchallah Yarab > Subject: [R] Re : How to Import Excel file into R 2.9.0 version > To: r-help@r-project.o

Re: [R] Counting the number of non-NA values per day

2009-08-11 Thread Moshe Olshansky
Try tempFun <- function(x) sum(!is.na(x)) nonZeros <- aggregate(pollution["pol"],format(pollution["date"],"%Y-%j"), FUN = tempFun) --- On Wed, 12/8/09, Tim Chatterton wrote: > From: Tim Chatterton > Subject: [R] Counting the number of non-NA values per day > To: r-help@r-project.org > Recei

[R] nominal to numeric function

2009-08-11 Thread Noah Silverman
Hi, I'm training an SVM (C-classification from e1071 library) Some of the variables in my data set are nominal. Is there some easy/automatic way to convert them to numerical representations? Thanks, -N __ R-help@r-project.org mailing list https:/

Re: [R] Chi-squared approximation may be incorrect

2009-08-11 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Nancy (?), see ?chisq.test (in particular the examples and the comment on "expected frequency" there). A rule of thumb (see any basic text book) for the chisquared approximation being okay is that the expected value in each cell is at least 5. The warning tells you that this does not hold true for

Re: [R] Problem with modifying a data frame

2009-08-11 Thread Leon Yee
Hi, this could be a simple question but I am looking into modifying a data frame using a "condition" without the need to loop over that data, would that be possible? I have tried the following x<-c(4,5,6,6,8) y<-c("a","b","b","b","c") data<-data.frame(x,y) data x y 1 4 a 2 5 b 3 6 b 4 6 b

[R] How to label and unlabel points on scatterplot with mouse pointer

2009-08-11 Thread Hitesh Singla
Dear all, How can I label/unlabel points on scatterplot with mouse pointer. As the mouse approches near to point, it should label the closest point, then unlabel when it moves away. How can I do in R? I be very thankful. Thanks and Regards, Hitesh Singla -- This message has been scanned for v

[R] runmax function only for positive numbers?

2009-08-11 Thread Jiucang Hao
Hi All, I did a google search and could not find the answer. Thus I post this message. I found runmax only work for positive numbers. x = rep(-1,10) runmax(x,3) x = rep(0, 10) runmax(x,3) for 32-bit R, i got very small numbers: 2.121996e-314 for 64-bit R, i got NaN. Is it a bug in runm

Re: [R] Help on a combinatorial task (lists?)

2009-08-11 Thread Serguei Kaniovski
Simple unlist() will not do. In case of repeated weights, unlike permutations of indices permn(1:length(w)) some permutations of weights are identical. E.g. w <- c(3,2,2), permutations of indices c(1,2,3) and c(1,3,2) are undistinguishable. I think I have corrected the algorithm, but now I s

[R] Problem with modifying a data frame

2009-08-11 Thread SNN
Hi All, this could be a simple question but I am looking into modifying a data frame using a "condition" without the need to loop over that data, would that be possible? I have tried the following > x<-c(4,5,6,6,8) > y<-c("a","b","b","b","c") > data<-data.frame(x,y) > data x y 1 4 a 2 5 b 3

[R] pretty display or print for data frames ?

2009-08-11 Thread Leon Yee
Hi, all I have a question of adjusting the output of a data frame with many columns. By default, print() will print out several columns according to the window size, and then it scrolls down and print out left columns. How can I make it print all the columns in the same line? I found o

[R] Counting the number of non-NA values per day

2009-08-11 Thread Tim Chatterton
I have a long dataframe ("pollution") that contains a column of hourly date information ("date") and a column of pollution measurements ("pol") I have been happily calculating daily means and daily maximums using the aggregate function DMEANpollution = aggregate(pollution["pol"], format(

[R] paste first row string onto every string in column

2009-08-11 Thread Jill Hollenbach
Hi, I am trying to edit a data frame such that the string in the first line is appended onto the beginning of each element in the subsequent rows. The data looks like this: > df V1 V2 V3 V4 1 DPA1* DPA1* DPB1* DPB1* 2 0103 0104 0401 0601 3 0103 0103 0301 0402 . . and what

[R] how to do model validation and calibration for a model fitted by fit.mult.impute?

2009-08-11 Thread Yu, Changhong
Dear all, I used fit.mult.impute in Dr. Harrell's Design package to fit a cox ph regression model on five imputed datasets, where all missing predictors were filled by multiple imputation using R package Mice. Are there any functions able to do bootstrapping or cross-validation for the aggregat

[R] Chi-squared approximation may be incorrect

2009-08-11 Thread SNN
Hi, I am trying to run a Chi squre test but I am getting the following message Warning messages: 1: In chisq.test(t) : Chi-squared approximation may be incorrect Does anyone what it means? your help is appreciated -- View this message in context: http://www.nabble.com/Chi-squared-approxi

[R] Generic attribute in multinom function

2009-08-11 Thread Benjamin Geckle
Hello, I try estimate a MNL model but I need one coefficient as generic. How can I get the same coefficient for all alternatives? As example Call: multinom(formula = choice ~ time + costs, data = DATA) Coefficients: (Intercept)time costs 14.79-0.28

[R] Generalized Path Seeking algorithm with R

2009-08-11 Thread Andrius.R
Hello, Has anybody tried to use Generalized Path Seeking algorithm introduced by Jerome H. Friedman and implemented using R? : http://www-stat.stanford.edu/~jhf/r-gps/GPShelp.html I have a problem using it and I hope that you could help me. I have tried to run the GPS model for penalized logisti

Re: [R] Prevent sequential repeated values in data frame column

2009-08-11 Thread Scott Sherrill-Mix
It's a pretty inefficient way to do things (e.g. 5+ iterations [20 seconds] to find a good sample) but if you're not doing this often I guess you could do something like: checkNeighborEqual<-function(x){ #assuming the final value is not infinity return(any(x==c(x[-1],Inf))) } #fake data x<-

[R] How to read and write an S4 class

2009-08-11 Thread R_help Help
Hi, I have an object in S4 class. Is there anyway that I can write to a file and read it back to R? Thank you. adschai __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-proje

Re: [R] ggplot2: override facet names in facet_wrap?

2009-08-11 Thread Ben Bolker
Thanks. I can get it to work for facet_grid (which will do for my current purposes) but am curious about whether there's a way to do the same for facet_wrap (which doesn't have a "labeller" argument)? cheers Ben hadley wrote: > > Have a look at the code and examples of label_value an

Re: [R] reading heterogeneous CSV

2009-08-11 Thread Gabor Grothendieck
This will read it in all in and then you can decide what you want to do with it: Lines <- "DISKREAD,metadata about disks MEM,metadata about memory ,observation-identifier,time,date DISKREAD,observation-identifier,data about disks MEM,observation-identifier,data about memory" DF <- read.table(

Re: [R] Smart way to sum a column in a matrix across all members in a list

2009-08-11 Thread Henrique Dallazuanna
Try this: sum(sapply(l, '[[', 'b')) On Tue, Aug 11, 2009 at 11:05 PM, R_help Help wrote: > Hi, > > I have a list that contains about 100 elements. Each element contains > the following matrix structure > > a b > 1 1 4 > 2 2 5 > 3 3 6 > > I'd like to sum column b across all elements. I'm thin

Re: [R] ggplot2: override facet names in facet_wrap?

2009-08-11 Thread hadley wickham
Have a look at the code and examples of label_value and label_both. They should suggest how to write your own labeller to do what you want. Hadey On Tue, Aug 11, 2009 at 1:44 PM, Ben Bolker wrote: > >  just a quick question (to which I suspect the answer is "no"): > does anyone know if, in the gg

[R] Smart way to sum a column in a matrix across all members in a list

2009-08-11 Thread R_help Help
Hi, I have a list that contains about 100 elements. Each element contains the following matrix structure a b 1 1 4 2 2 5 3 3 6 I'd like to sum column b across all elements. I'm thinking of using lapply or sapply but cannot get it to work. Any help would be really appreciated. Thank you. adsch

Re: [R] Is there a summary on different version of 'apply' functions? What is the meaning of the prefixes?

2009-08-11 Thread hadley wickham
You might also want to have a look at the plyr package, http://had.co.nz/plyr. This package is an attempt to standardise and make consistent the various common uses of apply and friends. Hadley On Tue, Aug 11, 2009 at 3:09 PM, Peng Yu wrote: > Hi, > > There are quiet a few different 'apply' func

Re: [R] Sorting text docs based on document meta values in tm()

2009-08-11 Thread Shad Thomas
Hi Kelvin, I'm new to R and tm myself, however here is a way that you can sort your corpus. Please keep in mind that there may be a more efficient approach -- but this will get the job done. Basically, there are three steps (in pseudo code): 1. Extract the meta data for Age into a list 2. Sor

Re: [R] Selecting/Accessing the last vector in a list of a list of data.frames

2009-08-11 Thread Benilton Carvalho
what are exactly "some operations"? if you could provide a reproducible code, it would make it easier to understand what you're trying to achieve. for example, if you were to get the means, you could do something like: theMeans <- rapply(test, mean) cheers, b On Aug 11, 2009, at 8:59 PM,

Re: [R] Selecting/Accessing the last vector in a list of a list of data.frames

2009-08-11 Thread Bryan Hanson
Thanks Henrique. I would have not thought of the syntax you suggest, though it embodies the sort of multilevel (not quite recursive) application of lapply I was thinking of. However, it returns ³test² with V2 missing, everything else intact. Strange; I can't really state in words what I think it

Re: [R] Varying x-axis labels in lattice

2009-08-11 Thread Deepayan Sarkar
On Tue, Aug 11, 2009 at 6:30 AM, Frank E Harrell Jr wrote: > Dear Group: > > I want to use lattice with a formula such as y ~ x | v to plot a data frame > in which v varies to indicate which "x" is really being plotted. I know how > to make the x-axis scales vary with the panel but is it possible t

Re: [R] R help from command line

2009-08-11 Thread Deepayan Sarkar
On Tue, Aug 11, 2009 at 12:43 PM, Peng Yu wrote: > Hi, > > I frequently need to open multiple help pages in R, which requires the > start of multiple R sessions. I am wondering if there is a way to > invoke the help page from the command line just like 'man'. If you are feeling adventurous, you mi

Re: [R] merge zoo objects contained in a list

2009-08-11 Thread Gabor Grothendieck
Can you provide something reproducible and elaborate on what "expected" means. On Tue, Aug 11, 2009 at 4:11 PM, stephen sefick wrote: > I would like to merge zoo objects that are stored in a list into one > big zoo object with one index for all of the observations. > > I have created the list (74

Re: [R] Varying x-axis labels in lattice

2009-08-11 Thread Duncan Mackay
Hi Frank May I suggest 1. ?strip.custom and get into strip.default for options 2. use the features of strip and modify to suit your requirements http://finzi.psych.upenn.edu/R/Rhelp02/archive/104004.html http://finzi.psych.upenn.edu/R/Rhelp02/archive/100977.html Regards Duncan Mackay Depart

Re: [R] Selecting/Accessing the last vector in a list of a list of data.frames

2009-08-11 Thread Henrique Dallazuanna
If I understand correctly your question, you can try something about like this: # Access all elements named 'V1' in your list lapply(test, lapply, '[', 'V1') On Tue, Aug 11, 2009 at 3:49 PM, Bryan Hanson wrote: > Hello Again R Folks: > > I¹m trying to clean up some code. Suppose I have an obj

Re: [R] metaplot in rmeta: y-axis disappears

2009-08-11 Thread David Scott
Roaman wrote: Hi, I have a problem with the metaplot-function in rmeta. After plotting a Forest Plot with "metaplot", no y-axis is shown for normal plots anymore. Does someone know, why this is and how I can solve it? Thank you in advance! Kind regards, Roman This is a guess, because we

[R] continuous-time Markov chain model with repeated measures

2009-08-11 Thread shin nakayama
Hi, Are there any way to include "repeated measures" components in Markov chain model? I am using msm package, but it doesn't allow to include repeated- measures. All I want to get is q matrix and the significance of the covariates in state transitions. Thanks

Re: [R] Is there a summary on different version of 'apply' functions?What is the meaning of the prefixes?

2009-08-11 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu > Sent: Tuesday, August 11, 2009 1:09 PM > To: r-h...@stat.math.ethz.ch > Subject: [R] Is there a summary on different version of > 'apply' functions?What is the meaning

Re: [R] Paste symbol and calculation in plot

2009-08-11 Thread Jonathan R. Blaufuss
Scott, Thanks! That works great. I appreciate the help. Jonathan - Original Message - From: "Scott Sherrill-Mix" To: "Jonathan R. Blaufuss" Cc: r-help@r-project.org Sent: Tuesday, August 11, 2009 4:18:18 PM GMT -06:00 US/Canada Central Subject: Re: [R] Paste symbol and calculation in

Re: [R] Paste symbol and calculation in plot

2009-08-11 Thread Scott Sherrill-Mix
I'm no expert at this but it seems like ?plotmath is saying to do something like: text(2,0.35,bquote(sigma==.(mySigma),list('mySigma'=round(sd(Data),digits=3 Scott Scott Sherrill-Mix Department of Microbiology University of Pennsylvania 402B Johnson Pavilion 3610 Hamilton Walk Philadelphi

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread Jim Bouldin
Yes, thanks Steve and also to everyone else for helping me clear this up. The issue was definitely the existence of other objects named X and Y that I inadvertently referred to in my command statement. Only when these objects are removed AND the data frame in question is attached, will the comman

Re: [R] Heteroscedasticity in binary logit models

2009-08-11 Thread Alfredo
You might want to check vif in the Design package. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tomas Zelinsky Sent: Tuesday, August 11, 2009 3:20 PM To: r-help@r-project.org Subject: [R] Heteroscedasticity in binary logit models

[R] re : R help from command line

2009-08-11 Thread romain . francois
Hello, I have this script in my PATH : #!/bin/env Rscript args <- commandArgs( TRUE ) if( length( args ) == 1 ){         h <- help( args ) } else if( length(args) == 2 ) {         h <- help( args[2] , package = args[1] ) } else{         stop( "usage: rman [package] functi

[R] Contrasts within ANOVA frame

2009-08-11 Thread Jun Shen
Dear all, I was trying to do some contrasts within ANOVA. I searched the archive and found a clue posted by Steffen Katzner ( http://tolstoy.newcastle.edu.au/R/help/06/01/19385.html) I have three levels for a factor names "StdLot". I just want to make three comparisons, 1 vs 2, 1 vs 3 and 2 vs 3.

Re: [R] Is there a summary on different version of 'apply' functions?What is the meaning of the prefixes?

2009-08-11 Thread Bert Gunter
?help.search help.search("apply") Problem is, various packages have added their own apply-type functions; so what you get depends on what packages you have downloaded. Bert Gunter Genentech Nonclinical Biostatisics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bou

[R] merge zoo objects contained in a list

2009-08-11 Thread stephen sefick
I would like to merge zoo objects that are stored in a list into one big zoo object with one index for all of the observations. I have created the list (74 dataframes) with the code below, and have tried the do.call(merge, foo) in the call and the output is not what I expected. Any help would be

[R] Is there a summary on different version of 'apply' functions? What is the meaning of the prefixes?

2009-08-11 Thread Peng Yu
Hi, There are quiet a few different 'apply' functions, such as lapply, sapply and many more. I'm very familiar with the 'Apply' function in Mathematica. Can somebody point me a summary of all the 'apply' functions in R. Also, I'm curious that what 'l' and 's' (and other prefixes) stand for in 'lap

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread Bert Gunter
?with Bert Gunter Genentech Nonclinical Biostatisics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steve Lianoglou Sent: Tuesday, August 11, 2009 12:27 PM To: Jim Bouldin Cc: r-help@r-project.org Subject: Re: [R] problem selecting

Re: [R] R help from command line

2009-08-11 Thread Steve Lianoglou
Hi, On Aug 11, 2009, at 3:43 PM, Peng Yu wrote: Hi, I frequently need to open multiple help pages in R, which requires the start of multiple R sessions. I am wondering if there is a way to invoke the help page from the command line just like 'man'. I haven't been paying attention, but are yo

Re: [R] Transform array in dataframe; melt(); reshape()

2009-08-11 Thread Patrick Connolly
On Tue, 11-Aug-2009 at 07:15PM +0100, Cecilia Carmo wrote: > Hi everyone. > > Could anyone help me to reshape my data? > > Reproducible example: > firm<-sort(rep(1:1000,10),decreasing=F) > year<-rep(1998:2007,1000) > industry<-rep(c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10),rep(6,10),rep(7

[R] Paste symbol and calculation in plot

2009-08-11 Thread Jonathan R. Blaufuss
I'm trying to annotate a density plot and I would like to have R calculate the standard deviation and place it in the plot next to the standard deviation symbol "sigma". I can successfully use the text command to paste "StDev =",round(sd(Data),digits=3)) on the plot. However, I have trouble whe

[R] Data Mining Packages in R for categorical and numerical values

2009-08-11 Thread mmv.listservs
Hello, I''ve looked around and I can't seem to find a package to do data mining in R for a mixture of categorical and numerical attributes. If you have this data set: ## dummy data set.seed(123) dummy <- data.frame(A = sample(paste("tasks",1:100), 1,B = sample(paste("loads",1:100), 1,

[R] R help from command line

2009-08-11 Thread Peng Yu
Hi, I frequently need to open multiple help pages in R, which requires the start of multiple R sessions. I am wondering if there is a way to invoke the help page from the command line just like 'man'. Regards, Peng __ R-help@r-project.org mailing list

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread Steve Lianoglou
Hi, See comments in line: On Aug 11, 2009, at 2:45 PM, Jim Bouldin wrote: No problem John, thanks for your help, and also thanks to Dan and Patrick. Wasn't able to read or try anybody's suggestions yesterday. Here's what I've discovered in the meantime: What I did not include yesterday

[R] Prevent sequential repeated values in data frame column

2009-08-11 Thread Jon Zadra
Hi, I'm trying to randomize a sequence of trials for an experimental design. The trials consist of values for each of two factors. As is there are 30 combinations of the two factors, and I want them to be ordered randomly but with the requirement that for one of the factors, the value can n

Re: [R] Categorizing Lines

2009-08-11 Thread John Kane
Do you just want to assign an identifier to each line, that is call the first 33 lines are speciman A the next are speciman b etc? Assuming the data set is in a data.frame called xx try something like this group <- rep(1:33, each=79) data.frame (group,xx) John --- On Tue, 8/11/09, Fabio Murta

[R] Heteroscedasticity in binary logit models

2009-08-11 Thread Tomas Zelinsky
Hello, is there any tool to test heteroscedasticity in binary logit models? Thanks. Tomas __ 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

[R] VIF for logit models

2009-08-11 Thread Tomas Zelinsky
Hello, I wonder whether it's possible to use vif{car} for binary logit models (estimated by using glm() function). And what about a case if all explanatory variables are binary as well? Is VIF still a good criterion for multicollinearity detection? Thanks a lot. Tomas

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-11 Thread Peter Dalgaard
Ben Bolker wrote: I can see that fortune("S4") is going to produce more than one possible response soon ... (is Achim Zeleis listening?) Ben In all fairness, it should probably be noted that quite a few people swear BY S4 in addition to those who swear AT it. -p Frank E Harrell J

[R] Selecting/Accessing the last vector in a list of a list of data.frames

2009-08-11 Thread Bryan Hanson
Hello Again R Folks: I¹m trying to clean up some code. Suppose I have an object like this: > str(test) List of 2 $ G:List of 2 ..$ cls:'data.frame':101 obs. of 2 variables: .. ..$ V1: num [1:101] -0.0019 -0.0019 -0.00189 -0.00188 -0.00186 ... .. ..$ V2: num [1:101] 0.000206 0.000247

Re: [R] list indexing problem reading in files from a directory

2009-08-11 Thread stephen sefick
here is an intermediate solution that works just fine. Thank you all for your help. Stephen Sefick #level logger read in read.ll <- function(path){ library(chron) library(zoo) list.of.files <- list.files(path) length.files <- length(list.of.files) df <- vector(mode = "list", length = len

[R] reading heterogeneous CSV

2009-08-11 Thread Allen S. Rout
Greetings, all. I've got a datafile I've been working with that has an ideosyncratic, heterogeneous format. It's grossly like: [...] DISKREAD,metadata about disks MEM,metadata about memory ,observation-identifier,time,date DISKREAD,observation-identifier,data about disks MEM,observation-

[R] Categorizing Lines

2009-08-11 Thread Fabio Murtas
Hi all, i have a dataset of 3D coordinates and can't figure out how to' tell R which One Are the individuals: I have 3 columns which i named x,y and z And then i have 2607 Lines, but each specimen is 33 Lines (79 specimens) How can i tell R to' categorize individuals every 33 Lines? Thanks

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread Jim Bouldin
No problem John, thanks for your help, and also thanks to Dan and Patrick. Wasn't able to read or try anybody's suggestions yesterday. Here's what I've discovered in the meantime: What I did not include yesterday is that my original data frame, called "data", was this: X Y V3 1 1 1 0.

[R] ggplot2: override facet names in facet_wrap?

2009-08-11 Thread Ben Bolker
just a quick question (to which I suspect the answer is "no"): does anyone know if, in the ggplot2 package, there's a way to override the default names of the facets in facet_wrap (which correspond to the levels of the factor used to facet)? I know that I go back and change the levels of the fa

Re: [R] R installation on Linux/PPC with tcltk support

2009-08-11 Thread Ryan Golhar
Nevermind. I had both the ppc and ppc64 versions of tcl and tk installed. I removed ppc64 versions and everything works now. Must have been a conflict. Ryan Golhar wrote: I'm trying to install R on an IBM P570 running Redhat Enterprise Linux v4. When I run ./configure, I see: checking fo

[R] R installation on Linux/PPC with tcltk support

2009-08-11 Thread Ryan Golhar
I'm trying to install R on an IBM P570 running Redhat Enterprise Linux v4. When I run ./configure, I see: checking for tclConfig.sh... no checking for tclConfig.sh in library (sub)directories... /usr/lib64/tclConfig.sh checking for tkConfig.sh... no checking for tkConfig.sh in library (sub)di

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-11 Thread Ben Bolker
I can see that fortune("S4") is going to produce more than one possible response soon ... (is Achim Zeleis listening?) Ben Frank E Harrell Jr wrote: > > spencerg wrote: >> Hi, Terry: >> >> Thanks for the comments. I too vastly prefer S3 to S4. Your > > Me too. My summary is t

[R] Transform array in dataframe; melt(); reshape()

2009-08-11 Thread Cecilia Carmo
Hi everyone. Could anyone help me to reshape my data? Reproducible example: firm<-sort(rep(1:1000,10),decreasing=F) year<-rep(1998:2007,1000) industry<-rep(c(rep(1,10),rep(2,10),rep(3,10),rep(4,10),rep(5,10),rep(6,10),rep(7,10),rep(8,10),rep(9,10), + rep(10,10)),1000) X1<-rnorm(1) X2<-rnorm(

Re: [R] list indexing problem reading in files from a directory

2009-08-11 Thread Gavin Simpson
On Tue, 2009-08-11 at 12:45 -0500, stephen sefick wrote: > I am running into a problem with allocating these files to a list as > they are read in through a for loop. I know I am probably doing > something wrong, but I can't figure out what. I know this is not > reproducible. I am ending up with

Re: [R] list indexing problem reading in files from a directory

2009-08-11 Thread Charles C. Berry
On Tue, 11 Aug 2009, stephen sefick wrote: I am running into a problem with allocating these files to a list as they are read in through a for loop. I know I am probably doing something wrong, but I can't figure out what. I know this is not reproducible. I am ending up with a data frame of th

Re: [R] re placePatterns() for multiple words replacement in tm

2009-08-11 Thread Kelvin Lam
Thanks. The replacePatterns() is from the text mining package tm(). Bert Gunter wrote: > > Don't use replacePatterns() (-- and what package is that from, btw??). > > gsub("abc|def","Yes",sample[[1]]) > > Incidentally, "sample" is a rather bad name for your dataset, as it is the > name of a c

Re: [R] re placePatterns() for multiple words replacement in tm

2009-08-11 Thread Bert Gunter
Don't use replacePatterns() (-- and what package is that from, btw??). gsub("abc|def","Yes",sample[[1]]) Incidentally, "sample" is a rather bad name for your dataset, as it is the name of a commonly use R function. Ergo, possibility of confusion. Bert Gunter Genentech Nonclinical Biostatisics

Re: [R] error in names

2009-08-11 Thread Gavin Simpson
On Tue, 2009-08-11 at 17:49 +, Inchallah Yarab wrote: > Hi, > what is meaning this errors !!! > Error in names(o.pr)[p.ok] <- names(qs) : > incompatible types (from NULL to character) in subassignment type fix I can replicate this error by 'qs' not having names. what does names(qs) show?

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-11 Thread Duncan Murdoch
On 8/11/2009 1:24 PM, spencerg wrote: Hi, Terry: Thanks for the comments. I too vastly prefer S3 to S4. Your comparison is based on much greater experience than mine. Could you please check the link you sent? I couldn't get it to work. It's a small typo, the correction

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-11 Thread Frank E Harrell Jr
spencerg wrote: Hi, Terry: Thanks for the comments. I too vastly prefer S3 to S4. Your Me too. My summary is this: If you love computer science more than you value your own time, use S4. Frank Harrell comparison is based on much greater experience than mine. Could you please

[R] error in names

2009-08-11 Thread Inchallah Yarab
Hi, what is meaning this errors !!! Error in names(o.pr)[p.ok] <- names(qs) :   incompatible types (from NULL to character) in subassignment type fix In addition: Warning message: In Ops.factor(from, (0:(length.out - 1)) * by) :   + not meaningful for factors thank you very much

[R] list indexing problem reading in files from a directory

2009-08-11 Thread stephen sefick
I am running into a problem with allocating these files to a list as they are read in through a for loop. I know I am probably doing something wrong, but I can't figure out what. I know this is not reproducible. I am ending up with a data frame of the very last file to be read in. I know it is

[R] help on Rmpi

2009-08-11 Thread Zhiliang Ma
Dear R Users, I'm using Rmpi package for paralleling computing. It's very useful. But I have two question: 1. before running processes on slaves, all the data should be sent to them. however, if i forget to broadcast some of the data, the master will freeze, and I have to kill the process manuall

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-11 Thread spencerg
Hi, Terry: Thanks for the comments. I too vastly prefer S3 to S4. Your comparison is based on much greater experience than mine. Could you please check the link you sent? I couldn't get it to work. Thanks again. Spencer Terry Therneau wrote: For 90 percent of

Re: [R] [SOLVED] utf8 encoding and postscript

2009-08-11 Thread Alexandros Droseltis
On Tue, Aug 11, 2009 at 08:46 +0200, Alexandros Droseltis wrote: > I wrote a script file with the following commands > > postscript() > [...] > barplot(pr, xlab="Länge") > > In the output file (Rplots.ps) the german umlaut is printed as "L..nge". > How could I set the encoding correctly? I found

Re: [R] Import more than one sheet in a single excel file

2009-08-11 Thread Keo Ormsby
rajclinasia escribió: Hi Every one, my question is, How to Import more than one sheet in a single excel file (e.g. 10 sheets in one excel file) into R and create datasets for all the sheets in a single excel file without specifying the sheetnames. Thank you in Advance. Hello, One way is to use

Re: [R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-11 Thread Terry Therneau
For 90 percent of what I do I strongly prefer the loose (S3) rather than the rigid (S4) classes. So I'm closer to Rolf. My summary of S4 vs S3 A large increment in 1. nuisance to write 2. difficulty to debug 3. ability to write very obscure code 4. design Gain 5. ability to dir

[R] re placePatterns() for multiple words replacement in tm

2009-08-11 Thread Kelvin Lam
Hi all, I wonder how you can replace all words that need to be changed using replacePatterns(). The following is my code. I want to replace both "abc" and "def" to " Yes ". However, I can only replace the first occurrence in sample[[1]]. > sample[[1]] [1] abc def ghi > change <- c("abc","def"

Re: [R] matrix power

2009-08-11 Thread Nordlund, Dan (DSHS/RDA)
Cindy, I don’t know of a better way to do this than what Ted Harding showed. Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 From: cindy Guo [mailto

Re: [R] Help on a combinatorial task (lists?)

2009-08-11 Thread jim holtman
Does 'unlist' do it for you: > w <- c(3,3,2,1) # vector of weights > q <- 4 # theshold > > # computes which coordinate of w is decisive in each permutation > res <- unlist(sapply( permn(w), function(x) which(w == x[min(which(cumsum(x) > >=q))]) )) > > # complies the frequencies > prop.table( ta

Re: [R] ggplot: colours to geom_segments

2009-08-11 Thread John Kane
> Paul Emberson > try pa + scale_colour_brewer() and > see ?scale_colour_brewer for options > Also see scale_colour_manual where you can use the values parameter to > choose your own colours. > Thierry.ONKELINX > Have a look at scale_colour_manual() > (http://had.co.nz/ggplot2/scale_manual.html)

[R] SEM decomposition of Hessian

2009-08-11 Thread Kathryn Barto
I'm trying to run an SEM, but I keep getting the following error message. In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : Could not compute QR decomposition of Hessian. Optimization probably did not converge. I have 4 latent variables (plant, AMF, abiotic, and s

Re: [R] what is returned if a match is not found using grep

2009-08-11 Thread Duncan Murdoch
Rnewbie wrote: sorry, I still have a question. What is the difference between an empty vector and a vector of length 0? When I assign x<-c() is.null(x) is TRUE x<-integer(0) is.null(x) is FALSE NULL is a special object in R. is.null() returns TRUE for it. c() returns it. integer(0) is

Re: [R] ggplot: colours to geom_segments

2009-08-11 Thread Paul Emberson
Hi John, Try pa + scale_colour_brewer() and see ?scale_colour_brewer for options Also see scale_colour_manual where you can use the values parameter to choose your own colours. Cheers, Paul John Kane wrote: >> Paul Emberson "You need to map colour to a variable. Try >> geom_segment(mapping=

Re: [R] ggplot: colours to geom_segments

2009-08-11 Thread ONKELINX, Thierry
John, Have a look at scale_colour_manual() (http://had.co.nz/ggplot2/scale_manual.html) HTH, Thierry PS My solution was exactly the same as Paul's. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Res

[R] How to specify an addition Rprofile file for Rscript in the command line?

2009-08-11 Thread Peng Yu
Hi, When I use Rscript, I want that it load an additional Rprofile file besides the default ones. I don't find such an option. Can somebody let me know if there is such an option? Regards, Peng __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] Passing a list object to lapply

2009-08-11 Thread Fowler, Mark
Hello, I'm having difficulty passing an object name to a lapply function. Can somebody tell me the trick to make this work? #Works T13702 <- TRACKDATA[["13702.xls"]][["data"]] min(unlist(lapply(list(T13702), function(x) mdy.date(x[1, 2], x[1, 1], x[1, 3] 16553 #Works d<-2 assign(paste("T",s

Re: [R] ggplot: colours to geom_segments

2009-08-11 Thread John Kane
> Paul Emberson > "You need to map colour to a variable. Try > geom_segment(mapping=aes(colour=Food)) " That did it. Apparently I have not gotten to 'mapping' yet in the book! > Thierry.ONKELINX > You need to change colour = "darkgreen" into aes(colour = Food). This > will give a different col

[R] Help on a combinatorial task (lists?)

2009-08-11 Thread Serguei Kaniovski
Hello! I have the following combinatorial problem. Consider the cumulative sums of all permutations of a given weight vector 'w'. I need to know how often weight in a certain position brings the cumulative sums equal or above the given threshold 'q'. In other words, how often each weight is deci

[R] Generic attribute in multinom function

2009-08-11 Thread Benjamin Geckle
__ 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] what is returned if a match is not found using grep

2009-08-11 Thread Rnewbie
sorry, I still have a question. What is the difference between an empty vector and a vector of length 0? When I assign x<-c() is.null(x) is TRUE x<-integer(0) is.null(x) is FALSE Duncan Murdoch-2 wrote: > > Rnewbie wrote: >> dear all, >> >> I tried to use grep to match IDs in two dataframes >

[R] metaplot in rmeta: y-axis disappears

2009-08-11 Thread Roaman
Hi, I have a problem with the metaplot-function in rmeta. After plotting a Forest Plot with "metaplot", no y-axis is shown for normal plots anymore. Does someone know, why this is and how I can solve it? Thank you in advance! Kind regards, Roman -- View this message in context: http://www.n

  1   2   >