Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-11 Thread Daniel Nordlund
: no non-missing arguments to max; returning -Inf Hope this helps, Rui Barradas After playing with this for a little while, I realized that the problem with plotting the confidence limits is the addition of ylim(470, 500).  The confidence values are outside the ylim values.  Remove

Re: [R] free_port returning only one port...

2023-01-08 Thread Daniel Nordlund
on each invocation free_port(random=TRUE) Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA -- This email has been checked for viruses by Avast antivirus software. www.avast.com __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] Issues when trying to fit a curve when generating random deviates

2022-09-19 Thread Daniel Nordlund
see the code you used to generate the curve. What kind of curve are you trying to plot, and why are you trying to plot that curve? As Rui suggested, it typically doesn't make sense to use line plots to represent discrete data.  If you explain what your end goal is, someone may be able to provide

Re: [R] Date and Time

2022-07-17 Thread Daniel Nordlund
:28:10' > dt <- strptime(in_dt_str,'%Y-%m-%d %H:%M:%S') if the date and time are stored in different variables then paste them together before converting > in_dt <- '2022-01-01' > in_tm <- '7:28:10' > dtm <- strptime(paste(in_dt, in_tm, sep=' '),'%Y-%m-%d %H:%M:%S') Hope th

Re: [R] bootstrap CI of the difference between 2 Cramer's V

2022-06-05 Thread Daniel Nordlund
is your friend here, search for    "R Goodman Kruskal gamma" Since this is looking like homework to me, I suggest you ask your instructor about some of this. Best of luck, Dan On 6/5/2022 9:21 AM, varin sacha wrote: Dear Daniel, Dear R-experts, I really thank you a lot Daniel. N

Re: [R] Dates as headers causing confusion but needed to convert to Julian days for ANOVA

2021-10-25 Thread Daniel Nordlund
vot_longer(starts_with("X"), names_to = "chr_date", values_to = "LST") # now you can use various data functions to get your month, day, and year # for example data_long$month <- month(as.Date(data_long$chr_date,"X%d.%m.%Y")) You may want to read up on the va

Re: [R] How to plot dates

2021-03-16 Thread Daniel Nordlund
it="secs")) # plot event date by time grouped by date ggplot(myDat, aes(x=tme, y = dte, group = dte)) + geom_line() + geom_point() +    expand_limits(y=as.Date(c('20210301', '20210331'),'%Y%m%d')) If this doesn't help get you started, you need to p

Re: [ESS] What is the right way to deal with modules with emacs/ESS/R on a cluster?

2021-02-16 Thread Kasper Daniel Hansen via ESS-help
Alternatively, you can put the module command into your .bachrc (or similar configuration file). On Tue, Feb 16, 2021 at 8:06 PM Sparapani, Rodney via ESS-help < ess-help@r-project.org> wrote: > Hi Gang: > > I’m having some trouble between Emacs/ESS and R with modules > that I don’t understand.

Re: [ESS] unexpected behavior for Emacs-27.1-1-modified-1 for two MacBooks.

2021-01-27 Thread Kasper Daniel Hansen via ESS-help
Regarding cl: On top of replacing (require 'cl) with (require 'cl-lib) I also needed to make a number of changes to the usage of various cl functions. Emacs would complain about unknown functions once I did (require 'cl-lib). Basically all of the cl functions were changed from XX to cl-XX for

Re: [R] ggplot2 + coord_cartesian + automatic ylim

2020-12-13 Thread Daniel Nordlund
)) AAPL %>%   ggplot(aes(x = date, y = close)) +   geom_line() +   labs(title = "AAPL", y = "Closing Price", x = "") +   coord_x_date(xlim=xminmax, ylim=yminmax) +   theme_tq() Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA

[ESS] -> and spaces

