Re: [R] Writing to a file

2012-02-06 Thread Petr PIKAL
Hi > > Honestly thank you for the prompt responding > and you are right I will tellyou what I want to do > and not the way ..since I dont know much from R > > > I have a txt with Proteins > > "Prot_10035" "Func_0005874" "Func_0016787" "Func_0003774" "Func_0006898" > "Func_0005856" "Fu

Re: [R] box.cox

2012-02-06 Thread Tal Galili
Use: library(MASS) ?boxcox Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) --

Re: [R] dividing values of each column in a dataframe

2012-02-06 Thread Berend Hasselman
On 07-02-2012, at 00:09, Rolf Turner wrote: > > I believe your post is misleading. Your example "works" > purely by chance. > > R uses "column ordering", so entries 1 to 3 of column 1 in your > example get divided by 2, 3, and 4 respectively. Then "scal" is > *recycled* and entries 4, 5, an

Re: [R] I bet apply has a solution

2012-02-06 Thread Petr PIKAL
Hi as.logical(rowSums(apply(Data, 2, diff)>0)) here is another option. Regards Petr > > Hi all > For the data below, I would like to return a logical value indicating > differences in the data. > > #Create data > Data..<-data.frame(a=rep(1,10),b=c(rep(1,9),2),c=c(rep(1,8),2,2)) > >a b

Re: [R] Writing to a file

2012-02-06 Thread Felicity
Honestly thank you for the prompt responding and you are right I will tellyou what I want to do and not the way ..since I dont know much from R I have a txt with Proteins "Prot_10035""Func_0005874" "Func_0016787" "Func_0003774" "Func_0006898" "Func_0005856" "Func_0005525" "Func_0005737

[R] box.cox

2012-02-06 Thread Rosario Garcia Gil
Hello I am using box.cox() and I get this error message: Warning message: 'box.cox' is deprecated. Use 'bcPower' instead. See help("Deprecated") and help("car-deprecated"). I went to help but I did not understand the explanation, I am still wondering what is really happening. Thanks /R _

[R] How to simulate rating scale from skewed and kurtosis ??

2012-02-06 Thread Vichr
Hello all, I need to simulate rating scale from skewed and kurtosis. I would like to simulate a set of (discrete) data. ( n=1000, Item = 50 and 5 choice (1-5) ) Regards, Vichr -- View this message in context: http://r.789695.n4.nabble.com/How-to-simulate-rating-scale-from-skewed-and-kurtos

Re: [R] R-RApache to develop Knowledge Base

2012-02-06 Thread MLSC
Hi Spencer, Yes, I have seen RWebServices offered by bioconductor and Rserve offered by Omegahat project. But I felt too much of work around with these when compared to R-Rapache. It seems me like simply we have to depend on other langauges and deal type conversions. but whereas in RApache, R direc

Re: [R] read.csv "Duplicate row.names not allowed"

2012-02-06 Thread David Winsemius
On Feb 7, 2012, at 12:39 AM, David Winsemius wrote: On Feb 7, 2012, at 12:22 AM, Hasan Diwan wrote: I'm trying to read in a CSV, with lines looking like: HEADER, Latitude DecDeg, Latitude Hemisphere, Longitude DecDeg, Longitude Hemisphere, Speed knots, Bearing Degrees, fixQualityGga, n

Re: [R] read.csv "Duplicate row.names not allowed"

2012-02-06 Thread David Winsemius
On Feb 7, 2012, at 12:22 AM, Hasan Diwan wrote: I'm trying to read in a CSV, with lines looking like: HEADER, Latitude DecDeg, Latitude Hemisphere, Longitude DecDeg, Longitude Hemisphere, Speed knots, Bearing Degrees, fixQualityGga, noOfSatGga, altGga, heightGga, selectionGsa, fixGsa,

[R] read.csv "Duplicate row.names not allowed"

2012-02-06 Thread Hasan Diwan
I'm trying to read in a CSV, with lines looking like: HEADER, Latitude DecDeg, Latitude Hemisphere, Longitude DecDeg, Longitude Hemisphere, Speed knots, Bearing Degrees, fixQualityGga, noOfSatGga, altGga, heightGga, selectionGsa, fixGsa, pdopGsa, hdopGsa, vdopGsa, noOfSatGsv, Time, *c

Re: [R] alternating element in url

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 8:05 PM, frauke wrote: Hey everybody, it would be really appreciate if you knew the solution to the following problem. I am trying to load data from the internet into R without having to save them. However, I need to acess a different website for each dataset. So I w

