Re: [R] [External] Funky calculations

2022-02-01 Thread Nathan Boeger
> %s\n", d == 1.0 ? "true" : "false"); > return 0; > } > bill@Bill-T490:~$ gcc a.c > bill@Bill-T490:~$ ./a.out > 0.4+0.3+0.2+0.1 -> 0.99989 > 0.4+0.3+0.2+0.1 == 1.0 -> false > > -Bill > > On Tue, Feb 1, 2022 at 7:01 PM N

[R] Funky calculations

2022-02-01 Thread Nathan Boeger
Hello, I found something strange and maybe I am going nuts but this does not make sense: > (0.4 + 0.2 + 0 + 0.3 + 0 + 0.1) > 1 [1] TRUE I tried it on my mac M1 (R v4.1.2) and my Linux box (R v4.0.4). If I use other values, it does not work (see below). It seems only that combination, granted I

Re: [R] error = FALSE causes knit2wp to throw duplicate label error

2018-12-17 Thread Nathan Parsons
knitr from within an Rmarkdown document is a > bad idea unless you are building using child documents. Try manipulating your > markdown from an R file. > > On December 16, 2018 11:48:44 AM PST, Nathan Parsons > wrote: > >Goal: post from R to Wordpress installation on server

[R] error = FALSE causes knit2wp to throw duplicate label error

2018-12-16 Thread Nathan Parsons
Goal: post from R to Wordpress installation on server. Problem: R keeps returning the error “Error in parse_block(g[-1], g[1], params.src) : duplicate label 'setup’” if error = FALSE in the knitr options or in an r chunk. It works fine if error = TRUE. I could just go through each post each time a

Re: [R] Matching multiple search criteria (Unlisting a nested dataset, take 2)

2018-10-17 Thread Nathan Parsons
h terms have been found, and returns a logical srchr <- function(df) { str_detect(df, "olympic") -> a str_detect(df, "technique") -> b str_detect(df, "lifts") -> c ifelse(a == TRUE & b == TRUE & c == TRUE, TRUE, FALSE) } ## Evaluate tweets f

Re: [R] Matching multiple search criteria (Unlisting a nested dataset, take 2)

2018-10-16 Thread Nathan Parsons
;, "Large Fringe Metro", "Large Central Metro", "Large Central Metro", "NonCore (Nonmetro)", "Large Central Metro"), urban_code = c(3L, 2L, 1L, 1L, 6L, 1L), population = c(277308L, 184029L, 830781L, 1160433L, 4160L, 9509611L)), class =

[R] Matching multiple search criteria (Unlisting a nested dataset, take 2)

2018-10-16 Thread Nathan Parsons
Thanks all for your patience. Here’s a second go that is perhaps more explicative of what it is I am trying to accomplish (and hopefully in plain text form)... I’m using the following packages: tidyverse, purrr, tidytext I have a number of tweets in the following form: th <- structure(list(st

Re: [R] Unlisting a nested dataset

2018-10-16 Thread Nathan Parsons
to answer your question. Please see > https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example > and follow some of the suggestions you find there to make it easier on > those who want to help you. > > Best, > Ista > On Mon, Oct 15, 2018

[R] Unlisting a nested dataset

2018-10-15 Thread Nathan Parsons
I’m attempting to do some content analysis on a few million tweets, but I can’t seem to get them cleaned correctly. I’m trying to replicate the process outlined here:  https://stackoverflow.com/questions/46734501/opposite-of-unnest-tokens My code: tweets %>%  unnest_tokens(word, text, token = '

Re: [R] Creating a data frame

2018-10-09 Thread Nathan Parsons
Please post both the code you are using and the error, Abigail. Nate On Oct 9, 2018, 11:59 AM -0700, Friedman, Abigail , wrote: > I keep getting error messages when running my data frame code and I cannot > figure out what I am doing wrong. > > > [[alternative HTML version deleted]] > >

[R] Help with r script

2018-09-04 Thread Nathan D Jennings
 To the R Project: I am using R Studio and I need help sum product exponents with R Script.  Every time I type at the very start in the R Script window like 25* 30 nothing happens.  Where can I go to find the complete commands for basic functions in the r script window? Sincerely, Nathan

Re: [R] ggplot2 stat_smooth

2016-06-29 Thread Nathan Pace
l"), ...) } And then call ggplot(data = SSI.dt, aes(x = elapsed, y = 1 - control)) + geom_point() + binomial_smooth() Everything is now working smoothly. Nathan -Original Message- From: David Winsemius Date: Wednesday, June 29, 2016 at 16:10 To: Nathan L Pace Cc: "r-

[R] ggplot2 stat_smooth

2016-06-29 Thread Nathan Pace
sted my call as the correct syntax structure. I’d appreciate thoughts/pointers. Nathan -- Nathan Pace, MD, MStat Department of Anesthesiology University of Utah 801.581.6393 n.l.p...@utah.edu __ R-help@r-project.org mailing list -- To UNSUBSCRI

[R] unlisting dplyr do output

2015-06-24 Thread Nathan Pace
ect[[i]]$x, y = do object[[i]]$smoothed y))) } This takes about 100 minutes. Any guidance for a faster (more elegant?) solution will be appreciated. Nathan __ R-help@r-project.org mailing list --