2020-11-26 Thread Kasper Daniel Hansen via ESS-help
Thanks for the work on ESS over the ages. I am happy to see that there is development happening still. I have the following code in my .emacs which I use to have the behaviour of changing a _ keypress into printing <-: (define-key ess-r-mode-map "_" #'ess-insert-assign) (define-key

Re: [R] 回复: high-frequency data in R

2020-11-24 Thread Daniel Nordlund
tps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. You have the wrong format for your date conversion.  It should be format=

Re: [ESS] Best Practice for building R packages

2020-10-08 Thread Kasper Daniel Hansen via ESS-help
Personally, I'm a dinosaur so I'm still editing Rd files myself. I must say, I'm not convinced about the merits of roxygen2. Having said that, I think it would make a lot of sense to have robust solutions in ESS supporting roxygen2 and these may even exist somewhere. On Thu, Oct 8, 2020 at 1:57

Re: [R] Export R outputs to SAS dataset

2020-08-24 Thread Daniel Nordlund
you more, but I will need to better understand what it is that you want to get back into SAS. Dan On 8/23/2020 6:46 AM, Jomy Jose wrote:  Hi Daniel Thanks,please find the code and output  #R libraries-       library(tidyverse)       library(MF) MFSubj(lesion ~ group, calflung) HLBoo

Re: [R] Export R outputs to SAS dataset

2020-08-22 Thread Daniel Nordlund
the R-code you are running and the R "output" you want to get back in SAS?  It is difficult from way over here to know if you are wanting numerical results like means or regression coefficients ... or if you just want printed output in your SAS log or listing. Dan -- Daniel Nordlu

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-16 Thread Daniel Nordlund
elp@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Works fine in Windows 10 64-bit with R-4.0.2

Re: [R] Strange behavior when sampling rows of a data frame

2020-06-19 Thread Daniel Nordlund
nrow(df),3), 'treated'] <- TRUE Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] How to convert European short dates to ISO format?

2020-06-10 Thread Daniel Nordlund
On 6/10/2020 1:20 AM, Luigi Marongiu wrote: isoDates = as.Date(oriDates, format = "%m/%d/%y") You need to use the format for European short dates. isoDates = as.Date(oriDates, format = "%d/%m/%y") Hope this is helpful, Dan -- Daniel Nordlund Po

Re: [R] [EXTERNAL] Attribute Combinations

2020-05-21 Thread Dalthorp, Daniel via R-help
# assuming your data frame is named "x", you can get the counts of each combo: table(do.call(paste0, x)) # and to get the proportions: table(do.call(paste0, x))/nrow(x) -Original Message- From: R-help On Behalf Of Jeff Reichman Sent: Thursday, May 21, 2020 10:22 AM To:

Re: [ESS] Anyone tried Emacs 27.1 pretest with Windows 10 ?

2020-05-11 Thread Kasper Daniel Hansen via ESS-help
On Wed, May 6, 2020 at 8:26 AM Martin Maechler via ESS-help < ess-help@r-project.org> wrote: > > I strongly suspect it is related to the (mis)feature that ESS is > monitoring things not only *R* buffers but also in *shell* buffers. > .. I think part of current modern ESS work under the assumption

[ESS] R 4.0

2020-04-16 Thread Kasper Daniel Hansen via ESS-help
I have just updated ESS using list-packages. R-4.0 is not found due to the value of ess-r-runners-prefixes. This can of course be customized, but I think it should be changed to include "R-4" -- Best, Kasper [[alternative HTML version deleted]]

Re: [R] Add Gauss normal curve ?

2020-04-11 Thread Daniel Nordlund
020-04-09","2020-04-10")) nc<-c(1,1,2,7,3,6,6,20,17,46,67,71,56,70,85,93,301,339,325,226,608,546,1069,1264,1340,813,608) plot(as.Date(mydates),nc,pch=16,type="o",col="blue",ylim=c(1,1400), xlim=c(min(as.Date(mydates)),max(as.Date(mydates x <- seq(mi

Re: [R] [EXTERNAL] Re: "chi-square" | "chi-squared" | "chi squared" | "chi square" ?

2019-10-21 Thread Dalthorp, Daniel via R-help
igma^2 or x^2 or r^2. On Mon, Oct 21, 2019 at 9:46 AM Ivan Krylov wrote: > On Fri, 18 Oct 2019 15:25:59 -0700 > "Dalthorp, Daniel via R-help" wrote: > > > I'd like to see the statistics on it before jumping to a conclusion > > that the American preference is &q