Re: [R] histogram

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 9:46 PM, Francis Keyes wrote: ok here are two 1-column data files. sample1 and sampleRef (the reference distribution) > dat1 <- read.table(file="~/Downloads/sample1") > datRef <- read.table(file="~/Downloads/sampleRef") > str(dat1) 'data.frame': 11378 obs. of 1 variabl

[R] 3d average values

2012-02-06 Thread chuck.01
Hello, given the set of grey points (corners of squares, see visual)... something like this: http://r.789695.n4.nabble.com/file/n4363505/Slide2.png how do I calculate the average value of the variable z, that was measured at the corners of the rectangles (represented by the black points in th

[R] alternating element in url

2012-02-06 Thread frauke
Hey everybody, it would be really appreciate if you knew the solution to the following problem. I am trying to load data from the internet into R without having to save them. However, I need to acess a different website for each dataset. So I want to alternate an element in the URL. Eventually,

Re: [R] nice report generator?

2012-02-06 Thread Duncan Murdoch
On 12-02-06 4:12 PM, Hadley Wickham wrote: 2. It's more flexible to construct the language object as a language object, rather than pasting something together and parsing it. For one thing, that allows non-syntactic variable names; I think it's also easier to read. So your code txt<- paste("ta

Re: [R] Getting the list of lines evaluated in a function call

2012-02-06 Thread Duncan Murdoch
On 12-02-06 3:11 PM, Francois Rousseu wrote: Hello useRs I am looking for a function that can give the list of lines that were evaluated or used to generatethe last output from any function, whether an error message was generated or not. For example, let's say I have a function like this: foo<

Re: [R] text command - how to get a white background to cover grid lines

2012-02-06 Thread 538280
An alternative is the shadowtext function in the TeachingDemos package. On Mon, Feb 6, 2012 at 1:19 AM, Jim Lemon wrote: > On 02/06/2012 08:23 AM, Henry wrote: >> >> New to R - rookie question. >> I'm a mechanical engineer and enjoying using R to make high quality >> graphs. >> >> I've searched.

Re: [R] SPATIAL QUESTION: HOW TO MAKE POLYGONS AROUND CLUSTERS OF POINTS AND EXTRACT AREAS AND COORDINATES OF THESE POLYGONS?

2012-02-06 Thread Rolf Turner
It has been pointed out to me (in a private email) that there was a typo in my previous post; X <- rpoisspp(100) should read X <- rpoispp(100) (i.e. just one "s"). Sorry 'bout that! :-) cheers, Rolf __ R-help@r-project.org ma

Re: [R] Simple lm/regression question

2012-02-06 Thread James Annan
On 6/2/12 19:36 , peter dalgaard wrote: Actually, I think the issue is slightly different: IDL assumes that the errors _are_ something (notice that setting measure_errors to 1 is not equvalent to omitting them), R assumes that they are _proportional_ to the inverse weights Yes, I think this i

Re: [R] Writing to a file

2012-02-06 Thread jim holtman
You can easily do that, but the question is what is the problem you are trying to solve? What do you want to do with the lines you are writing out? Are you going to read them back in or process them with some other program? So save them in a character vector and then write them out with 'cat'.

Re: [R] new to R - text command - background color

2012-02-06 Thread Henry
update Jim Lemon emailed me suggesting I look at boxed.labels in the plotrix package. I loaded the package, there were a few messages about directories/etc. but somehow I got it working. I got the command to work, just what I wanted. Thanks to Jim -Henry -- View this message in context: ht

Re: [R] Table rearranging

2012-02-06 Thread William Dunlap
Install and load the "plyr" package and try something like: > ddply(d, .(date, color), summarize, + meanOpen=mean(measurement[door=="open"]), nOpen=sum(door=="open"), + meanClosed=mean(measurement[door=="closed"]), nClosed=sum(door=="closed")) date color meanOpen nOpen meanClosed

[R] SCperf package is now available on CRAN

2012-02-06 Thread marlene marchena
Dear R users, I'd like to announce that the 'SCperf' package is now available on CRAN. The package implements different inventory models, the bullwhip effect and other supply chain performance variables. This is the first version of the package and it is also my first package for R. Suggestion

[R] Table rearranging

2012-02-06 Thread Jeffrey Joh
I have a table that looks like this: measurement    date    door    color 0.93529385    513    open    red 0.97419293    420    open    red 0.962053514    513    closed    red 0.963909937    1230    open    blue 0.97652034    1230    open    green 0.989310795    1230    closed    blue 0.9941022  

Re: [R] SPATIAL QUESTION: HOW TO MAKE POLYGONS AROUND CLUSTERS OF POINTS AND EXTRACT AREAS AND COORDINATES OF THESE POLYGONS?

2012-02-06 Thread Rolf Turner
On 04/02/12 03:59, Bjørn Økland wrote: Imagine that I have a large number of points (given by coordinates x and y) that vary in density per space. For the purpose of demonstration it could be generated like this: s<- data.frame(x=runif(1,0,900),y=runif(1,0,900)); plot(s) I want to crea

Re: [R] rscript in cmd window stop

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 5:03 PM, Renger van Nieuwkoop wrote: Hi I am trying to run a R-script in the windows command window: e.g. rscript example.R ... It plots some stuff, but using par(ask=T) doesn't let the plotting pause. Any idea how to do this? This has been asked and answered before. par

[R] rscript in cmd window stop

2012-02-06 Thread Renger van Nieuwkoop
Hi I am trying to run a R-script in the windows command window: e.g. rscript example.R ... It plots some stuff, but using par(ask=T) doesn't let the plotting pause. Any idea how to do this? Thanks Renger __ Renger van Nieuwkoop Goldiwilstrasse 16 F

Re: [R] MLEs using optim

2012-02-06 Thread Rolf Turner
On 07/02/12 03:24, djbanana wrote: I am trying to use the optim command to get the MLEs for a number of parameters based on some data. Is it possible to write a program that maximizes the likelihood and stores the parameters (many times)? Of course it's possible. This is R. I need to do th

Re: [R] histogram

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 5:26 PM, Francis Keyes wrote: Hi David, I have 2 tables, each with several columns and rows of data. I am only interested in the data from column 6, which contains values in the range -PI to PI. I want to plot the data from tableD with the y axis denoting percentage with r

Re: [R] I bet apply has a solution

2012-02-06 Thread Rolf Turner
No. This does not do anything like what the OP wanted. Did you ***try*** it, for crying out loud? cheers, Rolf Turner On 07/02/12 08:29, ilai wrote: duplicated(Data..) On Mon, Feb 6, 2012 at 11:34 AM, LCOG1 wrote: Hi all For the data below, I would like to return a logical val

Re: [R] Selecting contiguous, irregularly-shaped sets of values from arrays

2012-02-06 Thread Bryan McCloskey
Chris, That worked exceptionally well. Here's the pseudo-code for what I ended up using: library(spatstat) depth_bin<-depth<-stage-elevation #depth at grid cells = stage matrix - elevation matrix; initialize binary matrix depth_bin[,]<-depth>5 #binary matrix of cells >5cm deep depth_con_im<-con

Re: [R] dividing values of each column in a dataframe

2012-02-06 Thread Rolf Turner
I believe your post is misleading. Your example "works" purely by chance. R uses "column ordering", so entries 1 to 3 of column 1 in your example get divided by 2, 3, and 4 respectively. Then "scal" is *recycled* and entries 4, 5, and 6, get divided by 2, 3, and 4 respectively, and so on. I

Re: [R] Disable contrasts in lme

2012-02-06 Thread Ben Bolker
Saskia Freytag med.uni-goettingen.de> writes: > I am trying to disable the contrast statement in the lme function of the > package nlme. Is there a way to do this? This is needed as I have only > one group. Can you be more specific please? My first interpretation of this question is "if yo

Re: [R] histogram

2012-02-06 Thread Francis Keyes
Hi David, I have 2 tables, each with several columns and rows of data. I am only interested in the data from column 6, which contains values in the range -PI to PI. I want to plot the data from tableD with the y axis denoting percentage with respect to tableR. So if data points in the break 2 -

Re: [R] Creating time series (ts) object

2012-02-06 Thread R. Michael Weylandt
The documentation doesn't say what you think it says: "The value of argument ‘frequency’ is used when the series is sampled an integral number of times in each unit time interval. For example, one could use a value of ‘7’ for ‘frequency’ when the data are sampled daily, and the natu

Re: [R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread Ista Zahn
Hi Ryan, You're getting this result because five of the rows in a.one.qtr are duplicates, as a results of sampling with replacement: length(which(duplicated(a.one.qtr))) [1] 5 The relevant section of the documentation (see ?merge) reads "The rows in the two data frames that match on the specifie

[R] Creating time series (ts) object

2012-02-06 Thread Filoche
Hi everyone. I have have a dataset with daily measurement from January 1st of 1966 up to December 31th of 2011. Here's the first part of the data: DateSLEV 1/1/19661.086 1/2/19661.079 1/3/19661.133 1/4/19661.261 1/5/19661.391 1/6/19661.571 1/7/

Re: [R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread Sarah Goslee
Hi, Why do you need to merge them? c.one contains what I think you want, and then you want to randomly select 25 rows from that without replacement: c.one <- cbind(c.one, a.qtr = sample(c(rep(TRUE, 25), rep(FALSE, 75 > head(c.one) unique length age a.qtr 649649 71 4 TRUE 200

Re: [R] Colors vector based on group

2012-02-06 Thread Filoche
Thank for your answer. Problem solved. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Colors-vector-based-on-group-tp4361425p4362746.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread Petr Savicky
On Mon, Feb 06, 2012 at 12:29:53PM -0800, RKinzer wrote: > Hello all, > > First I have done extensive searches on this forum and others and nothing > seems to work. So I decided to post thinking someone could point me to the > write post or give me some help. > > I have drawn a 100 samples from

[R] How do I get the CEM (coarsened exact matching) package to run?

2012-02-06 Thread Daniel Malter
Hi, I am running a MacBook Pro with OS X 10.6.8. When I try to load library(cem) and run any function, R crashes. Any suggestions as to why this is? Thanks in advance. I think the problem is that I don't have all the "infrastructure" I need to run CEM, but I have no clue what to do either...

Re: [R] nice report generator?

2012-02-06 Thread Hadley Wickham
> 2. It's more flexible to construct the language object as a language object, > rather than pasting something together and parsing it.  For one thing, that > allows non-syntactic variable names; I think it's also easier to read.  So > your code > > txt<- paste("tabular(value*v*", LEFT , "~" ,RIGHT

Re: [R] Multi-page PDF using dev.copy2pdf(filename, onefile=TRUE)?

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 2:51 PM, Doug Hill wrote: Thanks Elai, that did it! I never considered using any X11 options, as I'm on Windows, and in the docs I read it sounded like X11 options only pertained to the OSX/Linux/.. world. Thanks for your help, Doug You are confused about the differenc

[R] Duplicate rows when I combine two data.frames with merge!

2012-02-06 Thread RKinzer
Hello all, First I have done extensive searches on this forum and others and nothing seems to work. So I decided to post thinking someone could point me to the write post or give me some help. I have drawn a 100 samples from a fictitious population (N=1000), and then randomly selected 25% of the

Re: [R] Reordering levels of a factor when the factor is part of a data frame

2012-02-06 Thread Ernest Adrogué
6-02-2012, 11:03 (-0800); Judith Flores escriu: > The name of the column will be saved in an object called: > > variab > > the data frame is called df. > > > If I try to the do following: > > df[variab]<-factor(df[variab], levels=c("A2B","B31","C33")) > > it won't work because df[variab] is

[R] Getting the list of lines evaluated in a function call

2012-02-06 Thread Francois Rousseu
Hello useRs I am looking for a function that can give the list of lines that were evaluated or used to generatethe last output from any function, whether an error message was generated or not. For example, let's say I have a function like this: foo <- function( x ){ if(

[R] Random draws from an ANOVA-like design with given population effect sizes

2012-02-06 Thread Patrick S Forscher
Hi all, Let's say that you have a 3-group categorical predictor x that has the orthogonal contrasts c1 and c2. I am trying to create a function that, given x, c1, and c2, creates a normally-distributed y such that c1 and c2 have effect sizes r1 and r2 specified by the user. For example, let's say

[R] sqsSave() test using Test.R script returning error suggesting no values upon "insert"

2012-02-06 Thread Mark LoPresti
Hi. I attempted to use RODBC and decided to execute all the tests provided in "Test.r" under the unpacked package RODBC folder. Beginning with the following: library(RODBC) library(MASS) USArrests[1,2] <- NA hills <- hills[1:15,] row.names(hills)[12] <- "Dollar ('$')" set.seed(1) # MySQL ## tes

Re: [R] I bet apply has a solution

2012-02-06 Thread ROLL Josh F
Ah. That's the one. Thank you. -Original Message- From: Ista Zahn [mailto:istaz...@gmail.com] Sent: Monday, February 06, 2012 11:12 AM To: ROLL Josh F Cc: r-help@r-project.org Subject: Re: [R] I bet apply has a solution Hi Josh, How about apply(Data, 1, function(row) sd(row) == 0)

[R] Any R course in New York or Washington DC in March?

2012-02-06 Thread eugene dalt
Hey Folks,   I am looking for a R course in New York or Washington DC,  please email me any course announcement you know of for these dates.   Best - Eugene [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.e

Re: [R] dividing values of each column in a dataframe

2012-02-06 Thread Berend Hasselman
On 06-02-2012, at 20:22, Abhishek Pratap wrote: > Hey Guys > > I want to divide(numerically) all the columns of a data frame by > different numbers. Here is what I am doing but getting a weird error. I don't think you are getting an error. You are getting an unexpected result (you think). > T

Re: [R] Multi-page PDF using dev.copy2pdf(filename, onefile=TRUE)?

2012-02-06 Thread Doug Hill
Thanks Elai, that did it! I never considered using any X11 options, as I'm on Windows, and in the docs I read it sounded like X11 options only pertained to the OSX/Linux/.. world. Thanks for your help, Doug --- On Mon, 2/6/12, ilai wrote: From: ilai Subject: Re: [R] Multi-page PDF using dev.c

Re: [R] dividing values of each column in a dataframe

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 2:22 PM, Abhishek Pratap wrote: Hey Guys I want to divide(numerically) all the columns of a data frame by different numbers. Here is what I am doing but getting a weird error. The values in each column are not getting divided by the corresponding value in the denominator ve

Re: [R] I bet apply has a solution

2012-02-06 Thread ilai
duplicated(Data..) On Mon, Feb 6, 2012 at 11:34 AM, LCOG1 wrote: > Hi all > For the data below, I would like to return a logical value indicating > differences in the data. > > #Create data > Data..<-data.frame(a=rep(1,10),b=c(rep(1,9),2),c=c(rep(1,8),2,2)) > >   a b c > 1  1 1 1 > 2  1 1 1 > 3  

[R] dividing values of each column in a dataframe

2012-02-06 Thread Abhishek Pratap
Hey Guys I want to divide(numerically) all the columns of a data frame by different numbers. Here is what I am doing but getting a weird error. The values in each column are not getting divided by the corresponding value in the denominator vector instead by the alternative values. I am sure I am

Re: [R] Reordering levels of a factor when the factor is part of a data frame

2012-02-06 Thread Ista Zahn
Hi Judith, You should use double brackets, like this: df[[variab]]<-factor(df[[variab]], levels=c("A2B","B31","C33")) see ?"[" for details, noting that the help page assumes that you know data.frames are list-like objects. Best, Ista On Mon, Feb 6, 2012 at 2:03 PM, Judith Flores wrote: > Hell

Re: [R] I bet apply has a solution

2012-02-06 Thread Ista Zahn
Hi Josh, How about apply(Data, 1, function(row) sd(row) == 0) ? Best, Ista On Mon, Feb 6, 2012 at 1:34 PM, LCOG1 wrote: > Hi all > For the data below, I would like to return a logical value indicating > differences in the data. > > #Create data > Data..<-data.frame(a=rep(1,10),b=c(rep(1,9),

Re: [R] I bet apply has a solution

2012-02-06 Thread Justin Haynes
How bout: apply(Data..,1, function(vec) !all(vec==vec[1])) [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE On Mon, Feb 6, 2012 at 10:34 AM, LCOG1 wrote: > Hi all > For the data below, I would like to return a logical value indicating > differences in the data. > > #Create da

[R] Reordering levels of a factor when the factor is part of a data frame

2012-02-06 Thread Judith Flores
Hello R-users,    I have a data frame whose names of columns I don't know a priori, but the user of my code will know them. The user is supposed to save the name of the column that will need some reordering of the levels of the factor later on. The name of the column will be saved in an object

Re: [R] Writing to a file

2012-02-06 Thread Felicity
maybe I could keep each line (having the strings) in a file or somewhere and then call a print function that prints them all together from where I saved them? Please let me know as soon as Possible!! thank you! -- View this message in context: http://r.789695.n4.nabble.com/Writing-to-a-file-tp3

[R] I bet apply has a solution

2012-02-06 Thread LCOG1
Hi all For the data below, I would like to return a logical value indicating differences in the data. #Create data Data..<-data.frame(a=rep(1,10),b=c(rep(1,9),2),c=c(rep(1,8),2,2)) a b c 1 1 1 1 2 1 1 1 3 1 1 1 4 1 1 1 5 1 1 1 6 1 1 1 7 1 1 1 8 1 1 1 9 1 1 2 10 1 2 2 So what I want

[R] Genetic based classification tree induction

2012-02-06 Thread Nissim Matatov
Hi , everybody Does R has some package is able genetic based search for optimal decision tree model Thanks, Nissim [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] UTF8

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 11:18 AM, Norma wrote: As far as I can see it, those are two problems. The "default locale" and the language problem. I have exactly the same, I am using Mac OSX 10.6.8. I have also tried installation of packages. When installing a package I get a related error message:

[R] Suggestion for "drop the loser" design and analysis in R?

2012-02-06 Thread Tal Galili
Hello all, I would like to plan and analyse a study with "k" treatments (one of which is a "control"), with some binary outcome, in order to find the "best" treatment (e.g: the one with a high number of "successes"). If this was done with a fixed sample size, the analysis is well known. However,

Re: [R] UTF8

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 11:26 AM, Norma wrote: trying to change the locale like this *> Sys.setlocale("Macintosh HD")* failed with the following error: *Error in Sys.setlocale("Macintosh HD") : invalid 'category' argument* You are confused about what the locale setting is used for. They are f

[R] Disable contrasts in lme

2012-02-06 Thread Saskia Freytag
Dear all, I am trying to disable the contrast statement in the lme function of the package nlme. Is there a way to do this? This is needed as I have only one group. Thank you so much in advance, Saskia Freytag -- Saskia Freytag Department of Genetic Epidemiology Georg-August University Gött

Re: [R] an unusual use for R

2012-02-06 Thread Barry Rowlingson
On Mon, Feb 6, 2012 at 5:14 PM, Richard M. Heiberger wrote: > I love it.  I hope you are planning a talk at the UseR!2012 in Nashville. Maybe we'll have hand-woven R-logo lanyards for our conference badges? Get weaving Sarah! Barry __ R-help@r-projec

[R] Heckman selection Model with HLM structure

2012-02-06 Thread Nita Umashankar
Hello, I am trying to estimate a 2-stage selection Model where the first probit stage is whether the customer bought (0/1) and the second stage is given that the customer bought, how much did they spend (revenue). However, in my data, customers are nested within customer service agents and cust

Re: [R] UTF8

2012-02-06 Thread Norma
As far as I can see it, those are two problems. The "default locale" and the language problem. I have exactly the same, I am using Mac OSX 10.6.8. I have also tried installation of packages. When installing a package I get a related error message: *tar: Failed to set default locale* if I enter

Re: [R] Colors vector based on group

2012-02-06 Thread Filoche
Hi there. I should have thought about that myself (/shame). Thank you very much for your time. Phil -- View this message in context: http://r.789695.n4.nabble.com/Colors-vector-based-on-group-tp4361425p4361686.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] UTF8

2012-02-06 Thread Norma
trying to change the locale like this *> Sys.setlocale("Macintosh HD")* failed with the following error: *Error in Sys.setlocale("Macintosh HD") : invalid 'category' argument* -- View this message in context: http://r.789695.n4.nabble.com/UTF8-tp873280p4361803.html Sent from the R help mail

Re: [R] Colors vector based on group

2012-02-06 Thread Rui Barradas
Hello, > I have a vector like this: > > x = > c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2) > > I would like to associate a colour to each of these entry. For example, I > could use topo.colors(3) (since I have 3 groups). > > I know it is easy to do this with

[R] ggplot2 geom_polygon fill

2012-02-06 Thread raimund
Hi everyone, i've been trying to make a special plot with ggplot2, but I can't get it to fill the polygon I'd like to see filled so very very much. I want to display the difference or change in the distribution of the modified Rankin Scale between two groups. mRS is a scale for disability or dail

Re: [R] [newbie] storage/use of user's own functions?

2012-02-06 Thread Michael Dewey
At 04:06 06/02/2012, Joshua Wiley wrote: Hi Tom, I don't believe there is a standard location. You can set variables or have functions run (say to source other functions in) in your .Rprofile file. That way, you always have them. Once you get more than a handful of functions, it is probabl

Re: [R] Writing to a file

2012-02-06 Thread R. Michael Weylandt
You don't say how you are writing to a file, but some methods have an append = TRUE option that might be helpful. Your code looks really inefficient as well: I don't have time to look at it fully now, but it seems to me that you can vectorize the inner loops quite directly: for(j in ncol(y)){

Re: [R] R enterprise for linux

2012-02-06 Thread R. Michael Weylandt
I think there is some support for multi-processor matrix multiplication (google around for it) but in your case, it might suffice to use an optimized BLAS and R's builtin parallel facilities. As I said in your other thread -- if you are working with diagonal/sparse matrices, it's also possible to

[R] na.action in stats::factanal() must be using formula interface and dataframe input to specify na.action?

2012-02-06 Thread Timothy Bates
hi, Does factanal() force the user to use the formula interface if they wish to specify an na.action? v1 <- c(1,1,1,1,1,1,1,1,NA,1,3,3,3,3,3,4,5,6) v2 <- c(1,2,1,1,1,1,2,1,2,1,3,NA,3,3,3,4,6,5) v3 <- c(3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,5,4,6) v4 <- c(3,3,4,NA,3,1,1,2,1,1,1,1,2,NA,1,5,6,4) v5 <- c(1,1

Re: [R] R's memory capabilities

2012-02-06 Thread R. Michael Weylandt
Use the Matrix package which provides easy access to sparse matrices. I think (unchecked) there's even easy provision for a diagonal sparse matrix. That said, if you are always working with diagonal matrices, couldn't you just keep the diagonals as vectors since the formulas for matrix multiplicat

Re: [R] how to access values from functions

2012-02-06 Thread R. Michael Weylandt
You can modify the function and add either a print() statement or a browser() call as make sense for your purposes. Type the name of the function to get the source: copy and edit it as desired, and then run something like funcName <- newSource Now when you run funcName it will run your new versi

Re: [R] histogram

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 12:23 PM, Francis Keyes wrote: Thanks. How do you suggest I use the reference population? Sorry, I'm new to R and just don't see it. If i can get a plot that is counts or density relative to my reference data it would be ideal. It is difficult to specify "how" when we

Re: [R] Logistic Regression

2012-02-06 Thread tw
On 02/06/2012 03:08 PM, Ana wrote: > I am looking for R packages that can make a Logistic Regression model > with parameter estimation by Maximum Likelihood Estimation. > > > Many thanks for helping out. > > __ > R-help@r-project.org mailing list > https:

Re: [R] Multi-page PDF using dev.copy2pdf(filename, onefile=TRUE)?

2012-02-06 Thread ilai
Doug, dev.copy2pdf closes the connection after it's "done", so onefile is meaningless. To look at each plot before copy to a single pdf, you could open a pdf(...) but revert between it and your graphic device: graphics.off() plot(1:7, 1:7) x11c<- dev.cur() # your current graphics device pdf(f

Re: [R] histogram

2012-02-06 Thread Francis Keyes
Thanks. How do you suggest I use the reference population? Sorry, I'm new to R and just don't see it. If i can get a plot that is counts or density relative to my reference data it would be ideal. On Mon, Feb 6, 2012 at 1:12 AM, David Winsemius wrote: > > On Feb 5, 2012, at 8:31 PM, Francis Ke

Re: [R] an unusual use for R

2012-02-06 Thread Richard M. Heiberger
I love it. I hope you are planning a talk at the UseR!2012 in Nashville. Do remember the history that one of the origins of punchcards is the Jaquard loom. Rich On Thu, Feb 2, 2012 at 5:54 PM, Sarah Goslee wrote: > I thought some of you might be amused by this. > > In my non-work time, I'm an

Re: [R] 'deparse(substitute'))' then 'assign' in a S4 methods

2012-02-06 Thread William Dunlap
The interrupt issue is somewhat orthogonal to the SV4/scoping issue you asked about. Trying to put things in the callers frame is very tricky. E.g., SV4 methods can insert new frames between your code and the caller. Perhaps you could try the following sort of construct, in which your desired fu

Re: [R] R-RApache to develop Knowledge Base

2012-02-06 Thread Spencer Graves
Have you tried Bioconductor (www.bioconductor.org )? Spencer On 2/5/2012 10:36 PM, MLSC wrote: > Hi all, > > I need your opinion about using R-Rapache to build a knowlegde base to > bioinformatics field. > > I have copious amount of genotype information (some few m

Re: [R] R's memory capabilities

2012-02-06 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Alaios > Sent: Monday, February 06, 2012 3:11 AM > To: peter dalgaard > Cc: R-help@r-project.org > Subject: Re: [R] R's memory capabilities > > Thanks a lot for your answer :) > a

Re: [R] Colors vector based on group

2012-02-06 Thread Achim Zeileis
On Mon, 6 Feb 2012, Filoche wrote: Hi everyone. I have a vector like this: x = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2) I would like to associate a colour to each of these entry. For example, I could use /topo.colors(3)/ (since I have 3 groups). I know

Re: [R] appending variable's values in table like fashion

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 6:29 AM, sagarnikam123 wrote: i have two variable pyar [1] "M" "12" "34" "13" gita [1] "U" "22" "33" "44" want to append gita object below pyar object as & want to take in anther variable You could make a character matrix: cmat <- matrix(c(pyar,gita), nrow=2, byrow=

Re: [R] Colors vector based on group

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 9:40 AM, Filoche wrote: Hi everyone. I have a vector like this: x = c (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2 ) I would like to associate a colour to each of these entry. For example, I could use /topo.colors(3)/ (since I have 3 gr

Re: [R] R enterprise for linux

2012-02-06 Thread Alaios
That was my bad. (doing two things at same time) I am not out of memory by no means it is just that it only runs at one core. IF somehow R was able to see the many cores in my system. Regards Alex From: David Winsemius Cc: R. Michael Weylandt ; "R-help@r

Re: [R] R enterprise for linux

2012-02-06 Thread David Winsemius
On Feb 6, 2012, at 10:17 AM, Alaios wrote: My bad.. these are the real matrices G<-DiagonalGaussian( NumberOfImagePixels,sd=Gsd) str(G) num [1:16384, 1:16384] 1400 0 0 0 0 ... S<-PointSamplingMatrix(EffectiveSensors,NumberOfImagePixels) str(S) num [1:10650, 1:16384] 0 0 0 0 0 0 0 0 0 0

[R] lmer with spatial and temporal random factors, not nested

2012-02-06 Thread Marte Lilleeng
Hi, I am new to this list. I have a question regarding including both spatial and temporal random factors in lmer. These two are not nested, and an example of model I try to fit is model1<-lmer(Richness~Y+Canopy+Veg_cm+Treatment+(1|Site/Block/Plot)+(1|Year), family=poisson, REML=FALSE), where rich

[R] Colors vector based on group

2012-02-06 Thread Filoche
Hi everyone. I have a vector like this: x = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2) I would like to associate a colour to each of these entry. For example, I could use /topo.colors(3)/ (since I have 3 groups). I know it is easy to do this with /if/else/

[R] Multi-page PDF using dev.copy2pdf(filename, onefile=TRUE)?

2012-02-06 Thread Doug Hill
Hi all. I want to generate a sequence of n plots and save them into a single PDF file, one plot per page. From the R docs and other sources I gather the basic way to do this is save plot 1 into a file then append the 2:n plots to the same file.  This code shows my basic approach, but for some re

[R] MLEs using optim

2012-02-06 Thread djbanana
I am trying to use the optim command to get the MLEs for a number of parameters based on some data. Is it possible to write a program that maximizes the likelihood and stores the parameters (many times)? I need to do this a lot of times, each time the data will be updated with more entries (rows).

Re: [R] multiple comparisons in nested design (error correction)

2012-02-06 Thread José Trujillo Carmona
The last model is: AnovaModel.4 <- lmer(VR ~ trat+(1|patient:trat), data=Mesures) Sorry. El 06/02/12 13:43, José Trujillo Carmona escribió: > Dear professors and collegues > > I need to perform a analysis of dates from a nested experimental design. > > From > > "Bioestatical Analysis" of Zar >

[R] Orthogonal contrasts in mixed-effect models

2012-02-06 Thread xavi sole
Hello all, I am wiriting here to look for help!!! I am running a mixed-model effect lmer() relating the total species richnees observed in one place with some landscape indicators depending on three positions at field scale (Boundary, edge, centre) nested to the location where the survey was con

[R] multiple comparisons in nested design

2012-02-06 Thread José Trujillo Carmona
Dear professors and collegues I need to perform a analysis of dates from a nested experimental design. From "Bioestatical Analysis" of Zar "Bimetry of Sokal" & Rohlf "Design and Analysis of Experiments" of Montgomery I have: Sum (mean(x)_i - mean(x)_T)2 / (a-1) -> var(epsilon) + n sigma2_B +

  1   2   >