[R] deming package error message

2015-03-05 Thread Nathan Pace
y = T, model = T, nboot = 1000)) | | 1% ~40 m remaining Error in if (any(tied)) { : missing value where TRUE/FALSE needed This error does not occur and the function call completes if nboot = 0. Nathan > sessionInfo() R version 3.

[R] predict.lqm

2014-12-27 Thread Nathan Pace
ta.table(Anesthetic = "Iso")) : object 'yhat' not found > predict(Des.Iso.ATE.lqm, newdata = data.frame(Anesthetic = factor('Iso', >levels=levels(Des.Iso.dt$Anesthetic Error in predict.lqm(Des.Iso.ATE.lqm, newdata = data.frame(Anestheti

Re: [R] SEs rms cph vs survey svycoxph

2014-02-25 Thread Nathan Pace
Here are the model outputs. Nathan Survey package ca.ATE.design <- svydesign(ids = ~ id, weights = ~ get.weights(ca.ATE.ps, stop.method = 'ks.mean'), data = ca.dt) Independent Sampling design (with replacement) svydesign(ids = ~id, weights = ~get.weights(ca.ATE.ps, stop.meth

[R] SEs rms cph vs survey svycoxph

2014-02-25 Thread Nathan Pace
with svycoxph estimates. There is a note in the svycoxph help page stating the SEs should agree closely unless the model fits poorly. Are there other reasons for the differences? Nathan __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] metafor package

2014-02-13 Thread Nathan Pace
I appreciate the several replies. efac = 2 had already been set in the forest call. Adding lwd = 2 in the forest call has improved the visibility of the credibility interval. Nathan -Original Message- From: "Viechtbauer Wolfgang (STAT)" Date: Wednesday, February 12, 20

[R] metafor package

2014-02-11 Thread Nathan Pace
whiskers of the credibility interval are too faint. I need help on the argument(s) to widen the credibility interval dots and whiskers. I have looked at the forest.default function, but don’t see anything obvious to me. Nathan -- Nathan Pace, MD, MStat Department of Anesthesiology University of

[R] sensuc function in rms package

2014-02-10 Thread Nathan Pace
ble_1.8.10 loaded via a namespace (and not attached): [1] cluster_1.14.4 MASS_7.3-29nnet_7.3-7 tools_3.0.2 I¹ve looked at the sensuc code. I can¹t understand the error message. Nathan -- Nathan Pace, MD, MStat Department of Anesthesiology University of Utah 801.581.63

Re: [R] Inconsistent results between first run of Rprof and next runs of Rprof

2014-01-30 Thread Nathan Uyttendaele
described case. Any thoughts why I should load the libraries first? I already tried to recompile the C functions with different names to be sure there are not somehow erased by the C functions in the libraries, but it didn't help. On Thu, Jan 30, 2014 at 8:46 AM, Nathan Uyttendaele wrote:

Re: [R] Inconsistent results between first run of Rprof and next runs of Rprof

2014-01-29 Thread Nathan Uyttendaele
e trying again (maybe there was some > data hanging around that helped out). It is not unknown to get > different results if you are having to access, especially, external > data. > > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve?

[R] Inconsistent results between first run of Rprof and next runs of Rprof

2014-01-29 Thread Nathan Uyttendaele
Hello, when I run this code in a brand new R session -- ### loading of libraries and other functions Rprof("profiling.out") start.time=proc.time()[3] for(i in 1:50) { main.function() } end.time=proc.time()[3] Rprof() ---

Re: [R] svycoxph

2013-12-23 Thread Nathan Pace
Answered my own question. In survey, summary does it. On 2312//2013, 5:31 PM, "Nathan Pace" wrote: > >>The svycoxph function in the survey package loads the survival package >>and >>produces objects of class svycoxph and coxph. >> >>The print.co

[R] svycoxph

2013-12-23 Thread Nathan Pace
ments in print(predict(svycoxph.object, se = T, >type = ?)), but without returning the CIs. > >Any suggestions on the correct syntax will be appreciated. > >Nathan > >-- >Nathan Pace, MD, MStat >Department of Anesthesiology >University of Utah >801.581.6393 >

[R] Creating Color Pallets

2013-05-13 Thread Nathan Barber - NOAA Federal
I am trying to create my own color pallet, consisting of 18 hexadecimal colors. I'm having trouble figuring out what to use to define/display them. ColorRampPallet can only take 3 colors so I was hoping to somehow create a palette then point to that pallet. Any suggestions? Thanks -- N

Re: [R] meta-analysis for sensitivity

2013-04-08 Thread Nathan Pace
Check the mada package for a bivariate approach to sensitivity/specificity. Check the metafor package if trying only to do a meta analysis of a proportion. Nathan On 4/8/13 12:51 PM, "array chip" wrote: >Hi all, I am new to meta-analysis. Is there any special package that c

Re: [R] Determining maximum hourly slope per day

2013-03-14 Thread Nathan Miller
Thanks for your example Peter. It does seem like one means of getting the job done and if I'm unable to figure out a means with zoo::rollapply I may follow your example. Hopefully someone else can chime in. Thanks, Nate --- Nathan A. Miller Ro

[R] Determining maximum hourly slope per day

2013-03-12 Thread Nathan Miller
Hello, I have a challenge! I have a large dataset with three columns, "date","temp", "location". "date" is in the format %m/%d/%y %H:%M, with a "temp" recorded every 10 minutes. These temperatures of surface temperatures and so fluctuate during the day, heating up and then cooling down, so the da

Re: [R] Adding 95% contours around scatterplot points with ggplot2

2013-01-28 Thread Nathan Miller
es to stat_contour, but try > > ggplot(data=data, aes(x, y, colour=(factor(level)), fill=level))+ > geom_point()+ > stat_density2d(bins=2) > > HTH, > Ista > > On Mon, Jan 28, 2013 at 2:43 PM, Nathan Miller > wrote: > > Thanks Ista, > > >

Re: [R] Adding 95% contours around scatterplot points with ggplot2

2013-01-28 Thread Nathan Miller
data from different groups are distributed. Using the 95% CI type idea is so that I don't end up arbitrarily drawing circles around each set of points. I appreciate your direction though. Nate On Mon, Jan 28, 2013 at 10:50 AM, Ista Zahn wrote: > Hi Nathan, > > This only fits some of you

[R] Adding 95% contours around scatterplot points with ggplot2

2013-01-28 Thread Nathan Miller
Hi all, I have been looking for means of add a contour around some points in a scatterplot as a means of representing the center of density for of the data. I'm imagining something like a 95% confidence estimate drawn around the data. So far I have found some code for drawing polygons around the

[R] Formatting a path for unix with gsub

2012-12-17 Thread Nathan Skene
I have a path: path = "/nfs/users/nfs_n/ns9/ Phenotype Analysis/Results/Run_AmplRatio_neg BinaryAll trained without akapn+tnik.csv" I wish to replace the spaces with "\ " so that it can be read by a system call to unix. Using gsub I try: > gsub(" ","\\ ",path) [1] "/nfs/users/nfs_n/ns9/Phenotyp

Re: [R] More efficient use of reshape?

2012-12-14 Thread Nathan Miller
tempt to simplify example and just include the code I felt was > > necessary I left out the loading of ggplot2, which then imports reshape2, > > and which was actually used in the code I provided. Sorry to the mistake > > and my misunderstanding of where the reshape function was coming fro

Re: [R] More efficient use of reshape?

2012-12-13 Thread Nathan Miller
from. Should have checked that more carefully. Thanks, Nate On Thu, Dec 13, 2012 at 9:48 AM, David Winsemius wrote: > > On Dec 13, 2012, at 9:16 AM, Nathan Miller wrote: > > Hi all, >> >> I have played a bit with the "reshape" package and function along with

[R] QQplot

2012-11-29 Thread Nathan
solve our problem. Is there someone able to tell us what kind deformation we should try? (I'm sorry for the horrible English but I'm not a native speaker) Thanks! Nathan -- View this message in context: http://r.789695.n4.nabble.com/QQplot-tp4651293.html Sent from the R help mailing

[R] Violin plot of categorical/binned data

2012-11-03 Thread Nathan Miller
Hi, I'm trying to create a plot showing the density distribution of some shipping data. I like the look of violin plots, but my data is not continuous but rather binned and I want to make sure its binned nature (not smooth) is apparent in the final plot. So for example, I have the number of indivi

[R] ADMB error- function maximizer failed (couldnt find STD file)

2012-09-04 Thread Nathan Svoboda
ersion? Any suggestions would be very much appreciated. Thank you for your time. Nate Svoboda Nathan Svoboda Graduate Research Assistant Mississippi State University [[alternative HTML version deleted]] __ R-help@r-project.org mai

[R] Mixed-model with paired design & covariates

2012-07-28 Thread Nathan Ranc
in investigating those effects. How could I include a covariate in such model? How should I strucutre it given that there are species covariates (high order of nesting)? I hope that my questions are relevant! Thank you very much in advance for your help! Nathan [[alternativ

[R] Eleaps in package subselect crashes when using include arguement

2012-07-26 Thread Nathan Stephens
4 55 58 60 62 63 66 67 70 72 74 78 81 83 88 89 100 105 lps <- eleaps(x$mat, 40, 40, 1, NULL, include, H=x$H, r=1) --Nathan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-

[R] drop1, 2-way Unbalanced ANOVA

2012-07-23 Thread Nathan Miller
Hi all, I've spent quite a lot of time searching through the help lists and reading about how best to run perform a 2-way ANOVA with unbalanced data. I realize this has been covered a great deal so I was trying to avoid adding yet another entry to the long list considering the use of different SS,

Re: [R] R Error: System is computationally singular

2012-05-24 Thread Nathan Svoboda
you for your time and quick responses!! Nate Nathan Svoboda Graduate Research Assistant Carnivore Ecology Lab Mississippi State University From: Marc Schwartz [mailto:marc_schwa...@me.com] Sent: Thu 5/24/2012 3:09 PM To: Nathan Svoboda Cc: David Winsemius

Re: [R] R Error: System is computationally singular

2012-05-24 Thread Nathan Svoboda
, Nate Nathan Svoboda Graduate Research Assistant Mississippi State University From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Thu 5/24/2012 1:54 PM To: Nathan Svoboda Cc: r-help@r-project.org Subject: Re: [R] R Error: System is computationally

Re: [R] R Error: System is computationally singular

2012-05-24 Thread Nathan Svoboda
Thank you for your quick reply, When I run the code you provide I get this output: LCOVER LOCS 1 2 3 4 5 6 7 9 0 214507 79939 69803 778359 22932 32391 99630 8082 1 15 7 1 32 0 0 0 0 2 2 1

Re: [R] R Error: System is computationally singular

2012-05-24 Thread Nathan Svoboda
0 0 0 0 0 0 3 0 0 0 1 0 0 0 0 Nate From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Thu 5/24/2012 1:54 PM To: Nathan Svoboda Cc: r-help@r-project.org Subject: Re: [R] R Error

[R] R Error: System is computationally singular

2012-05-24 Thread Nathan Svoboda
why I may be getting this error when I add the categorical covariate? I appreciate your time and input. Thank you, Nate Nathan Svoboda Graduate Research Assistant Carnivore Ecology Lab Mississippi State University -- View this message in context: http://r.789695.n4.nabble.com/R-Error

[R] Optimization inconsistencies

2012-05-17 Thread Nathan Stephens
es I. I've tried various packages but none seem to bee the very solver in Excel. Any recommendations on what packages or functions I should try? --Nathan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.

[R] conducting GAM-GEE within gamm4?

2012-05-03 Thread Nathan Furey
block, but assume independence among blocks? On another note, I am also receiving the following warning message after model completion for larger models (with many more variables than 2): Warning message: In mer_finalize(ans) : false convergence (8) Thank you for your time, effort, and patience deal

[R] glmnet sparse matrix error: dim specifies too large an array

2012-04-23 Thread Nathan Stephens
x27;,alpha=1) # error Error in array(0, c(n, p)) : 'dim' specifies too large an array This result is the opposite of what I might have expected. The non-sparse data runs fine, but the sparse data fails because it is "too large". Is this a glmnet issue or an R memory issue? Is there

Re: [R] system command and Perl confusion

2012-04-06 Thread Nathan McIntyre
lan on using the Mac OS X version, /usr/bin/perl, use /usr/bin/cpan to install Statistics::Descriptive first as it appears you don't have that installed in /System/Library/Perl. Thanks, Nathan >Hello, > >I'm having a question related to the system command within R: I try to

[R] Grouped barchart confidence intervals in lattice

2012-03-03 Thread Nathan Lemoine
ripts, ...){ panel.barchart(x, y, horiz=F, subscripts=subscripts, groups=growth.means$Group.2, ...) panel.segments(x[subscripts], y, x[subscripts], y+0.5) print(x[subscripts]) } barchart(growth~Group.1, groups=Group.2, data=growth.means, col=c(1,2,3), panel=panel.super

[R] Grouped barchart confidence intervals in lattice

2012-03-02 Thread Nathan Lemoine
not on the grouped bars barchart(x~Group.1, groups=Group.2, data=growth.means, panel=function(x,y,subscripts, groups){ panel.barchart(x,y,horiz=F,groups=groups, subscripts=subscripts) panel.segments(as.numeric(x)[subscripts],y,as.nu

Re: [R] ggplot stat_summary (mean_cl_boot)

2011-11-09 Thread Nathan Miller
t someone else might start their own exploration of these issues a little further down the road than I found myself when I started looking into this. Thanks, Nate On Wed, Nov 9, 2011 at 1:46 PM, David Winsemius wrote: > > On Nov 9, 2011, at 4:35 PM, Nathan Miller wrote: > > Sorry, I

Re: [R] ggplot stat_summary (mean_cl_boot)

2011-11-09 Thread Nathan Miller
Ok, I got it. smean.cl.boot(x, conf.int=.95, B=1000, na.rm=TRUE, reps=FALSE) Looks like its 1000. Cool. Thanks for the help, Nate On Wed, Nov 9, 2011 at 1:35 PM, Nathan Miller wrote: > Sorry, I didn't realize I was being so obscure. > > Within ggplot it is possible to use sta

Re: [R] ggplot stat_summary (mean_cl_boot)

2011-11-09 Thread Nathan Miller
y looking for details regarding how "mean_cl_boot" works. If you don't have information regarding how it works (such as the default number of resamplings) there is no need to respond. Thanks for any assistance, Nate On Wed, Nov 9, 2011 at 1:10 PM, David Winsemius wrote: >

[R] ggplot stat_summary (mean_cl_boot)

2011-11-09 Thread Nathan Miller
Hello, This is a pretty simple question, but after spending quite a bit of time looking at "Hmisc" and using Google, I can't find the answer. If I use stat_summary(fun.data="mean_cl_boot") in ggplot to generate 95% confidence intervals, how many bootstrap iterations are preformed by default? Can

[R] Calculating difference between values in data frame based on separate column

2011-10-21 Thread Nathan Miller
Hi all, Say I have a data frame something like the one below with different sample vials, measured before(B) and after(A) some process, with a value recorded at each measurement point vialmeasurevalue 1 B26 1 A12 2 B 45 2

Re: [R] Applying function with separate dataframe (calibration file) supplying some inputs

2011-10-19 Thread Nathan Miller
at as well. Thanks again. Nate On Wed, Oct 19, 2011 at 10:33 PM, Joshua Wiley wrote: > Hi Nathan, > > I honestly do not think that anything else will be much better than > merging the two datasets. If the datasets are not merged, you > essentially have to apply your optode functio

[R] Applying function with separate dataframe (calibration file) supplying some inputs

2011-10-19 Thread Nathan Miller
Hello, I am not entirely sure the subject line captures what I am trying to do, but hopefully this description of the problem will help folks to see my challenge and hopefully offer constructive assistance. I have an experimental setup where I measure the decrease in oxygen in small vials as an o

[R] how to use 'which' inside of 'apply'?

2011-10-17 Thread Nathan Piekielek
t;data[,25]),1,min) Which returns the following error message: "Error in apply(which(new[, 2:24] > new[, 25]), 1, min) : dim(X) must have a positive length" Any help would be much appreciated. Nathan __ R-help@r-project.org mailing list

Re: [R] ggplot2-Issue placing error bars behind data points

2011-09-08 Thread Nathan Miller
tor + to be at the end of > a > line, not at the beginning. Copy and paste this code verbatim to > see what I mean: > p + geom_errorbar(limits,width=0.2) > + geom_point(aes(fill=factor(Temp)), colour = colors()[173], > shape = 21, size=4) > > This happen

[R] ggplot2-Issue placing error bars behind data points

2011-09-07 Thread Nathan Miller
Hi all, This seems like a basic problem, but no amount of playing with the code has solved it. I have a time-series data set like that shown below (only longer) and am seeking to plot the data with filled, circular points and error bars. I would like the error bars to be behind the points otherwis

[R] completion in R console when using Lion OSX

2011-08-31 Thread Nathan Hutcheson
R version: 2.13.1 64 bit for macOSX R console version: R for Mac OS X GUI 1.40-devel Leopard build 64-bit (5874) Problem: When I go to use the auto completion feature it keeps tagging on all the listed options instead of just allowing me to pick one. Is there a fix for this? _

Re: [R] Linear Regression with 2 grouping variables

2011-08-23 Thread Nathan Miller
. The game is to write the function so that it > takes a [list] model object (here, m) as input and a data frame as > output. You can also extract output from summary(m) in a similar way, > using m as the input object. > > HTH, > Dennis > > On Mon, Aug 22, 2011 at 6:15 PM, Nathan

[R] Linear Regression with 2 grouping variables

2011-08-22 Thread Nathan Miller
Hi all, I have a data set that looks a bit like this. feed1 RFU Site Vial Time lnRFU 1 811 10 10.702075 2 4752111 20 10.768927 3 4290511 30 10.66674 4 4686711 40 10.755069 5 4299511 50 10.668839 6 4307411

[R] Setting packet order and display order in lattice barchat

2011-07-20 Thread Nathan (Nat) Goodman
at Goodman -------- Nathan (Nat) Goodman Senior Research Scientist Institute for Systems Biology 401 Terry Avenue North Seattle, WA 98109-5234 206-331-0077 206-363-0431 (fax) n...@shore.net or ngood...@systemsbiology.org __ R-help@r-project.org ma

[R] Output a table formatted with standard deviations below means

2011-03-19 Thread Nathan Torrance
Is it in bad form to double post to StackOverflow and R-help? Apologies if so. Here's my task: I've got a matrix of means like so means<-matrix(1:10,nrow=2) colnames(means)<-c("a","b","c","d","e") and a matrix of standard deviations like so sds<-matrix(seq(0.1,1,by=0.1),nrow=2) colnames(sds)<-c

[R] Best way to organize this data for plotting

2011-02-17 Thread Andre Nathan
Hello I have a number of data files which are outputs for each step of a simulation. The data is organized like this: dmindmax coef 5 6 0.490981 3 8 0.098056 5 6 0.425926 6 6 0.517860 2 4 0.527778 I would li

[R] ggplot boxplot

2011-01-20 Thread Nathan Miller
Hello, I am trying to generate a set of boxplots using ggplot with the following data with 4 columns (Day, Site, VO2, Cruise) AllCorbulaMR Day Site VO2 Cruise 1 11 148.43632670 1 2 11 61.73864969 1 3 11 92.64536096 1 4 11 73.35434957

[R] Plotting dendrogram upside-down/mirrored

2011-01-18 Thread Nathan S. Watson-Haigh
on the bottom and leaves at the top (in horizontal orientation) or root on the right and leaves to the left (in vertical orientation)? Cheers, Nathan -- -- Dr. Nathan S. Watson-Haigh Tel: +61 (0)7 4753 8548 OCE Postdoctoral

Re: [R] Error in combined for() and if() code

2010-12-28 Thread Nathan Miller
nient as well. Maybe I'll came back to the data filtering problem later. Thanks for your help and comments, Nate On Tue, Dec 28, 2010 at 10:49 AM, David Winsemius wrote: > > On Dec 28, 2010, at 1:08 PM, Nathan Miller wrote: > > Hello, >> >> I am trying to filter a dat

[R] Error in combined for() and if() code

2010-12-28 Thread Nathan Miller
Hello, I am trying to filter a data set like below so that the peaks in the Phase value are more obvious and can be identified by a peak finding function following the useful advise of Carl Witthoft. I have written the following for(i in length(data$Phase)){ newphase=if(abs(data$Phase[i+1]-data$P

[R] Finding flat-topped "peaks" in simple data set

2010-12-23 Thread Nathan Miller
Hello, Thank you to all those great folks that have helped me in the past (especially Dennis Murphy). I have a new challenge. I often generate time-series data sets that look like the one below, with a variable ("Phase") which has a series of flat-topped peaks (sample data below with 5 "peaks"). I

[R] contourplot help

2010-12-20 Thread Andre Nathan
Hello I'm using the following call to create a contourplot: library(lattice) m <- as.matrix(read.table("data.txt")) contourplot(m[,3] ~ m[,2] * -m[,1], at = c(1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1), scales = list(x = list(log = 10, labels =

[R] ggplot missing fill colours in boxplot legend

2010-12-17 Thread Nathan Miller
Hello, I am trying to create a series of boxplots with the following data, three columns, "Day" (1 or 2), "Site" (1-4), and "VO2" (some values missing for some Sites or Days) > CorbulaMR3 Day Site VO2 111 88.92223 211 86.17873 311 61.08950 411 190.47922

[R] Wait for user input with readline()

2010-11-22 Thread Nathan Miller
Hello, I am trying write a script that includes a prompt for user input using readlines(). I am running into the problem that when I run readlines() as a single line the prompt works perfectly, but when I try to run a block of code which includes the readline function, the script doesn't wait for

Re: [R] Batch Processing Files

2010-11-16 Thread Nathan Miller
Dennis and all, Thank you for the help as I try to get this method for importing and batch processing files organized. I currently have this set-up to import data from two files in my working directory. "Var1" specifies data from file 1 and file 2. filenames=list.files() library(plyr) import

Re: [R] Extract summary stats to table

2010-10-06 Thread nathan pellegrin
and store as data frame dfmi <- data.frame( Formula=sapply(mods, FUN=function(x){ paste(formula(x)[2], formula(x)[1], formula(x)[-c(1,2)], collapse=" ") } ), AIC=sapply(mods, FUN="AIC") ) #write the data frame to a comma-separated file write.table(dfmi, file=&qu

Re: [R] conditional assignment of colors in xyplot()

2010-09-30 Thread nathan pellegrin
Thank you, Deepayan, for the answer - and for creating amazingly helpful tools! Thanks also to Jim Lemon who pointed out a typo in the code: S2 < .025 should read S2 > .025, Nathan On Thu, Sep 30, 2010 at 5:21 AM, Deepayan Sarkar wrote: > On Mon, Sep 27, 2010 at 7:11 AM, nathan

[R] conditional assignment of colors in xyplot()

2010-09-27 Thread nathan pellegrin
# Dear R Community, # I have this data frame: df1 <- data.frame( F1 = factor( c( rep("D1",12),rep("D2",12),rep("D3",12) ) ), F2 = factor( rep( rep( paste("O",1:6,sep=""), rep(2,6) ), 3) ), F3 = factor( rep( c("V1","V2"), 18 ) ), S1 = c(8.840955e-02,2.546822e-01,7.5

[R] Metafor

2010-08-03 Thread Nathan L Pace
approximate credible intervals (pending a function revision by the author) for that purpose. Is my assumption correct? Nathan -- Nathan Pace, MD, MStat Department of Anesthesiology University of Utah 801.581.6393 n.l.p...@utah.edu [[alternative HTML version deleted

[R] What is the largest in memory data object you've worked with in R?

2010-06-04 Thread Nathan Stephens
ing jobs in the 100 GB range. If so, what does your hardware look like? --Nathan [[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://ww

[R] Intersect, Union of date/time ranges

2010-03-17 Thread Nathan S. Watson-Haigh
. return the start/end date/time ranges which are in 1 or both sets Is there anything that is currently able to do this? If not, I'll start to code something. Kind regards, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow

[R] Superimpose ksmooth() onto barplot

2010-02-09 Thread Nathan S. Watson-Haigh
ol=as.numeric(as.factor(rownames(d)))[2]) legend("topright", c(rownames(d), "Total"), fill=c(as.numeric(as.factor(rownames(d))), "blue")) Cheers, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIR

Re: [R] Help with apply()

2010-02-08 Thread Nathan S. Watson-Haigh
On 8/02/2010 4:33 PM, Jim Lemon wrote: On 02/08/2010 12:26 PM, Nathan S. Watson-Haigh wrote: I have a 2 column data.frame: > d[1:5,] a b 1 80015 C 2 80016 B 3 80023 C 4 80062 B 5 80069 B I want to apply a function across each row: > for(i in 1:nrow(d)) { + myFun(con, d[i,]$

Re: [R] Help with apply()

2010-02-08 Thread Nathan S. Watson-Haigh
On 8/02/2010 2:08 PM, David Winsemius wrote: On Feb 7, 2010, at 8:26 PM, Nathan S. Watson-Haigh wrote: I have a 2 column data.frame: d[1:5,] a b 180015 C 280016 B 380023 C 480062 B 580069 B I want to apply a function across each

[R] Help with apply()

2010-02-07 Thread Nathan S. Watson-Haigh
how to tell apply() to pass data from columns a and b for a given row as arguments to the function myFun(). Thanks in advance for any pointers, Nathan -- ---- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Unive

[R] RMySQL - Bulk loading data and creating FK links

2010-01-27 Thread Nathan S. Watson-Haigh
need to get all the PK's which this dbWriteTable() appended to the contact table so I can load the data into my an_contact link table. I don't want to issue a separate INSERT query for each row in dat and then use MySQLs LAST_INSERT_ID() functionnot when I have 3.5million rows to ins

Re: [R] Bulk Match/Replace

2010-01-26 Thread Nathan S. Watson-Haigh
I knew it should be simple . but only if you know how!! Thanks, works a treat!! Nathan Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive Townsville, QLD 4810 Australia Tel: +61 (0)7 4753

[R] Bulk Match/Replace

2010-01-26 Thread Nathan S. Watson-Haigh
d value from lookup table df? I'd expect the following output: > v [1] "1" "2" "2" "4" "2" "4" "2" "2" "4" "2" "1" "2" "2" "1&qu

[R] Min hash

2010-01-25 Thread Nathan Stephens
Anyone know of a min hash algorithm written in R? --Nathan [[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-project.org/posting

[R] RMySQL Append data.frame to table

2010-01-24 Thread Nathan S. Watson-Haigh
oad data into table Can anyone shed light on this error, or how I might bulk load this data using RMySQL? Cheers, Nathan -- ---- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive Townsville, QL

[R] Server hanging despite efforts to correct memory limits

2010-01-19 Thread Nathan Stephens
My group is working with datasets between 100 Mb and 1 GB in size, using multiple log ins. From the documentation, it appears that vsize is limited to 2^30-1, which tends to prove too restrictive for our use. When we drop that restriction (set vsize = NA) we end up hanging the server, which requi

[R] R jobs keep hanging linux server despite mem.limits modifcations

2010-01-18 Thread Nathan Stephens
nsize vsize 1 1073741824 > mem.limits(vsize=2^31) nsize vsize 1 1073741824 Warning message: In structure(.Internal(mem.limits(as.integer(nsize), as.integer(vsize))), : NAs introduced by coercion --Nathan [[alternative HTML versio

[R] decompress tar.gz and zip files

2010-01-12 Thread Nathan S. Watson-Haigh
Can anyone point me in the right direction for decompressing text files that are compressed as tar.gz or zip files? Cheers, Nathan -- Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries University Drive

[R] Interfacing R and C++

2009-11-10 Thread Nathan Harmston
to be portable across OS etc. Nathan __ 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] Working with tables with missing levels

2009-07-27 Thread Andre Nathan
On Mon, 2009-07-27 at 16:34 -0300, Henrique Dallazuanna wrote: > Try this: > > t1 <- prop.table(table(factor(c(0,0,2,4,4), levels = 0:4))) > t2 <- prop.table(table(factor(c(0,2,2,2,3), levels = 0:4))) Is there a way to do this given an already existing table? The problem is that I actually build

[R] Working with tables with missing levels

2009-07-27 Thread Andre Nathan
Hello I'm trying to write a function to calculate the relative entropy between two distributions. The data I have is in table format, for example: > t1 <- prop.table(table(c(0,0,2,4,4))) > t2 <- prop.table(table(c(0,2,2,2,3))) > t1 0 2 4 0.4 0.2 0.4 > t2 0 2 3 0.2 0.6 0.2 The re

Re: [R] Converting indices of a matrix subset

2009-07-09 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Steven, This looks great. Thanks! Nathan Steve Lianoglou wrote: > Hi Nathan, > > On Jul 8, 2009, at 10:20 PM, Nathan S. Watson-Haigh wrote: > >> I have two matrices: >> >>> m1 <- matrix(1,4,4) >>&g

  1   2   >