Re: [R] [EXTERNAL] Re: "chi-square" | "chi-squared" | "chi squared" | "chi square" ?

2019-10-18 Thread Dalthorp, Daniel via R-help
oh my... I'd like to see the statistics on it before jumping to a conclusion that the American preference is "chi-square" and the British preference is "chi-squared". I don't see that at all. -- In keeping with the pronunciation of x^2 and 3^2, maybe "chi-squared" makes the most sense,. The

[R-es] Creación de vector con una secuencia de números enteros.

2019-07-28 Thread Daniel García Abiétar
Buenas. Soy un chaval novato en el uso de R. Ando haciendo un curso online, y he llegado a una parte en la que me he atascado. La instrucción es la siguiente: crea una variable llamada | 'mi_vector' que contenga un vector con los números enteros del 11 al 30. Recuerda | que puedes usar el

Re: [R] Capturing positive and negative changes using R

2019-07-21 Thread Daniel Nordlund
Here is one more option using the ave() function. Using Jim's data and naming convention fkdf$X1_change <- ave(fkdf[,'X1'], fkdf$Country, FUN=function(x) c(0,diff(x))) fkdf$X2_change <- ave(fkdf[,'X2'], fkdf$Country, FUN=function(x) c(0,diff(x))) hope this is helpful, Dan --

[R] cannot install gsl from source?

2019-06-18 Thread Dalthorp, Daniel via R-help
I've been working on a fairly extensive R package for a few years with ongoing testing with Travis CI. Today, though, I'm seeing an error in installing the gsl package both at Travis and from the Windows GUI: install.packages("gsl",repos = getOption("repos"), repo=NULL, type="source") # gives

Re: [R] Nested structure data simulation

2019-05-18 Thread Daniel Nordlund
sense to include both in your model. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.

Re: [R] Downloading R Data

2019-04-14 Thread Daniel Nordlund
kspace. If you wish to do something else, you will need to be more specific about what you want. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] [EXTERNAL] Re: create

2019-04-13 Thread Dalthorp, Daniel via R-help
how about one of the following? vdat$xy <- 2 * (ifelse(is.na(vdat$x1), 0, vdat$x1)) + 5 * (ifelse(is.na(vdat$x2), 0, vdat$x2)) + 3 * (ifelse(is.na(vdat$x3), 0, vdat$x3)) vdat$xy <- ifelse(is.na(as.matrix(vdat[, paste0("x", 1:3)])), 0, as.matrix(vdat[, paste0("x", 1:3)])) %*% c(2, 5, 3) On Sat,

Re: [R] Rank ANCOVA

2019-03-14 Thread Jackson, Daniel
Thanks I am now in personal communication with Frank anyway! Dan -Original Message- From: peter dalgaard Sent: 14 March 2019 10:37 To: Jackson, Daniel Cc: r-help@r-project.org Subject: Re: [R] Rank ANCOVA 1. This is the R-help mailing list, not "Frank and Dennis" 2

[R] Rank ANCOVA

2019-03-13 Thread Jackson, Daniel
Hi Frank and Dennis I am in a similar situation but I would prefer to use a proportional odds model. 2 questions. 1. Has rank ancova been implemented in R now, despite its short comings? 2. Where has it been shown to yield unreliable analyses? I would like this evidence (which I believe

Re: [R] Newton-RaphsonMethod

2019-02-24 Thread Daniel Nordlund
will leave the solution of the problem to you. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

[R-es] Ayuda con leyenda de mapa

2019-02-04 Thread Daniel Chan Espinoza
d_calles) + tm_lines() + tm_shape(Abril) + tm_dots(size = 0.5, col = "sum_aedes", palette = "-RdBu", title="Legend") Utilizando el código anterior, obtengo la siguiente leyenda Quisiera que la leyenda saliera de esta manera

Re: [R-es] ¿Como informe con tablas que se puedan organizar dinámicamente?

2019-01-29 Thread daniel
roject.org > > https://stat.ethz.ch/mailman/listinfo/r-help-es > > > > [[alternative HTML version deleted]] > > ___ > R-help-es mailing list > R-help-es@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es > -- Daniel [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] seq() problem with chron

