[R] loops over regression models

2012-01-13 Thread Xu Jun
Dear R help listers, I am trying to replicate results in Gelman and Hill's book (Chapter 3 in regressions and multilevel models). Below I estimated two models (chp3.1 and chp3.3 in R codes) with the same data and dependent variable but different independent variables. I have been using Stata for

Re: [R] subset

2012-01-13 Thread 孟欣
Many thanks for your elaborated explaina. At 2012-01-13 11:34:51,R. Michael Weylandt michael.weyla...@gmail.com wrote: As Jorge noted, the fix is to use %in%: a fuller explanation of why `==` didn't work is that it implicitly used vector recycling: look at with(data, id == c(a, c))

Re: [R] subset

2012-01-13 Thread 孟欣
Thanks£¡ ÔÚ 2012-01-13 10:51:14£¬Jorge I Velez jorgeivanve...@gmail.com дµÀ£º Hi, Use %in% instead of ==. HTH, Jorge.- On Thu, Jan 12, 2012 at 9:36 PM, ÃÏÐÀ wrote: Hi all I have a question about subset function. dat id x1 x2 x3 1 a 1 11 111 2 b 2 22 222 3 c 3 33 333 4 d

[R] analytical solution of partial differential equation

2012-01-13 Thread ATANU
i am trying to solve a partial differential equation analytically(PDE) in R . i have found some functions that do the stuff numerically. But that will not meet my purpose. is there any function to solve PDE analytically. please help. -- View this message in context:

Re: [R] loops over regression models

2012-01-13 Thread Petr PIKAL
Hi Dear R help listers, I am trying to replicate results in Gelman and Hill's book (Chapter 3 in regressions and multilevel models). Below I estimated two models (chp3.1 and chp3.3 in R codes) with the same data and dependent variable but different independent variables. I have been using

[R] beanplot-Error: sample is too sparse to find TD

2012-01-13 Thread Enomis
Hi all, Since two days I am trying to find a solution to be able to create beanplots for my data. When I call the beanplot function the following error appears: beanplot(y1 ~ x1, log=, what=c(1,1,1,0), ylim=c(0,1)) Error in bw.SJ(x, method = dpi) : sample is too sparse to find TD What is

[R] Help needed in interpreting linear models

2012-01-13 Thread mails
Dear members of the R-help list, I have sent the email below to the R-SIG-ME list to ask for help in interpreting some R output of fitted linear models. Unfortunately, I haven't yet received any answers. As I am not sure if my email was sent successfully to the mailing list I am asking for help

[R] Latent class model with Polytomous Variable and Bootstrap

2012-01-13 Thread Kuen Bok lee
Hi. I run a latent class analysis with polymotous variables. Because of small sample size, I have to use bootstrap method in order to select a proper model. Is there any package or way that I can run a bootstrap method after runing latent class model with polytomous variables? Thank KeunBok Lee

[R] rho statistics for dinucleotide abundance from a sequence file

2012-01-13 Thread utpal
Hi all, I have a sequence file (fasta format) and want to calculate the rho statistics for dinucleotide abundance value on my data.. the code which I use is (using seqinr library and current working directory) /seq_info-read.fasta(gene.txt)/ /rho(seq_info[1],2)/ but it yields only the

Re: [R] remoting ESS/R with tramp

2012-01-13 Thread Michael Albinus
p...@potis.org writes: When I move R and Rscript out of my path, as expected, I also have problems. If I use tramp to connect to remote, open a shell there with M-x eshell, and type 'env' , my path is the path on local. This is the correct behaviour of eshell: /scp:slbps0:/root $ which

[R] how to create stratified (cross-validation) partitions according to numerical features

2012-01-13 Thread Martin Guetlein
Hi all, I want to fragment a dataset into k-cross-validation partitions (folds). The content of the folds should be stratified, but not according to a single (categorical) feature, but according to a range of features (numeric, if possible numeric and categorical). Does anybody know a way to do

Re: [R] syntax for reading into R

2012-01-13 Thread Marion Wenty
we haven't had time to create the file again, yet, but thanx also for the great tip about this special mailing list! marion 2012/1/3 Barry Rowlingson b.rowling...@lancaster.ac.uk On Tue, Jan 3, 2012 at 10:54 AM, Marion Wenty marion.we...@gmail.com wrote: hello barry, thank you very much

