Re: [R] foreign package read.spss() and NA levels

2021-06-08 Thread Allen, Justin
he problem was in the dataset as I said. Many Thanks, Justin Justin Allen Housing Consultant, BRE<https://bregroup.com/> T: 07807122647 From: Uwe Ligges Sent: 04 June 2021 10:57 To: Allen, Justin ; R-help@r-project.org Cc: Whiteley, Jonathon ; Foster, Helen Subject:

[R] foreign package read.spss() and NA levels

2021-05-27 Thread Allen, Justin
a few months ago. None of the arguments in read.spss() seem to also stop this behaviour. I am currently on the most recent version of both R and the package, as of 27/05/21, and am using RStudio Version 1.4.1106. Any thoughts? Many Thanks, Justin Allen p.s. your continued maintenance and additions to

[R] Opportunities for Developing R Packages (Research-Based, Open-Source)

2019-04-22 Thread Justin Thong
internship in experimental design, linear algebra and data compression, particle filters and bayes analyses). I do not expect to be paid and am willing to commit to a project. Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK

[R] igraph problem

2017-09-19 Thread Justin Thong
vertex names) or some index of each individual branch in tree. Does anyone have any ideas on how to do this? Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419 <07938%20674419>(UK) or +60125056192 <+60%201

[R] rmutil parameters for Pareto distribution

2017-08-24 Thread Justin Thong
on the wikipedia link? Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +60125056192(Malaysia)* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Kernel Density Estimation: Generate a sample from Epanechnikov Kernel

2017-03-21 Thread Justin Thong
I am however interested in generating a kernel density estimate with an Epanechnikov kernel fit<-density(data,kernel = "epanechnikov") #is there a quick way to compute the samples and INCORPORATING THE BANDWIDTH of the #kernel density estimate Yours sincerely, Justin *I check my ema

[R] Hmisc::latex and the use of \phantom

2016-10-29 Thread Justin Bem
Dear all, Is it possible to avoid the use of \phantom with latex function ? when I run latex(latex=FALSE,…) I get an error message. When I use Format(big.mark= ‘’ ‘’) the result appear correct in R console but not in Latex code. Is it a way to combine numprint with latex ? col.just=

Re: [R] Using apply on a three dimensional matrix and passing multiple arguments to user defined function

2016-09-08 Thread Justin Peter
would extend to using my mask function. Anyway, thanks again for both of your help. Cheers, Justin -- Justin Peter Research Fellow International Centre for Applied Climate Sciences, University of Southern Queensland West St, Toowoomba, QLD, 4350 Australia Email: justin.pe...@usq.

[R] Using apply on a three dimensional matrix and passing multiple arguments to user defined function

2016-09-07 Thread Justin Peter
ssing? Thanks in advance for you help. Kind regards, Justin -- Justin Peter Research Fellow International Centre for Applied Climate Sciences, University of Southern Queensland West St, Toowoomba, QLD, 4350 Australia Email: justin.pe...@usq.edu.au<mailto:justin.pe...@usq.edu.au> Ph: +61

Re: [R] Estimated Effects Not Balanced

2016-08-23 Thread Justin Thong
t; > A 1 1.553 1.553 1.334 0.281 > > B2 3.158 1.579 1.357 0.311 > > Residuals8 9.311 1.164 > > > > On Mon, Aug 22, 2016 at 11:15 AM, Justin Thong <justinthon...@gmail.com> > wrote: > >> Something does not make sen

[R] Estimated Effects Not Balanced

2016-08-22 Thread Justin Thong
= y ~ A + B)* *Terms:* *A B Residuals* *Sum of Squares 0.872572 0.025604 16.805706* *Deg. of Freedom 1 210* *Residual standard error: 1.296368* *Estimated effects may be unbalanced* -- Yours sincerely, Justin *I check my email at 9AM and 4PM

[R] Intercept in Model Matrix (Parameters not what I expected)

2016-08-21 Thread Justin Thong
1 1 0 0 0 1 0 0 7 1 1 0 0 0 0 0 1 8 1 1 0 0 0 0 0 1 -- Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +60

[R] RJDBC - Java connection to Oracle database crashing on execution