2018-09-06 Thread Daniel Nordlund
ptime("02/20/13 00:00:00", "%m/%d/%y %H:%M:%S") dt2 <- strptime("07/03/18 15:30:00", "%m/%d/%y %H:%M:%S") dt <- seq(from=dt1, to=dt2, by=900) dt[length(dt)] There might also be some useful functions in the lubridate package. Hope this is helpful,

Re: [R] Converting chr to num

2018-08-19 Thread Daniel Nordlund
%'. The pattern is more strict, and that could cause the conversion to fail if the process that created the strings resulted in trailing spaces. Without the '$' the conversion succeeds. df <- data.frame(variable = c("12.6% ", "30.9%", "61.4%")) as.numeric(su

Re: [R] Rendo and dataMultilevelIV

2018-08-03 Thread Daniel Nordlund
ink to above (which describes the dataMultilevelIV dataset)? Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] Help with transpose please.

2018-06-23 Thread Daniel Nordlund
(1, nrow(have)), have[,1:2], FUN = seq_along), sep='') # cast the data into wide format cast(cbind(have,dxnames), ClaimServiceID + ClaimID ~ dxnames, value='DiagnosisCode') Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __

Re: [R] Cannot Load A Package

2018-06-02 Thread Daniel Nordlund
Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-gu

Re: [R] Using tryCatch in a for loop

2018-05-22 Thread Daniel Nordlund
ject does not have 3 rows, so you get an error and SlopeDiff is not created. You need to correct these problems, and any others, so that your code runs correctly when there are no data problems. Then you can worry about trapping errors in the case where there are data problems. Hope this i

Re: [R] Bootstrap and average median squared error

2018-05-22 Thread Daniel Nordlund
median squared error", shouldn't the final line of the function be median((y - ypred)^2) Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] Average of results coming from B=100 repetitions (looping)

2018-05-08 Thread Daniel Nordlund
) lst[i] <- i mean(lst) # does not work The documentation for mean, ?mean, says that it is looking for a numeric or logical vector. To convert your list to a numeric vector you could unlist() it. mean(unlist(lst)) Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA _

Re: [R] Empirical density estimation

2018-03-11 Thread Daniel Nordlund
this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA On Mon, Mar 12, 2018 at 3:49 AM, Bert Gunter <bgunter.4...@gmail.com> wrote: You need to re-read ?density and perhaps think again -- or do some study -- about how a (kernel) density estimate works. The points at which the

Re: [R] How to turn off warnings about class name conflicts

2018-02-14 Thread Daniel Nordlund
essage you are getting. I suspect you have something in your workspace that is causing the problem. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/list

Re: [ESS] ESS not returning to R process after R> help.start() ?

2018-02-06 Thread Kasper Daniel Hansen
I don't know about running the HTML help system from within Emacs, but ESS directly interfaces with the help system so you can search etc. using ESS. Just try ?something on the command line. Or from a script buffer you can Do C-c C-v to get help on a function. On Tue, Feb 6, 2018 at 8:13 AM,

Re: [R] command line fails

2018-02-02 Thread Daniel Nordlund
ile.r" I don't know how rscript handles the '\' character (i.e. as an escape or not) so I changed the '\' to '/' just to be safe. And note, the program pathname and the file being passed need to be quoted separately. Hope this helps, Dan -- Daniel N

Re: [R] Simulation based on runif to get mean

2018-01-30 Thread Daniel Nordlund
your real world task actually is. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

[R] IBM Power vs Markdown

2018-01-19 Thread Daniel King
register const char *s = wordlist[key]; if unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gperf_case_strncmp (str, s, len) && s[len] == '\0') return s; } } return 0; } Any assistance is appreciated. A. Daniel King Haverty Furnitur

Re: [ESS] Sweave with ESS and AUCTeX

2018-01-19 Thread Kasper Daniel Hansen
To me, I would suspect a path issue. How does tex find the cls file? Possibilities: (1) it is in the same directory as the tex file (2) you have installed it into the texmf tree and updated the tex search path to find it (3) you have put it somewhere (perhaps in the texmf tree) and uses

Re: [R] Missing information in source()