Re: [R] Help needed in interpreting linear models

2012-01-13 Thread Petr PIKAL
Hi It seems to me quite like a homework for which the policy of this list is not to respond. But far from being an expert in statistics I only express my opinion. It seems to me that your height variable behaves like a two level factor and the 190 value points to rather suspicious value in

[R] how to find the number of iterations kmeans used to converge?

2012-01-13 Thread Rui Esteves
Dear all, I need to know in which number of iterations the kmeans converge each time I run it. Any idea how to do it? Thank you for your attention, Rui __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] find inflexion point of discrete value list with R

2012-01-13 Thread Jonas Stein
d2y - diff(dy) which(dy==0) ## critical values sign(s2y)[which(dy==0)] ## test for max/min/saddle which(d2y==0) ## inflection points I would think that testing for d2y==0 would be akin to the error in numeric analysis warned about in FAQ 7.31. Seems unlikely that in real data that

[R] Remove space from string

2012-01-13 Thread Vikram Bahure
Dear R users, I have some trivial query. I have a string, I want to remove space from the string. For eg. Input: a - Remove space Output required: Removespace I tried using str_trim but only removes end spaces. library(stringr). Regards Vikram [[alternative HTML version deleted]]

Re: [R] Remove space from string

2012-01-13 Thread Gustaf Rydevik
gsub( ,,a) /Gustaf On Fri, Jan 13, 2012 at 12:24 PM, Vikram Bahure economics.vik...@gmail.comwrote: Dear R users, I have some trivial query. I have a string, I want to remove space from the string. For eg. Input: a - Remove space Output required: Removespace I tried using

Re: [R] remoting ESS/R with tramp

2012-01-13 Thread Claudia Beleites
Tom, what happens with: (Emacs) M-x ssh t (you should have the remote shell buffer now) R (once R is started) M-x ess-remote r ? Claudia -- Claudia Beleites Spectroscopy/Imaging Institute of Photonic Technology Albert-Einstein-Str. 9 07745 Jena Germany email:

[R] Odp: Remove space from string

2012-01-13 Thread Petr PIKAL
Hi Dear R users, I have some trivial query. I have a string, I want to remove space from the string. For eg. Input: a - Remove space Output required: Removespace It seems to be simple. Even myself with very poor knowledge of regexpr can suggest solution. gsub( , , a)

Re: [R] how to find the number of iterations kmeans used to converge?