2016-08-19 Thread Justin Holder
Hi, I have a script that starts with some code to open a connection to an Oracle database, however the code is crashing R/RStudio as soon as it runs. The code does run successfully on another machine. The script opens by loading the required RJDBC package: library("RJDBC", lib.loc="C:/Program

[R] What is "args" in this function?

2016-08-02 Thread Justin Thong
[(5,6)] etc Is this correct? I am sorry if I am asking too many questions on C. Please advise if I am posting inappropriately. -- Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +601

[R] Ways to understand C code (like debug function)

2016-08-01 Thread Justin Thong
mands in C that anyone knows about.* -- Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +60125056192(Malaysia)* [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] Reference for aov()

2016-07-27 Thread Justin Thong
decomposition into > error strata becomes nonsensical otherwise. If you do have a balanced > design, the error strata reduce to simple combinations of means and > observation, so the aov() algorithm is quite inefficient, but to my > knowledge nobody has bothered to try and do better. >

[R] Linear Dependance of Model Matrix and How Fitted/ Sums of Squares Follow

2016-07-26 Thread Justin Thong
test3)* Df Sum Sq Mean Sq F value Pr(>F) F1 0.0479 0.0479 0.059 0.830 G2 0.9762 0.4881 0.604 0.624 Residuals 2 1.6175 0.8087 -- Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me

[R] Soft Question: Where to find this reference.

2016-07-25 Thread Justin Thong
, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +60125056192(Malaysia)* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] Missing rows anova

2016-07-20 Thread Justin Thong
in ID. Does this makes sense? On 19 July 2016 at 16:19, Michael Dewey <li...@dewey.myzen.co.uk> wrote: > Presumably it disappears because there is a unique value of ID for eac > combination of S*x1 so they are indistinguishable. > > > On 19/07/2016 12:53, Justin Thong wro

[R] Missing rows anova