2017-11-07 Thread Daniel Nordlund
On 11/7/2017 12:01 PM, Tom Backer Johnsen wrote: Dear R-help, I am running a Mac under Sierra, with R version 3.4.2 and RStudio 1.1.383. When running head () or tail () on an object in a script using source

Re: [R] Count non-zero values in excluding NA Values

2017-10-29 Thread Daniel Nordlund
looks like a good place for apply() apply(data,2,function(x) sum(x != 0, na.rm=TRUE)) Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailm

Re: [R] Help needed with aggregate or other solution

2017-10-26 Thread Daniel Nordlund
12-04-24 06:00:00", "2012-04-24 12:00:00", "2012-04-24 18:00:00", "2012-04-25 00:00:00", "2012-04-25 06:00:00", "2012-04-25 12:00:00", "2012-04-25 18:00:00", "2012-04-26 00:00:00", "2012-04-26 06:00:00", "2012-0

[R-es] Evaluar el valor p de cada factor en un modelo ZINP

2017-09-03 Thread Daniel Chan Espinoza
Buenas Tardes Me gustaría saber como evaluar la significancia de cada factor, utilizando la prueba likelihood ratio (LRT), basada en la distribución de Chi2 en un modelo con inflación de ceros . saludos Daniel ___ R-help-es mailing list R-help

[R] S-mode PCAs

2017-06-13 Thread Daniel Vecellio
? Thanks in advance, Dan -- *Daniel J. Vecellio* *Ph.D. Student - Climate Science Lab, **Department of Geography, **Texas A University* [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] display double dot over character in plotmath?

2017-05-13 Thread Daniel Nordlund
he NUMLOCK key is on, hold down the alt key and press 0228 on the numeric keypad. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/li

Re: [ESS] Ever consider changing indentation on #?

2017-05-06 Thread Kasper Daniel Hansen
I agree the default is worthwhile changing, especially Paul's nice suggestion of letting # be flush left ## indentation level which would not affect my memory typing (since I never use `#`) and solve irritating indentation issues when I work with other peoples code. Best, Kasper On Sat, May

[R] Unusual behavior in e1071?

2017-05-02 Thread Daniel Jeske
assify as +1 if f(x)>0. Does anyone think the behavior I have noticed is as intended, or is otherwise benign? Thank you, Daniel Jeske Professor Department of Statistics University of California - Riverside [[alternative HTML version deleted]] ___

[R] Question on accessing foreign files