2012-01-13 Thread David Winsemius
On Jan 13, 2012, at 5:53 AM, Rui Esteves wrote: Dear all, I need to know in which number of iterations the kmeans converge each time I run it. Any idea how to do it? Look at the help page (to see that it is not part of the returned object) and then look at the code (to see that the

[R] second order cone programmming, linear inequalities constraints

2012-01-13 Thread riccardo giacomelli
Hi all, I can see two packages implementing second order cone programming in R: CLSOCP and DWD. Both of them allow to specify only equality linear constraints. Do you know if there is a library to solve this problem: second order cone programming with inequality liner constraints excluding mosek

[R] Averaging within a range of values

2012-01-13 Thread doggysaywhat
Hello all. I have two data frames. Group Start End G1 200 700 G2 500 1000 G3 20003000 G4 40006000 G5 70008000 and Pos

Re: [R] simulating stable VAR process

2012-01-13 Thread statquant2
Hello Paul Thanks for the answer but my point is not how to simulate a VAR(p) process and check that it is stable. My question is more how can I generate a VAR(p) such that I already know that it is stable. We know a condition that assure that it is stable (see first message) but this is not a

[R] GLHT in multcomp: Two similar models, one doesn't work

2012-01-13 Thread gaiarrido
i ran this model model2-glm(rojos~ageandsex+sector+season+sector:season,quasipoisson) glht(model2,linfct=mcp(ageandsex=Tukey)) General Linear Hypotheses Multiple Comparisons of Means: Tukey Contrasts Linear Hypotheses: Estimate M - H == 0 0.2898 SUB - H == 0

Re: [R] colored outliers

2012-01-13 Thread Geophagus
Hi Justin, it still does not work. All points become red. I use this skript with your modifications: TOC_NI-read.csv2(C:/Users/hilliges/Desktop/Master/Daten/Statistik/TOC-NI.csv, sep=;, dec=,, encoding=UTF-8) circ-TOC_NI[order(TOC_NI$NI,decreasing=T),][1:4,] plot(NI~TOC,data=TOC_NI,col=blue,

Re: [R] Help needed in interpreting linear models

2012-01-13 Thread mails
Hi Petr, thanks for your answer. First of all it's not homework I am a student and need to analyse cancer data using linear models. I looked into that topic since a week now and still struggling in interpreting some of the R output that is why I was asking for help here. I don't quite

[R] apply transformation

2012-01-13 Thread santosh
Hello All, I have the following dataset: Year 2006 2007 Jan Jan 0.0204 0.0065 Feb Feb 0.0145 0.0082 Mar Mar 0.0027 0.0122 dput(d_tmp) structure(list(Year = c(Jan, Feb, Mar), `2006` = c(0.0204, 0.0145, 0.0027), `2007` = c(0.0065, 0.0082, 0.0122)), .Names = c(Year, 2006, 2007),

[R] read.table as integer

2012-01-13 Thread Francisco
Hello, I have a csv file with many variables, both characters and integers. I would like to load it on R and do some operations on integer variables, the problem is that R loads the entire dataset considering all variables as characters, instead I would like that R makes the distinction

[R] Problems with plotCI

2012-01-13 Thread Lasse DSR-mail
Got problems with plotCI (plotrix) I only want to plot the upper part of the error bar in my barplot I had the exact same commands working two months ago Now I wanted to change the legend and when I ran it again plotCI stopped working. To me it seems like there must some bug in R

Re: [R] colored outliers

2012-01-13 Thread Petr PIKAL
Hi what do you want to achieve? Hi Justin, it still does not work. All points become red. I use this skript with your modifications: TOC_NI-read.csv2(C:/Users/hilliges/Desktop/Master/Daten/Statistik/TOC-NI.csv, sep=;, dec=,, encoding=UTF-8)

Re: [R] Help needed in interpreting linear models

2012-01-13 Thread Petr PIKAL
I forgot to post it to r help. Petr Hi Hi Petr, thanks for your answer. First of all it's not homework I am a student and need to analyse cancer data using linear models. I looked into that topic since a week now and still struggling in interpreting some of the R output that is why

Re: [R] analytical solution of partial differential equation

2012-01-13 Thread Ben Bolker
ATANU ata.sonu at gmail.com writes: i am trying to solve a partial differential equation analytically(PDE) in R . i have found some functions that do the stuff numerically. But that will not meet my purpose. is there any function to solve PDE analytically. please help. With extremely

Re: [R] strange Sys.Date() side effect

2012-01-13 Thread Czerminski, Ryszard
Basically I want to create a string vector where first element is a date. Note that if you supply c() with objects of different types (as you have), the results will probably not be what you wanted. This is the key. I assumed (not correctly) that Sys.Date() generates a character Sys.Date()

Re: [R] read.table as integer

2012-01-13 Thread David Winsemius
On Jan 13, 2012, at 7:02 AM, Francisco wrote: Hello, I have a csv file with many variables, both characters and integers. I would like to load it on R and do some operations on integer variables, the problem is that R loads the entire dataset considering all variables as characters,

Re: [R] read.table as integer

2012-01-13 Thread Gabor Grothendieck
On Fri, Jan 13, 2012 at 7:02 AM, Francisco franciscororol...@google.com wrote: Hello, I have a csv file with many variables, both characters and integers. I would like to load it on R and do some operations on integer variables, the problem is that R loads the entire dataset considering all

[R] IF ELSE

2012-01-13 Thread jost87
Can somebody explain the problem in the following expression? Thank you / if (species == 1){ + fitness - (1-b)*exp(-((microsites-niche.preference)/(niche.width.specialist+a.specialist)^2)*(1-a.specialist) + }else Error: unexpected '}' in: fitness -

[R] function to replace values doesn't work on vectors

2012-01-13 Thread WoutH
I've got a numeric vector with values ranging from 1 to 5, I would like to catagorize these values like this: 1 becomes catagory 1 3 becomes catagory 3 And everything else in catagory 2. The simple function I wrote beneath works for single numeric data, but for some reason I am unable to feed it

Re: [R] IF ELSE

2012-01-13 Thread Joshua Wiley
Hi jost87, Try using a good text editor with syntax highlighting and parenthesis/brace matching (personal preference is Emacs + ESS, others like Rstudio, and there are tons more). I find at least one mismatched pair of parentheses/braces in those expressions. Cheers, Josh On Fri, Jan 13, 2012

Re: [R] How can I prevent solve.QP from printing the solution progress ?

2012-01-13 Thread Uzuner, Tolga I
Many thanks all, Tolga -Original Message- From: Chibisi Chima-Okereke [mailto:cchima-oker...@mango-solutions.com] Sent: 12 January 2012 17:14 To: Uzuner, Tolga I Cc: Jack Teall; Richard Pugh Subject: RE: How can I prevent solve.QP from printing the solution progress ? Try something like

Re: [R] Averaging within a range of values

2012-01-13 Thread Jeff Newmiller
Regarding your last question, read ?cut --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] function to replace values doesn't work on vectors

2012-01-13 Thread Sarah Goslee
I don't see any signs of a simple function, but I'd use ifelse(). y - ifelse(x == 1, 1, ifelse(x == 3, 3, 2)) or some such. (Lack of reproducible example means lack of actual testing.) Sarah On Fri, Jan 13, 2012 at 9:11 AM, WoutH w.denhollan...@lumc.nl wrote:  I've got a numeric vector with

[R] Troubles with stemming (tm + Snowball packages) under MacOS

2012-01-13 Thread Julien Velcin
Dear all, I have some troubles using the stemming algorithm provided by the tm (text mining) + Snowball packages. Here is my config: MacOS 10.5 R 2.12.0 / R 2.13.1 / R 2.14.1 (I have tried several versions) I have installed all the needed packages (tm, rJava, rWeka, Snowball) +

[R] Quantiles in boxplot‏

2012-01-13 Thread René Brinkhuis
Hi, I have a simple question about quartiles in R, especially how they are calculated using the boxplot. Quartiles (.25 and .75) in boxplot are different from the summary function and also don't match with the 9 types in the quantile function. See attachment for details. Can you give me the

[R] access/row access/col access

2012-01-13 Thread statquant2
Hello, I have a data.frame and I want to transfor it in a list of rows or columns. I can do apply(myDataFrame,MARGIN=1,FUN=???) I remember that there is a function which mean return or access column ... something like :: or ], or [, I can't remember can somebody refresh my memory? -- View this

Re: [R] Quantiles in boxplot‏

2012-01-13 Thread Sarah Goslee
The explanation is in ?boxplot.stats (as the help for boxplot states). Details: The two ‘hinges’ are versions of the first and third quartile, i.e., close to ‘quantile(x, c(1,3)/4)’. The hinges equal the quartiles for odd n (where ‘n - length(x)’) and differ for even n.

Re: [R] access/row access/col access

2012-01-13 Thread Sarah Goslee
I have to admit, I have very little idea what you are trying to do. Can you provide an example? In general, the i-th column of a data frame can be accessed with mydataframe[, i] but that doesn't help with whatever you want to do with apply(). Sarah On Fri, Jan 13, 2012 at 10:45 AM, statquant2

Re: [R] Odp: Remove space from string

2012-01-13 Thread Bos, Roger
I have NO knowledge of regexpr, but someone helped me out once and I put it into a function I call trim. Here is the line I use: function(x) gsub(^[[:space:]]+|[[:space:]]+$, , x) One more thing you can try. Hope it helps, Roger -Original Message- From: r-help-boun...@r-project.org

[R] plotting regression line in with lattice

2012-01-13 Thread matteo dossena
#Dear All, #I'm having a bit of a trouble here, please help me... #I have this data set.seed(4) mydata - data.frame(var = rnorm(100), temp = rnorm(100), subj = as.factor(rep(c(1:10),5)), trt = rep(c(A,B), 50)) #and this model that

Re: [R] function to replace values doesn't work on vectors

2012-01-13 Thread Berend Hasselman
WoutH wrote I've got a numeric vector with values ranging from 1 to 5, I would like to catagorize these values like this: 1 becomes catagory 1 3 becomes catagory 3 And everything else in catagory 2. The simple function I wrote beneath works for single numeric data, but for some reason I

Re: [R] access/row access/col access

2012-01-13 Thread Jeff Newmiller
http://cran.r-project.org/doc/manuals/R-intro.pdf --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

[R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread Matthew Pettis
Hi, I'm trying to install R from an rpm locally to my account (the reason I'm not doing it through yast/yast2/zypper is that the sys admin isn't yet willing to install it, and doesn't want to support it, but will help me support it if I install it locally -- in short, policy problems rather than

[R] Nabble? Was Re: function to replace values doesn't work on vectors

2012-01-13 Thread Sarah Goslee
Interesting: The email I received through the R-help list didn't have all the information that was apparently there: On Fri, Jan 13, 2012 at 11:32 AM, Berend Hasselman b...@xs4all.nl wrote: WoutH wrote I've got a numeric vector with values ranging from 1 to 5, I would like to catagorize

[R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
Dear Rers, is there a way to color counties on a full US map based on a criterion one establishes (i.e., all counties I assign the same number should be the same color)? I explored a bit and looks like the package maps might be of help. library(maps) One could get a map of the US: map('usa') One

Re: [R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread Gavin Blackburn
I think it's saying you need to install R-base before R-base-devel. You'll need to add a cran repository as SUSE might not have the most up-to-date version of R. This is the code for Ubuntu I assume it's the same, just change the distro and keyserver: sudo apt-get update sudo

Re: [R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread Matthew Pettis
Thanks, will do! I thought devel included base, but evidently, that's not the case... On Fri, Jan 13, 2012 at 10:58 AM, Gavin Blackburn gavin.blackb...@strath.ac.uk wrote: I think it's saying you need to install R-base before R-base-devel. You'll need to add a cran repository as SUSE might

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Sarah Goslee
Hi, You've just about got it. See below. On Fri, Jan 13, 2012 at 11:52 AM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Dear Rers, is there a way to color counties on a full US map based on a criterion one establishes (i.e., all counties I assign the same number should be the

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
Sarah, this is amazing, thank you so much. One question: I am trying to do for the whole US (on one map) what you've helped me do for Iowa. In other words, I would like to create a file of inputs like you countycol with 1,000+ lines - for all US counties (probably without Hawaii and Alaska,

Re: [R] access/row access/col access

2012-01-13 Thread R. Michael Weylandt michael.weyla...@gmail.com
Like Sarah said, what you say below makes very little sense, but as a total shot in the dark, is this what you mean? lapply(1:nrow(df), function(i) x[i,] ) Michael On Jan 13, 2012, at 11:15 AM, Sarah Goslee sarah.gos...@gmail.com wrote: I have to admit, I have very little idea what you are

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Sarah Goslee
On Fri, Jan 13, 2012 at 12:15 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Sarah, this is amazing, thank you so much. One question: I am trying to do for the whole US (on one map) what you've helped me do for Iowa. In other words, I would like to create a file of inputs like

[R] Portfolio Optimization

2012-01-13 Thread Sal Pellettieri
Hi, I'm an R newbie and I've been struggling with a optimization problem for the past couple of days now. Here's the problem - I have a matrix of expected payouts from different stock option strategies. Each column in my matrix represents a different stock and each row represents the return to

[R] Brillouin index

2012-01-13 Thread Philipp Fischer
Dear colleagues. I wonder if anybody knows about a procedure in R to calculate the Brillouin Diversity index. I searched the net but did not find anything about it. Thanks a lot for any help Best, Philipp *** Prof. Dr. Philipp Fischer Head of

[R] tm package, custom reader

2012-01-13 Thread pl.r...@gmail.com
I need help with creating custom xml reader for use with the tm package. The objective is to crate a corpus for analysis. Files that I'm working with come from solr and are in a funky XML format never the less I'm able to parse the XML files using solrDocs.R function provided by Duncan Temple

Re: [R] meta-analysis normal quantile plot metafor

2012-01-13 Thread Michael Dewey
At 15:53 11/01/2012, Ricc wrote: Hello, I once used the metawin software to perform a meta-analysis (see metawinsoft, Rosenberg et al.) and produced normal qqplot to test for a potential bias in the dataset. I now want to re-use the same dataset with the package metafor by W. Viechtbauer (great

[R] fUtilities removed

2012-01-13 Thread Dominic Comtois
When setting up my new machine, I had the surprise to see that Package 'fUtilities' was removed from the CRAN repository. This is problematic for my work. I use many of its functions, and it will complicate things a lot if other programmers want to use my previous code in the future. Plus,

Re: [R] GLHT in multcomp: Two similar models, one doesn't work

2012-01-13 Thread gaiarrido
Nobody? - Mario Garrido Escudero PhD student Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola Universidad de Salamanca -- View this message in context: http://r.789695.n4.nabble.com/GLHT-in-multcomp-Two-similar-models-one-doesn-t-work-tp4291875p4292889.html Sent

Re: [R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread Marc Schwartz
Two things: 1. Looking at the sizes of the RPMs at the URL provided, the 'R-base-devel' RPM is only 84k. So as with other Linux distros, that is likely to contain R header files and other such things to enable compilation of CRAN packages during their installation using the source tarballs.

[R] multidimensional array calculation

2012-01-13 Thread Johannes Radinger
Hello, probably it is quite easy but I can get it: I have mulitple numeric vectors and a function using all of them to calculate a new value: L - c(200,400,600) AR - c(1.5) SO - c(1,3,5) T - c(30,365) fun - function(L,AR,SO,T){ exp(L*AR+sqrt(SO)*log(T)) } How can I get an array or

Re: [R] access/row access/col access

2012-01-13 Thread David Winsemius
On Jan 13, 2012, at 10:45 AM, statquant2 wrote: Hello, I have a data.frame and I want to transfor it in a list of rows or columns. I can do apply(myDataFrame,MARGIN=1,FUN=???) I remember that there is a function which mean return or access column ... something like :: or ], or [, I

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
Thank you somuch, Sarah. I tried, and it's working just wonderfully (code below). One last question, if I may: is it possible to get rid of borders between counties (just leave the fill)? I did not find this argument in help... Thank you! Dimitri ### My criterion for all counties.:

[R] Merging data XXXX

2012-01-13 Thread Dan Abner
Hello everyone, I have 1 data frame (just a vector in the example below) with 12 individuals listed and a separate vector of 36 days (in week intervals). What is the best way to merge these together so that each individual (specialist here) has all 36 days matched with their specialist number (a

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
Just to clarify, according to help about the fill argument: logical flag that says whether to draw lines or fill areas. If FALSE, the lines bounding each region will be drawn (but only once, for interior lines). If TRUE, each region will be filled using colors from the col = argument, and bounding

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Sarah Goslee
On Fri, Jan 13, 2012 at 1:41 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Thank you somuch, Sarah. I tried, and it's working just wonderfully (code below). One last question, if I may: is it possible to get rid of borders between counties (just leave the fill)? I did not find

Re: [R] fUtilities removed

2012-01-13 Thread David Winsemius
On Jan 13, 2012, at 12:33 PM, Dominic Comtois wrote: When setting up my new machine, I had the surprise to see that Package 'fUtilities' was removed from the CRAN repository. https://stat.ethz.ch/pipermail/rmetrics-core/2012-January/000554.html

Re: [R] Merging data XXXX

2012-01-13 Thread Marc Schwartz
On Jan 13, 2012, at 12:42 PM, Dan Abner wrote: Hello everyone, I have 1 data frame (just a vector in the example below) with 12 individuals listed and a separate vector of 36 days (in week intervals). What is the best way to merge these together so that each individual (specialist here)

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Sarah Goslee
On Fri, Jan 13, 2012 at 1:52 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Just to clarify, according to help about the fill argument: logical flag that says whether to draw lines or fill areas. If FALSE, the lines bounding each region will be drawn (but only once, for

Re: [R] Merging data XXXX

2012-01-13 Thread David Winsemius
On Jan 13, 2012, at 1:42 PM, Dan Abner wrote: Hello everyone, I have 1 data frame (just a vector in the example below) with 12 individuals listed and a separate vector of 36 days (in week intervals). What is the best way to merge these together so that each individual (specialist here) has

Re: [R] grplasso

2012-01-13 Thread Scott Raynaud
So does anyone use this package?   - Original Message - From: Scott Raynaud scott.rayn...@yahoo.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Tuesday, January 10, 2012 1:40 PM Subject: grplasso I want to use the grplasso package on a data set where I want to fit a linear

Re: [R] multidimensional array calculation

2012-01-13 Thread Jean V Adams
See ?expand.grid For example, df - expand.grid(L=L, AR=AR, SO=SO, T=T) df$y - fun(df$L, df$AR, df$SO, df$T) Jean Johannes Radinger wrote on 01/13/2012 12:28:46 PM: Hello, probably it is quite easy but I can get it: I have mulitple numeric vectors and a function

Re: [R] multidimensional array calculation

2012-01-13 Thread R. Michael Weylandt
Perhaps repeated use of the outer() function. You could also write a multi.outer() or adopt one of the solutions here: http://stackoverflow.com/questions/6192848/how-to-generalize-outer-to-n-dimensions Michael On Fri, Jan 13, 2012 at 1:28 PM, Johannes Radinger jradin...@gmx.at wrote: Hello,

Re: [R] plotting regression line in with lattice

2012-01-13 Thread Weidong Gu
Hi, Since trt is a factor, you use it for indexing. try just delete in the code fill - my.fill[combined$trt[subscripts]] Weidong Gu On Fri, Jan 13, 2012 at 11:30 AM, matteo dossena m.doss...@qmul.ac.uk wrote: #Dear All, #I'm having a bit of a trouble here, please help me... #I have this data

Re: [R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread Ken Hutchison
apt-get wont run on Suse unless you have aptitude, also your distribution won't compile a deb without some intervention. You won't be able to query the package regardless of key if your local proxy settings won't let you because of admin. Perhaps see if there is a tool to convert the deb

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
But the help does say that additional arguments are passed to lines(), so you can use lty=0. That can leave white bits between counties if the areas don't line up precisely, so I think it looks better with the lines in black. I agree, indeed it leaves white bits. Of course, I could try to

Re: [R] apply transformation

2012-01-13 Thread Jean V Adams
Try this: d_tmp2 - data.frame(apply(round(100*d_tmp[, -1], 2), 2, paste, %, sep=)) names(d_tmp2) - paste(names(d_tmp[, -1]), Lbl, sep=-) d_final - cbind(d_tmp, d_tmp2) d_final[, 1+c(0, order(names(d_final[, -1])))] Jean santosh wrote on 01/13/2012 04:55:51 AM: Hello All, I have the

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Sarah Goslee
Changing the color of the borders is what the border argument to polygon() would do, if only it hadn't been overridden. So no, you can't easily change the line color. It would be an easy tweak to the code to add a polyborder argument that is passed to polygon() as border, though. That would solve

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread David L Carlson
You can set the fg graphics parameter, for example oldpar - par(fg='white') # change the default fg (foreground color) to white map('county', 'iowa', fill=TRUE, col='light gray') oldpar # reset fg to the default - black map('state', 'iowa', lwd=3, add=TRUE) Assuming you want the state outline in

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
Sarah, David, thank you very much for your help! It all works now: ### My criterion for all counties: allcounties-data.frame(county=map('county', plot=FALSE)$names) allcounties$group-c(rep(1:6,513),rep(1,4))[order(c(rep(1:6,513),rep(1,4)))] ### My colors: classcolors - rainbow(6) ### For gray

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Ray Brownrigg
On 14/01/2012 8:04 a.m., Sarah Goslee wrote: On Fri, Jan 13, 2012 at 1:52 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Just to clarify, according to help about the fill argument: logical flag that says whether to draw lines or fill areas. If FALSE, the lines bounding each

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Sarah Goslee
Hi Ray, I'm glad to see you here. I was going to write this up a bit more clearly and email it to you, but now I don't have to bother. :) Coincidentally, I became aware of this just recently.  When the maps package was created (way back in the 'new' S era), polygon() didn't add borders, and

Re: [R] Portfolio Optimization

2012-01-13 Thread Enrico Schumann
I would be biased towards using a heuristic, for instance Threshold Accepting (TA), for solving such a problem. (TA is implemented in package NMOF. Disclosure: I am the author of that package.) But you will not find a ready-to-use solution there. (1) you need an objective function, ie, a

Re: [R] Averaging within a range of values

2012-01-13 Thread doggysaywhat
Hello Jeff, thank you for the reply. I tried the cut function and I had two questions. How do I have the cut function take the first position in the start column in df1 as the first cut point and the first position in column 2 as the second cut point. The break variable seems to want a single

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
Everyone, thanks a lot - this is great: ### My criterion for all counties: allcounties-data.frame(county=map('county', plot=FALSE)$names) allcounties$group-c(rep(1:6,513),rep(1,4))[order(c(rep(1:6,513),rep(1,4)))] ### My colors: classcolors - rainbow(6) ### 1. If I want to have no borders

Re: [R] Coloring counties on a full US map based on a certain criterion

2012-01-13 Thread Dimitri Liakhovitski
Somewhat related question out of curiousity: Does anyone know how often the list of the counties and county names is updated in this package? Or is it done centrally for all packages that deal with US counties? Thanks! Dimitri On Fri, Jan 13, 2012 at 3:41 PM, Ray Brownrigg

Re: [R] Problem Installing R to SuSE 10 via RPM

2012-01-13 Thread peter dalgaard
On Jan 13, 2012, at 17:43 , Matthew Pettis wrote: Hi, I'm trying to install R from an rpm locally to my account (the reason I'm not doing it through yast/yast2/zypper is that the sys admin isn't yet willing to install it, and doesn't want to support it, but will help me support it if I

[R] deviance and variance - GAM models

2012-01-13 Thread collifu
Hi all, This is pretty basic but I am not an expert and I couldn't find anything in the forum or my statistics book about it. I was reading a paper and the authors were using both explained deviance and explained variance as synonyms. They were describing a GAM regression. Is that right? I

[R] outputs from command by

2012-01-13 Thread Hai Lin
Hello R experts, I have generated a data set below. I tried to export the object - my.pvalues (class is by) as .txt (or excel file), so the output in matrix form line up nicely in .xls file. Do I have to convert to some other data formats before using write.table? I am having difficulty to

[R] Help with t student test

2012-01-13 Thread elisacarli21
Dear all, I've the following data.frame GENDER MEASURE01 MEASURE02 MEASURE03 MEASURE04 MEASURE05 MEASURE06 R. Rafuse MALE 91 6 8 12

[R] The Future of R | API to Public Databases

2012-01-13 Thread Benjamin Weber
Dear R Users - R is a wonderful software package. CRAN provides a variety of tools to work on your data. But R is not apt to utilize all the public databases in an efficient manner. I observed the most tedious part with R is searching and downloading the data from public databases and putting it

Re: [R] Averaging over data sets

2012-01-13 Thread MacQueen, Don
Here is a solution that works for your small example. It might be difficult to prepare your larger data sets to use the same method. db -rbind(d1,d2) aggregate(subset(db,select=-c(subject,trt)), by=list(subject=db$subject),mean) ## or, for example, aggregate(subset(db,select=-c(subject,trt)),

Re: [R] The Future of R | API to Public Databases

2012-01-13 Thread Sarah Goslee
R is Open Source. You're welcome to write tools, and submit your package to CRAN. I think some part of this has been done, based on questions to the list asking about those parts. Personally, I've been using S-Plus and then R for 18 years, and never required data from any of them. Which doesn't

[R] Regression Modeling Strategies 3-Day Short Course March 2012

2012-01-13 Thread Frank Harrell
*RMS Short Course 2012* Frank E. Harrell, Jr., Ph.D., Professor and Chair Department of Biostatistics, Vanderbilt University School of Medicine *March 7, 8 9, 2012* 8:00am - 4:30pm Vanderbilt University Nashville Tennessee USA http://biostat.mc.vanderbilt.edu/RMSShortCourse This

  1   2   >