2016-07-19 Thread Justin Thong
0 DEF 162 3 0 DEF 163 3 0 DEF 164 3 0 DEF -- Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK) or +60125056192(Malaysia)* [[alternative HTML version dele

[R] Reference for aov()

2016-07-13 Thread Justin Thong
in finding out about how R computes ~x1:x2:x3 or how R computes ~A:x1 emphasizing sequential nature of the way it computes, and models even more complicated than this. Yours sincerely, Justin *I check my email at 9AM and 4PM everyday* *If you have an EMERGENCY, contact me at +447938674419(UK

[R] General copula model with heterogeneous marginals

2015-11-30 Thread Justin Balthrop
I am looking to model the sum of a number of random variables with arbitrary gamma distributions and an empirical dependence structure that I obtain from data. Basically I observe all of the individual pieces but I want to model their sum, as opposed to many copula questions which

[R] Limiting state probability for Markov chain

2015-04-28 Thread Justin USHIZE RUTIKANGA
and only the first element will be used your help will be appreciate Best Regard Ushize Rutikanga Justin Student at African Institute for Mathematical Sciences (AIMS) South Africa E-mail:justinush...@aims.ac.za Tel:+27717029144 [[alternative HTML version deleted

[R] Awaiting feedback/moderation (Re: Non-convergence in boot.stepAIC function with a logit model)

2014-05-26 Thread Justin Michell
Hi I posted a question to this list, and received an email indicating that it is awaiting moderation. However I have not received any feedback yet. If the question is not appropriate, I’d like to know where or how I should post differently, if possible. Thanks and Regards Justin Michell

[R] Non-convergence in boot.stepAIC function with a logit model

2014-05-22 Thread Justin Michell
- boot.stepAIC(fit.5, spatialVars, direction = forward, alpha = 0.05, B = 1000) Thanks very much (for any help, advice or thoughts) Justin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Maintaining data order in factanal with missing data

2013-07-26 Thread Justin Delahunty
to subset the overall data set into the three waves, then conduct the factor analysis on each (1 factor CFA); it's just in a function to ease re-typing in a new workspace. Thanks, Justin -Original Message- From: PIKAL Petr [mailto:petr.pi...@precheza.cz] Sent: Friday, 26 July 2013 7:35 PM

Re: [R] Maintaining data order in factanal with missing data

2013-07-26 Thread Justin Delahunty
($dmid) which I had thought to use when merging the new variables, however I don't know how to implement this. Thanks for your help, Justin -Original Message- From: PIKAL Petr [mailto:petr.pi...@precheza.cz] Sent: Friday, 26 July 2013 10:59 PM To: Justin Delahunty; Justin Delahunty; r

[R] R CMD check package mypkg-Ex.R failed

2013-06-01 Thread Justin
examples Execution halted My question: How to correct the above error? Thanks, Justin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] Getting a vector result from a computed index

2013-03-22 Thread Justin Long
I need to be able to loop through the results vector and compare the previous/next items in the list to the current one. Is that possible? What am I missing? Cordially, Justin Long __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] two phases sampling

2013-01-10 Thread justin bem
is y=y1+y2. So the variance of y is v(y)=v(y1)+v(y2)+cov(y1,y2). Sampling theory indicate how to compute v(y1) and v(y2) but how can I compute cov(y1,y2) ? Can the survey package help me for that ?   Justin BEM BP 1917 Yaoundé Tél (237) 76043774 [[alternative HTML version deleted

Re: [R] How do anova() and Anova(type=III) handle incomplete designs?

2012-06-18 Thread Justin Montemarano
comparable, considering your response. I am still confused about interpretation of interactions within an anova() with an incomplete design, as mine is. Is the interaction term still informative? - Justin Montemarano Graduate Student Kent State University - Biological Sciences http

[R] How do anova() and Anova(type=III) handle incomplete designs?

2012-06-15 Thread Justin Montemarano
0.27493 leaf.species:cond.time 0.568 1 0.8462 0.35888 day:leaf.species:cond.time 1.915 1 2.8539 0.09293 Residuals 118.091 176 - Justin Montemarano Graduate Student Kent State University - Biological Sciences http://www.montegraphia.com http

[R] Violation of sample independence in Pearson's product-moment correlation

2012-06-01 Thread Justin Montemarano
for Pearson's test, and I should have had only 7 points, which would reflect the means of my two variables for each individual animal across 10 days. Is this appropriate or is there a means of accounting for repeated sampling with a correlation test? - Justin Montemarano Graduate Student Kent State

[R] [R-pkgs] ANN: bigml package for R bigml_0.1.tar.gz

2012-05-09 Thread Justin Donaldson
the R community to easily take advantage of our highly scalable cloud based machine learning infrastructure, while using familiar R data structures and workflows. Apologies for sending this e-mail a bit late. Best, -Justin -- blog: http://www.scwn.net aim: iujjd twitter: jjdonald

[R] Deleting observations from baseline that don't appear in follow up

2012-04-27 Thread justin jarvis
again. Obviously baseline-baseline[-2,] won't cut it here, since in my data set I have thousands of people. Thanks in advance Justin [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] system command to a specific shell (bash)

2012-04-16 Thread Justin Haynes
... Any help is appreciated, Justin sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8LC_PAPER=C

Re: [R] system command to a specific shell (bash)

2012-04-16 Thread Justin Haynes
Research Engineer (Solar/BatteriesO.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Justin Haynes jto

Re: [R] A little exercise in R!

2012-04-14 Thread Justin Haynes
Since I thought this was a cool question, I posted it to StackOverflow. Vincent Zookynd's answer is amazing and really exercises the power of R. http://stackoverflow.com/questions/10150161/ordering-117-by-perfect-square-pairs/10150797#10150797 On Fri, Apr 13, 2012 at 10:06 PM, Bert Gunter

Re: [R] A little exercise in R!

2012-04-13 Thread Justin Haynes
I thought this was kinda cool! Here's my solution, its not robust or probably efficient I'd to hear improvements or other solutions! Justin sq.test - function(a, b) { ## test for number pairs that sum to squares. sqrt(sum(a, b)) == floor(sqrt(sum(a, b))) } ok.pairs - function(n, vec

Re: [R] Remove carriage return in writing tab-delimited file.

2012-04-04 Thread Justin Haynes
take a look at ?paste paste(yourmatrix, sep='\t', collapse='') On Wed, Apr 4, 2012 at 2:58 PM, kickout plant.breeding.cr...@gmail.com wrote: Having problems with the write.table function. I can write a tab delimited file just fine, but for each line in my matrix its inputs a carriage return

Re: [R] sampling rows from a list

2012-04-02 Thread Justin Haynes
i apologize... Hope that helps, Justin On Mon, Apr 2, 2012 at 11:24 AM, Bcampbell99 briand.campb...@ec.gc.ca wrote: Hi: I'm sure this seems like a rudimentary question, but I am not well versed with R syntax for lists.  I have a ragged array from which I've removed records (entire rows

Re: [R] list assignment syntax?

2012-03-30 Thread Justin Haynes
You can also take a look at http://stackoverflow.com/questions/7519790/assign-multiple-new-variables-in-a-single-line-in-r which has some additional solutions. On Fri, Mar 30, 2012 at 4:49 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2012-03-30 15:40, ivo welch wrote: Dear R wizards:  is

Re: [R] scanning data into r

2012-03-28 Thread Justin Haynes
What have you tried? What type of file are you trying to import from? What do you want your data to look like in R? take a look at ?read.table and ?readLines On Wed, Mar 28, 2012 at 11:23 AM, joel.green joel.gr...@live.co.uk wrote: Hey I am having trouble importing data into R, my data

Re: [R] Why does this work? plyr within-subset normalization

2012-03-28 Thread Justin Haynes
To those without access to nabble, the code in reference is: relative - ddply(ranktable, .(Timestamp), function(x) data.frame(relative = x[,5]/max(x[,5]))) I may be misunderstanding your question, but: ddply splits your data.frame, ranktable, by the column Timestamp into many smaller

Re: [R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Justin Haynes
In most regexs the carrot( ^ ) signifies the start of a line and the dollar sign ( $ ) signifies the end. gsub('^S S', 'S', a) gsub('^S S', 'S', '3421 BIGS St') you can use logical or inside your pattern too: gsub('^S S|S S$| S S ', 'S', a) the S S condition is difficult. gsub('^S S|S S$|

Re: [R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Justin Haynes
Interstate 95, 3421 BIGS St)   gsub(\\S S\\, S, addresses)  [1] S Main St Interstate 95 3421 BIGS St Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Justin Haynes

Re: [R] Convert day of year back into a date format.

2012-03-27 Thread Justin Haynes
There may very well be a better solution, but this works. format(strptime(dayofyear, format=%j), format=%m-%d) On Tue, Mar 27, 2012 at 11:12 AM, Sam Albers tonightstheni...@gmail.comwrote: Hello, I am having trouble figuring out how to convert a Day of Year integer back into a Date format.

[R] Unable to specify order of a factor

2012-03-21 Thread Justin Montemarano
would be greatly appreciated. - Justin Montemarano Graduate Student Kent State University - Biological Sciences http://www.montegraphia.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Unable to specify order of a factor

2012-03-21 Thread Justin Montemarano
Actually I've try that too, Sarah The test is to run order(levels(total.density)), which I need to be 1 2 3, not 2 3 1, and your solution still gives me 2 3 1. I also don't know how to reply to this thread with the previous message below... - Justin Montemarano Graduate Student Kent State

Re: [R] Unable to specify order of a factor

2012-03-21 Thread Justin Montemarano
if I wasn't clear and/or I've missed your message. - Justin Montemarano Graduate Student Kent State University - Biological Sciences http://www.montegraphia.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] Unable to specify order of a factor

2012-03-21 Thread Justin Montemarano
doesn't do the trick. - Justin Montemarano Graduate Student Kent State University - Biological Sciences http://www.montegraphia.com On Wed, Mar 21, 2012 at 11:42 AM, Ista Zahn istaz...@gmail.com wrote: Hi Justin, this gives the correct order (8, 16, 32) on my machine: total.density - c

Re: [R] Unable to specify order of a factor

2012-03-21 Thread Justin Montemarano
prompted me to discover my error; thanks all. - Justin Montemarano Graduate Student Kent State University - Biological Sciences http://www.montegraphia.com On Wed, Mar 21, 2012 at 12:42 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: You'll also want to use dput() to send us an exact

Re: [R] Remove a word from a character vector value XXXX

2012-03-07 Thread Justin Haynes
, Justin On Wed, Mar 7, 2012 at 8:03 AM, Dan Abner dan.abne...@gmail.com wrote: Hi everyone, What is the easiest way to remove the word Average and strip leading and trailing blanks from the character vector (d5.Region) below? .nrow.d5.           d5.Region 1            1     Central Average

Re: [R] logical to vector?

2012-03-07 Thread Justin Haynes
?as.numeric as.numeric(c(TRUE, FALSE)) [1] 1 0 On Wed, Mar 7, 2012 at 8:02 AM, Ed Siefker ebs15...@gmail.com wrote: I am trying to use the coXpress function from the coXpress package.  This function requires numerical vectors indicating which columns are in which group. The problem is, I

Re: [R] GPS handling libraries or (String manipulation)

2012-03-07 Thread Justin Haynes
Take a look at: http://cran.r-project.org/web/views/Spatial.html But I've always just parsed the string... This is from the last time I did this, its not quite the same but you can see the similarities. ## if data is presented as 43°02'46.60059 N need to split on the ° symbol, ' and .

Re: [R] GPS handling libraries or (String manipulation)

2012-03-07 Thread Justin Haynes
Wow... that is WAY better! Thanks Gabor! On Wed, Mar 7, 2012 at 8:51 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Mar 7, 2012 at 11:28 AM, Alaios ala...@yahoo.com wrote: Dear all, I would like to ask you if R has a library that can work with different GPS formats For

Re: [R] regular expression

2012-02-29 Thread Justin Haynes
] Surv(months): 21 But i would follow David's second suggestion and just read them in with sep=';' instead. Justin On Wed, Feb 29, 2012 at 11:24 AM, Fred G bayespoker...@gmail.com wrote: Computer Friends, with the following example lines: [107] 98-610: Cell type: S; Surv(months): 6

Re: [R] Problem building up ggplot graph in a loop.

2012-02-16 Thread Justin Haynes
() + ylab('Total Chargeoffs') this is untested since there is no sample data! Justin On Thu, Feb 16, 2012 at 2:50 PM, Keith Weintraub kw1...@gmail.com wrote: Folks, I want to automate some graphing using ggplot. Here is my code graphChargeOffs2-function(coffs) { ggplot(coffs, aes(levels

Re: [R] Change dataframe-structure

2012-02-13 Thread Justin Haynes
There is probably a more ellegant way, but: df - data.frame(p1=c(1,2,1),p2=c(3,3,2),p3=c(2,1,3),p4=c(5,6,4),p5=c(4,4,6),p6=c(6,5,5)) as.data.frame(t(apply(df,1,function(x) names(x)[match(1:6,x)]))) V1 V2 V3 V4 V5 V6 1 p1 p3 p2 p5 p4 p6 2 p3 p1 p2 p5 p6 p4 3 p1 p2 p3 p4 p6 p5 On Mon, Feb

Re: [R] debug in a loop

2012-02-10 Thread Justin Haynes
You can add if(is.na(tab[i])) browser() or if(is.na(tab[i])) break see inline On Fri, Feb 10, 2012 at 7:22 AM, ikuzar raz...@hotmail.fr wrote: Hi, I'd like to debug in a loop (using debug() and browser() etc but not print() ). I'am looking for the first occurence of NA. For instance:

Re: [R] Memory allocation problem (again!)

2012-02-08 Thread Justin Haynes
32 bit windows has a memory limit of 2GB. Upgrading to a computer thats less than 10 years old is the best path. But short of that, if you're just generating random data, why not do it in two or more pieces and combine them later? mat.1 - matrix(rnorm(5*2000),nrow=5) mat.2 -

[R] Force printing of excluded axis annotations

2012-02-08 Thread Justin Fincher
Howdy, This should be simple, but I am finding that I can't find a simple solution. I have a plot to which I am manually adding the annotations to the y-axis with this command: axis(2, c(-4,-3,-2,-1,0,1,2,3,4,5,6,7),labels=c(-4,-3,-2,-1,0,1,2,3,4,5,6,7),cex.axis=8) The issue is that,

Re: [R] Help need

2012-02-07 Thread Justin Haynes
Instead of a for loop, why not use the vectorization inherent in R? sigmasqaured - 1 i - complex(real = 0, imaginary =1) f - seq(0,0.5,0.1) spectrum - (sigmasqaured)/(abs(1-2.7607*exp(2*pi*i*f)+3.8106*exp(4*pi*i*f)-2.6535*exp(6*pi*i*f)+0.9258*exp(8*pi*i*f))^2) spectrum [1] 9.632720e+00

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 jr...@lcog.org wrote: Hi all For the data below, I would like to return a logical value indicating differences in the data.

[R] Summary.formula question

2012-02-02 Thread justin bem
to add a marginal column ?  Sincerly   Justin BEM BP 1917 Yaoundé Tél (237) 76043774 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] Calculate the natural log of cdf between 2 intervals

2012-02-02 Thread justin jarvis
is an error. Thus, I need to stay in the log scale, since, for z less than 10 sd below the mean, log(pnorm(z)) is an error, and pnorm(z,log.p=TRUE) is stable even though theoretically they are equivalent. Thanks for your time Justin [[alternative HTML version deleted

Re: [R] Select elements from text

2012-01-24 Thread Justin Haynes
] [bracket] [bar] You might need a more complex reg-ex to catch them all incase of ([citation]) instances for example. Justin On Tue, Jan 24, 2012 at 6:52 AM, mdvaan mathijsdev...@gmail.com wrote: Hi, I have a series of MS word files and each file contains plain text. From these texts I would

Re: [R] drop columns whose rows are all 0

2012-01-24 Thread Justin Haynes
dataset-data.frame(a=1:10,b=c(0,0,0,1,0,0,0,0,1,0),c=rep(0,10)) apply(dataset,2,function(x) all(x==0)) a b c FALSE FALSE TRUE dataset[,!apply(dataset,2,function(x) all(x==0))] a b 1 1 0 2 2 0 3 3 0 4 4 1 5 5 0 6 6 0 7 7 0 8 8 0 9 9 1 10 10 0 On Tue, Jan

Re: [R] How can I access information stored after I run a command in R?

2012-01-23 Thread Justin Haynes
?str tells you about the object. str(MAX3(a,'asy',1)) from that you can see the names of the various parts including p.value. foo - MAX3(a,'asy',1)$p.value On Mon, Jan 23, 2012 at 9:32 AM, Tiago V. Pereira tiago.pere...@mbe.bio.brwrote: Dear all, Supposed I run the following command:

Re: [R] colored outliers

2012-01-20 Thread Justin Haynes
question so we can more easily help. Justin On Fri, Jan 20, 2012 at 5:49 AM, Geophagus falk.hilli...@twain-systems.comwrote: Dear Petr and Justin, my problem ist, that I only want to have the 4 highest values for Ni as a red point or with a red circle. The other points should not be modificated

Re: [R] Stacked barchart in ggplot (or other library)

2012-01-20 Thread Justin Haynes
to use ggplot: dat-data.frame(num=1:3,usage=c(4,2,5),cap=c(10,20,10),diff=c(6,18,5)) dat.melt-melt(dat,id.var=c('num','cap')) ggplot(dat.melt)+geom_bar(aes(x=num,y=value,fill=variable),stat='identity') On Fri, Jan 20, 2012 at 12:30 PM, Jean V Adams jvad...@usgs.gov wrote: Bart6114 wrote on

Re: [R] Establishing groups using something other than ifelse()

2012-01-19 Thread Justin Haynes
how bout levels(df$z)[grep('A',levels(df$z))] - 'A' levels(df$z)[grep('B',levels(df$z))] - 'B' levels(df$z)[grep('C',levels(df$z))] - 'C' does that do what you're wanting? On Thu, Jan 19, 2012 at 3:05 PM, Sam Albers tonightstheni...@gmail.comwrote: Hello all, This is one of those Is there

[R] png output on a server?

2012-01-18 Thread Justin Haynes
with CairoPNG and making it look like the base png function, id love to hear what you've learned! Thanks, Justin capabilities() jpeg png tifftcltk X11 aqua http/ftp sockets libxml fifo clediticonv NLS profmem FALSEFALSEFALSEFALSEFALSE

Re: [R] Points inside a polygon

2012-01-12 Thread Justin Haynes
. particularly the inout function. Justin __ 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

Re: [R] relative frequency plot using ggplot or other function

2012-01-12 Thread Justin Haynes
On Thu 12 Jan 2012 09:02:27 AM PST, Mary Kindall wrote: Hi I have a data frame in the following form. There are two groups and for each 'width' relative frequency for group1 and group2 is given. How to plot this in R using ggplot or other package. Width relativeFrequency1

Re: [R] relative frequency plot using ggplot or other function

2012-01-12 Thread Justin Haynes
the legends of the following fig. http://had.co.nz/ggplot2/graphics/55078149a733dd1a0b42a57faf847036.png http://had.co.nz/ggplot2/graphics/90983232ced45a93d9fbbe40afffd69a.png Thanks On Thu, Jan 12, 2012 at 12:13 PM, Justin Haynes jto...@gmail.com wrote: On Thu 12 Jan 2012 09:02:27 AM

Re: [R] Add color to Boxplot by value

2012-01-12 Thread Justin Haynes
how bout: dat-data.frame(val=rnorm(100,12,10),x=letters[1:4]) col.val-ddply(dat,.(x),summarise,mean(val)) col.val$breaks-cut(col.val$..1,c(0,9,15,Inf)) dat.merge-merge(dat,col.val) ggplot(dat.merge,aes(x=x,y=val,colour=breaks))+geom_boxplot()+scale_color_manual(values=c('green','yellow','red'))

Re: [R] colored outliers

2012-01-10 Thread Justin Haynes
=3) Justin On Tue, Jan 10, 2012 at 7:11 AM, Geophagus falk.hilli...@twain-systems.comwrote: Hi @ all, I have question how to mark significant outliers in R. This is my very simple script to plot a regression: TOC_NI-read.csv2(C:/Users/XYZ/Desktop/Master/Daten/Statistik/TOC-NI.csv, sep

Re: [R] colored outliers

2012-01-10 Thread Justin Haynes
woops! see inline. Hope that helps, and enjoy R. Justin On Tue, Jan 10, 2012 at 8:40 AM, Geophagus falk.hilli...@twain-systems.comwrote: Hi Justin, thanks a lot for your quick answer. If I use your code, all points become red. How do you include the sorted and separated four values

Re: [R] match matrices of different lengths

2012-01-05 Thread Justin Haynes
, Justin On Thu, Jan 5, 2012 at 5:51 AM, Thijs vanden Bergh bergh.thijsvan...@gmail.com wrote: was trying to match different matrices of different lengths with in the first collumn date and time info (yearmonthdayhourminute). the routine needs to return NA´s where data of either of the matrices

Re: [R] ggplot2 - tricky problem

2012-01-05 Thread Justin Haynes
: ggplot(dat,aes(x=likeability,y=uniqueness,colour=city))+geom_point()+geom_smooth(aes(group=city),method='lm') You could draw fit lines that make a bit more sense. Forgive me if I'm over simplifying your problem! Justin On Thu, Jan 5, 2012 at 7:46 AM, Mario Giesel rr.gie...@yahoo.de wrote

Re: [R] [newbie] stack operations, or functions with side effects (or both)

2012-01-04 Thread Justin Haynes
do s[1] and s[-1] do what you're looking for? those are just to display... if you want to change s, you need to reassign it or fiddle with namespacing. however, I'd say it is better to write R code as though data structures are immutable until you explicitly re-assign them rather than trying to

Re: [R] Combining characters

2012-01-04 Thread Justin Haynes
apply(expand.grid(x, y, z, stringsAsFactors=F), 1, paste, collapse=' ') On Wed, Jan 4, 2012 at 8:32 AM, jeremy jeremynamer...@gmail.com wrote: Hi all, I'm trying to combine exhaustively several character arrays in R like: x=c(one,two,three) y=c(yellow,blue,green) z=c(apple,cheese) in

Re: [R] a quick question about rbinom

2012-01-04 Thread Justin Haynes
homework or not, ?rbinom should be plenty. On Wed, Jan 4, 2012 at 1:38 PM, lynn.tsai vernal@gmail.com wrote: Hello, I have the following code using rbinom, but I don't understand what *+1* means in the code. Could someone help? Thanks so much, X1-c(A,B)[rbinom(n,1,0.6)+1]

Re: [R] Applyiing mode() or class() to each column of a data.frame XXXX

2011-12-30 Thread Justin Haynes
there is also colwise in the plyr package. library(plyr) colwise(class)(data6) v13 v14 v15 f4 v16 1 integer numeric character factor logical Justin On Thu, Dec 29, 2011 at 4:47 PM, Jean V Adams jvad...@usgs.gov wrote: Dan Abner wrote on 12/29/2011 06:13:11 PM

Re: [R] Help with code

2011-12-20 Thread Justin Haynes
should avoid naming things with pre-existing R functions (e.g. data). Justin On Tue, Dec 20, 2011 at 11:14 AM, 1Rnwb sbpuro...@gmail.com wrote: hello gurus, i have a data frame like this HTN HTN_FDR Dyslipidemia CAD t1d_ptype[1:25] 1Y YY T1D 2

Re: [R] Help with code

2011-12-20 Thread Justin Haynes
Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Justin Haynes Sent: Tuesday, December 20, 2011 11:54 AM To: 1Rnwb Cc: r-help@r-project.org Subject: Re: [R] Help with code the short

Re: [R] how to manually enter an double quote as data feed?

2011-12-13 Thread Justin Haynes
answer your question, some more back story on what you're trying to do would help. Justin On Tue, Dec 13, 2011 at 2:03 PM, bonnieyuan bby2...@columbia.edu wrote: I'm doing a text mining project where I have to manually enter a double quote as an element inside a vector. I tried char[10

Re: [R] using sample

2011-12-07 Thread Justin Haynes
(see ?str and ?dput) or if you can generate made up data that replicates your problem that works too. Justin On Wed, Dec 7, 2011 at 9:16 AM, bevare emma.ra...@jbaconsulting.co.ukwrote: Hi, Can anyone help sort out the problem with the following script - I am a R newbie and I am self taught

[R] adding hyperlinked text to pdf plot

2011-12-05 Thread Justin Fincher
Howdy, I have read that if you put a URL in the text of a plot being saved into pdf, the result is a functional hyperlink. I am interested in having text in a plot that is linked to a URL, but I would like the text to be something other than the URL. Is this possible? Thank you. - Fincher

Re: [R] adding hyperlinked text to pdf plot

2011-12-05 Thread Justin Fincher
than the URL? I feel the tikzDevice package should be an option for the task. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Mon, Dec 5, 2011 at 12:39 PM, Justin

Re: [R] hour in x-axis

2011-11-29 Thread Justin Haynes
() if you'd rather. Hope that helps, Justin On Tue, Nov 29, 2011 at 10:07 AM, threshold r.kozar...@gmail.com wrote: Dear R useres, got the following problem. Given the AggData (listed below) I need to plot AggData[,2] vs time (AggData[,1]) for chosen 'rows'. Ive done already: plot(AggData[rows,2

Re: [R] aggregate syntax for grouped column means

2011-11-29 Thread Justin Haynes
perform the na.rm on each column. Justin On Tue, Nov 29, 2011 at 12:21 PM, Juliet Hannah juliet.han...@gmail.comwrote: I am calculating the mean of each column grouped by the variable 'id'. I do this using aggregate, data.table, and plyr. My aggregate results do not match the other two, and I

Re: [R] tip: large plots

2011-11-18 Thread Justin Haynes
Very cool. Sadly, as far as I can tell, it doesn't work with ggplot though :( x-runif(1e6) y-runif(1e6) system.time(plot(x,y,pch='.')) user system elapsed 0.824 0.012 0.845 system.time(plot(x,y)) user system elapsed 33.422 0.016 33.545 system.time(print(qplot(x,y)))

Re: [R] tip: large plots

2011-11-18 Thread Justin Haynes
(qplot(x,y,pch=I('.' user system elapsed 32.370 0.204 33.868 On Fri, Nov 18, 2011 at 12:39 PM, Hadley Wickham had...@rice.edu wrote: You need: system.time(print(qplot(x,y,pch=I('.' Hadley On Fri, Nov 18, 2011 at 1:30 PM, Justin Haynes jto...@gmail.com wrote: Very cool

Re: [R] apply on rows and columns?

2011-11-16 Thread Justin Haynes
,]24 apply(x,c(1,2),sum) [,1] [,2] [1,]4 12 [2,]8 16 a margin of c(1,2) makes more sense. Hope that clarifies things. Justin On Wed, Nov 16, 2011 at 12:18 PM, Sarah Goslee sarah.gos...@gmail.com wrote: Hi, On Wed, Nov 16, 2011 at 3:13 PM,  rkevinbur...@charter.net wrote

Re: [R] Extract pattern from string

2011-11-15 Thread Justin Haynes
take a look at the structure of what Sys.time returns. str(Sys.time) and now at ?strptime! format(Sys.time(),format='%d-%H-%M-%S') [1] 15-09-55-55 format(Sys.time(),format='%Y') [1] 2011 format(Sys.time(),format='%m') [1] 11 Hope that helps, Justin On Tue, Nov 15, 2011 at 9:48 AM

Re: [R] Create design matrix

2011-11-03 Thread Justin Haynes
?expand.grid expand.grid(c(M,F),c(Y,O)) Var1 Var2 1MY 2FY 3MO 4FO Justin On Thu, Nov 3, 2011 at 10:56 AM, Bond, Stephen stephen.b...@cibc.com wrote: Greetings useRs, What is the easiest way to create a design matrix of several factor variables? Function

[R] mysterious warning message regarding bytecode...

2011-11-02 Thread Justin Haynes
seem to affect my output as far as I can tell. Thanks! Justin sessionInfo() R version 2.13.2 (2011-09-30) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES

Re: [R] factor level issue after subsetting

2011-11-01 Thread Justin Haynes
first of all, the subsetting line is overly complicated. dat.sub-dat[dat$treat!='cont',] will work just fine. R does exactly what you're describing. It knows the levels of the factor. Once you remove 'cont' from the data, that doesn't mean that the level is removed from the factor:

  1   2   3   >