2017-04-18 Thread Daniel Molinari
Hi all, I have several data files provided in mtw format (Minitab) and sdd format (S-Plus) and I need to read them in R. I do not have access either to Minitab or to S-Plus. How can I accomplish this task ? Thank you, Daniel [[alternative HTML version deleted

Re: [R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
Steipe wrote: I discourage the use of print() for debugging. Put a browser() statement into your loop and when execution takes you to the debugger interface, examine your variables and expressions one by one. B. On Apr 4, 2017, at 10:09 AM, DANIEL PRECIADO <danp...@hotmail.com<mailt

Re: [R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
o list, as in: f <- function() ls(.GlobalEnv) f() [1] "f" "foobar" On 4 Apr 2017, at 12:27 , DANIEL PRECIADO <danp...@hotmail.com<mailto:danp...@hotmail.com>> wrote: Thanks, but printing doesn't work within the function either. (i.e, no result or out

Re: [R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
e same as last week? > > -pd > > > > On 4 Apr 2017, at 10:50 , DANIEL PRECIADO <danp...@hotmail.com> > > wrote: > > > > The following function is supposed to search the workspace and save > > plots  (i.e. listing all objects in the workspace na

[R] R function stopped working

2017-04-04 Thread DANIEL PRECIADO
The following function is supposed to search the workspace and save plots  (i.e. listing all objects in the workspace named "Figs", which are all ggplot2 plots, and saving them as png files) SaveFigs <- function() { for (i in ls(pattern="_Figs_")) { filename =

[R] nlmrt problems - No confInt, NA StdErr, t-, or p-values

2017-03-21 Thread DANIEL PRECIADO
Dear list, I want to use nlxb (package nlmrt) to fit different datasets to a gaussian, obtain parameters (including standard error, t-and p-value) and confidence intervals. nlxb generates the parameters, but very often results in NA standard error,t-and p-values. Furthermore, using confint()

[R] nls fitting & plotting to data subsets defined by combinations of categorical variables

2017-03-11 Thread DANIEL PRECIADO
Dear list, I want to apply the same nls function to different subsets of a larger dataset. These subsets are defined as unique combinations of two (categorical) variables, each one with two levels, so I should obtain 4 sets of parameters after fitting. I have managed to do it in a loop,

Re: [R] Reverse the scoring of some Columns of a Data Set

2017-03-08 Thread Daniel Nordlund
):1]) Hope this helps, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/post

Re: [R] [FORGED] how to draw the confidence interval

2017-03-06 Thread Daniel Nordlund
random samples, and then describe what you want, e.g. "plot sample means and standard errors estimated from the samples," we can play along at home. Then you may get some usable help. You could also Google something like "R plot means and standard errors". Dan --

Re: [R] [FORGED] Export Forecasted output to a table (excel)

2017-02-01 Thread Daniel Nordlund
T use Excel. Ever. See: http://www.stat.uiowa.edu/~jcryer/JSMTalk2001.pdf cheers, Rolf Turner Unfortunately, that link appears to be broken / does not exist anymore. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -

Re: [R] Getting Started

2017-01-10 Thread Dalthorp, Daniel
By "contribute", do you mean you have a package (or potential package) that you'd like to share? Or do you have something else in mind? -Dan On Tue, Jan 10, 2017 at 9:33 AM, Lakshya Agrawal wrote: > Hello, > I would like to contribute to R i have gone over the

Re: [R] package ‘Rccp’ is not available (for R version 3.3.2)

2016-12-09 Thread Daniel Nordlund
at.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Should that be the Rcpp package and not Rccp? Dan -- Daniel Nordlund Port Townsen

[R] ggplot2, qplot, problems

2016-12-05 Thread Daniel
1: `stat` is deprecated 2: `position` is deprecated > plot <- plot + facet_grid(type ~ subjectname) > plot Error: stat_count() must not be used with a y aesthetic. ------- tha

Re: [R] transpose rows and columns for large data

2016-11-29 Thread Dalthorp, Daniel
Try David's suggestion to spell the argument "stringsAsFactors" correctly. Then: data <- read.table("your_file_location", sep ="\t", comment.char = "", stringsAsFactors = F, header = T) transpose_data <- t(data) -Dan On Tue, Nov 29, 2016 at 9:56 AM, Elham - via R-help

[R] on ``unfolding'' a json into data frame columns

2016-11-29 Thread Daniel Bastos
Greetings! In an SQL table, I have a column that contains a JSON. I'd like easy access to all (in an ideal world) of these JSON fields. I started out trying to get all fields from the JSON and so I wrote this function. unfold.json <- function (df, column) { library(jsonlite) ret <-

Re: [R] reshaping a large dataframe in R

2016-11-28 Thread Daniel Nordlund
in advance, best Jean-Philippe I don't know about efficiency, but it looks like you could do something like this: y <- t(matrix(t(dataGaus),4)) Maybe someone will come along with something better, Dan -- Daniel Nordlund Port Townsend, WA

Re: [R] tcltk table "validateCommand"

2016-11-17 Thread Dalthorp, Daniel
t entry completion, though. That > does sort of make sense since not every prefix of a valid entry is valid > ("1e-2" is a double, "1e-" is not). If you want to actually disable certain > keys during entry, then you have a larger task on your hand. > >

Re: [R] Average every 4 columns

2016-11-09 Thread Dalthorp, Daniel
incerely, > > Milu > > On Wed, Nov 9, 2016 at 5:45 PM, Dalthorp, Daniel <ddalth...@usgs.gov> > wrote: > >> Hi Milu, >> The following should work for an array x (provided dim(x)[2] is divisible >> by 4): >> >> colMeans(x[,0:(dim(x)[2]/4-1)

Re: [R] Average every 4 columns

2016-11-09 Thread Dalthorp, Daniel
; Milu > > On Wed, Nov 9, 2016 at 5:45 PM, Dalthorp, Daniel <ddalth...@usgs.gov> > wrote: > >> Hi Milu, >> The following should work for an array x (provided dim(x)[2] is divisible >> by 4): >> >> colMeans(x[,0:(dim(x)[2]/4-1)*4+1]) >> >

Re: [R] Average every 4 columns

2016-11-09 Thread Dalthorp, Daniel
Hi Milu, The following should work for an array x (provided dim(x)[2] is divisible by 4): colMeans(x[,0:(dim(x)[2]/4-1)*4+1]) -Dan On Wed, Nov 9, 2016 at 8:29 AM, Miluji Sb wrote: > Dear all, > > I have a dataset with hundreds of columns, I am only providing only 12 >

Re: [R] About reshape dataset

2016-10-22 Thread Daniel Nordlund
with this a bit and this is what I came up with. After running your code I ran DF2$site <- substr(as.character(DF2$variable),1,5) DF2$var <- substr(as.character(DF2$variable),7,10) DF3 <- cast(DF2,year + month + day + site ~ var ) Hope this is helpful, Dan -- Daniel Nordlu

Re: [R] Cannot install package write.xls

2016-10-08 Thread Daniel Nordlund
) What can I do? As far as I know, write.xls and write.table are not packages, they are functions. There is a write.xls function in the xlsx (and also the openxlsx) package and write.table is a built-in R function that exists in the util package. Dan -- Daniel Nordlund Port Townsend, WA USA

Re: [R] (no subject)

2016-10-06 Thread Dalthorp, Daniel
stion > > Jim > > On Fri, Oct 7, 2016 at 9:48 AM, Dalthorp, Daniel <ddalth...@usgs.gov> > wrote: > > Question and answer: > > > > 6*9 = (4)*13^1 + (2)*13^0 > > > > On Thu, Oct 6, 2016 at 3:26 PM, Jim Lemon <drjimle...@gmail.com> wrote:

Re: [R] (no subject)

2016-10-06 Thread Dalthorp, Daniel
Question and answer: 6*9 = (4)*13^1 + (2)*13^0 On Thu, Oct 6, 2016 at 3:26 PM, Jim Lemon wrote: > It certainly does. As we are often confronted with requests for > solutions of problems so minimally defined as to challenge the most > eminent mindreader, this excels. We

Re: [R] Bootstrapping in R

2016-10-01 Thread Daniel Nordlund
that shows you "getting the same answer." Someone may then be able to do more than guess at what the problem is. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] Writing data onto xlsx file without cell formatting

2016-09-27 Thread Daniel Nordlund
ding about the "create" argument on page 13 of this linked document will help: https://cran.r-project.org/web/packages/xlsx/xlsx.pdf Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] Help with strftime error "character string is not in a standard unambiguous format"

2016-09-12 Thread Daniel Nordlund
trptime("Thu, 25 Aug 2016 6:34 PM",format="%a, %d %b %Y %I:%M %p") [1] "2016-08-25 18:34:00 PDT" works for me. Hope this is helpful, Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing li

Re: [R] Rotating points, preferably in grid

2016-08-24 Thread Dalthorp, Daniel
Silly? Not really. It's simple. It works. You could jump into unicode for your text and make it look nicer, e.g., using '\u2191' or some other shape in place of 'T' http://unicode.org/charts/ http://unicode.org/charts/PDF/U2190.pdf -Dan On Wed, Aug 24, 2016 at 7:16 PM, Thomas Levine

[R] problem concernig Survsplit, package survival

2016-08-22 Thread Wollschlaeger, Daniel
. A corrected pdf of the chapter is available at http://dwoll.de/r/gddmr/09_survival.pdf Daniel Wollschlaeger On August 19, 2016 4:21:31 AM PDT, "Vinzenz Völkel via R-help" wrote: >Dear R-help-community, > > > >I hope, that?s the appropiate channel to post a quastion? > >

Re: [R] R bug when started in Windows 10

2016-08-14 Thread Daniel Nordlund
xample you did give of a directory with spaces. It looks like you were using single quotes (') around the path/filename. Windows requires that there be double quotes (") around any path/filename that contains spaces. If you provide a reproducible exam

Re: [R] SAS file

2016-08-08 Thread Daniel Nordlund
mat file, or have SAS available, or get some 3rd party software that will read SAS datasets. Dan -- Daniel Nordlund Port Townsend, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] I'm getting confused with notation and terminology in output from weibull parametric survival model from survreg()

2016-07-29 Thread Dalthorp, Daniel
The parameterization for Weibull in the 'survival' package corresponds to base R's dweibull, etc. suite as 1/scale --> shape and exp(coef[1]) --> scale On Fri, Jul 29, 2016 at 1:07 PM, Christopher W. Ryan wrote: > I'm trying to run a Weibull parametric survival model for

Re: [R] font size in graphs...can R read Windows settings?

2016-07-28 Thread Dalthorp, Daniel
= 1, > > mai = c(0.85, 0.85, 0.32, 0.12), > > font.main = 1, > > cex.main = 1.0, > > cex.lab = 1.0, > > cex.axis = 0.9) > > > > Duncan > > > > *From:* Dalthorp, Daniel [mailto:ddalth...@usgs.gov] > *Sent:* Friday, 29 July 20

Re: [R] font size in graphs...can R read Windows settings?

2016-07-28 Thread Dalthorp, Daniel
gt; Regards > > Duncan > > Duncan Mackay > Department of Agronomy and Soil Science > University of New England > Armidale NSW 2351 > Email: home: mac...@northnet.com.au > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Daltho

[R] font size in graphs...can R read Windows settings?

2016-07-27 Thread Dalthorp, Daniel
Hi All, I am putting together a package that (among other things) draws some nice graphs for users. I place some explanatory text on figs using "text" and "mtext". But the size of the text depends on the Windows display settings: Smaller (100%), medium (125%) or larger (150%) (In Windows 7...

Re: [R] how to expand the dataframe

2016-07-21 Thread Daniel Nordlund
"play along at home" (i.e. give us a reproducible example). Dan Daniel Nordlund Port Townsend, WA -- Daniel Noredlund Bothell, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo

Re: [R] Sampe numbers

2016-07-19 Thread Daniel Nordlund
osting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Daniel Noredlund Bothell, WA USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/m

Re: [R] tclArray() --- "active"?!

2016-07-06 Thread Dalthorp, Daniel
the active cell, and that the widget needs to record > the fact that there is now no active cell.) > > -pd > > > > On 06 Jul 2016, at 16:18 , Dalthorp, Daniel <ddalth...@usgs.gov> wrote: > > > > Sometimes when working with tclArray's, an empty element called &q

[R] tclArray() --- "active"?!

2016-07-06 Thread Dalthorp, Daniel
Sometimes when working with tclArray's, an empty element called "active" is appended to the array. Does anyone know when (and why) this happens? And how to prevent it (or at least predict it so that it can be removed by hand)? E.g., library(tcltk); library(tcltk2) tt<-tktoplevel() dat<-tclArray()

Re: [R] better loop for simulation

2016-06-18 Thread Dalthorp, Daniel
try: n.questions <- 10 # or however many you want mult.choice <- 2 scores <- rbinom(1000, size = n.questions, prob = 1/mult.choice) On Sat, Jun 18, 2016 at 3:12 PM, Naresh Gurbuxani < naresh_gurbux...@hotmail.com> wrote: > I want to calculate a function many times over. My solution below

Re: [R] dplyr's arrange function

2016-06-15 Thread Daniel Nordlund
quot; (in descending order). If you want the character value of line 7 to sort last, it would need to be "06.1 (0.61)" or " 6.1 (0.61)" (notice the leading space). Hope this is helpful, Dan Daniel Nordlund Port Townsend, WA USA __ R-help

Re: [R] break string at specified possitions

2016-05-11 Thread Daniel Nordlund
compute the beginning positions. begs <- function(x) c(0,x[-length(x)])+1 Then, then use that function in your call to str_sub str_sub(test_string,begs(ends),ends) %>% print Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA

  1   2   3   4   5   6   7   8   9   10   >