Re: [R] Removing polygons from shapefile of Scotland and Islands

2024-05-14 Thread Jan van der Laan
I believe mapshaper has functionality for removing small 'islands'. There is a webinterface for mapshaper, but I see there is also an R-package (see https://search.r-project.org/CRAN/refmans/rmapshaper/html/ms_filter_islands.html for island removal). If you want to manually select which

Re: [R] Inquiry about bandwidth rescaling in Ksmooth

2023-10-27 Thread Jan Failenschmid via R-help
Dear Bert, Thank you very much for your quick reply. I have tested this, and it indeed appears to be the source of the discrepancy I observed. My apologies for overlooking this in the documentation and thank you for clarifying. Cheers, Jan From: Bert Gunter

[R] Inquiry about bandwidth rescaling in Ksmooth

2023-10-26 Thread Jan Failenschmid via R-help
Dear Sir, Madam, or to whom this may concern, my name is Jan Failenschmid and I am a Ph.D. student at Tilburg University. For my project I have been looking into different types of kernel regression estimators and corresponding R functions. While comparing different functions I noticed

Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Jan van der Laan
: except perhaps 'V'. I can't say how the support for non-ascii text is over different OS-es and localities. https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Encoding-issues gives some 'hints' On 06-10-2023 14:21, Chris Evans via R-help wrote: Thanks again Jan.  That is lovely

Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Jan van der Laan
t; = "grey",   "C" = "green"),    labels = c("Deteriorated",   "No change",   "Improved")) +   scale_fill_manual(name = "Change",  

Re: [R] Is it possible to get a downward pointing solid triangle plotting symbol in R?

2023-10-06 Thread Jan van der Laan
Does adding , show.legend = c("color"=TRUE, "fill"=FALSE) to the geom_point do what you want? Best, Jan On 06-10-2023 11:09, Chris Evans via R-help wrote: library(tidyverse) tibble(x = 2:9, y = 2:9, c = c(rep("A", 5), rep("B", 3))) -> tmpTibPoints

Re: [R] overlay shaded area in base r plot

2023-09-19 Thread Jan van der Laan
Shorter/simpler alternative for adding a alpha channel adjustcolor("lightblue", alpha = 0.5) So I would use something like: # Open new plot; make sure limits are ok; but don't plot plot(0, 0, xlim=c(1,20), ylim = range(c(mean1+sd1, mean2+sd2, mean1-sd1, mean2-sd2)), type="n", las=1,

Re: [R] Obtaining R-squared from All Possible Combinations of Linear Models Fitted

2023-07-18 Thread Jan van der Laan
ied-R² to the result, respectively (this is more efficient than using r.squaredLR directly). HTH Jan On 17-07-2023 19:24, Paul Bernal wrote: Dear friends, I need to automatically fit all possible linear regression models (with all possible combinations of regressors), and found the MuMI

Re: [R] Plotting directly to memory?

2023-05-28 Thread Jan van der Laan
Perhaps the ragg package? That has an `agg_capture` device "that lets you access the device buffer directly from your R session." https://github.com/r-lib/ragg HTH, Jan On 28-05-2023 13:46, Duncan Murdoch wrote: Is there a way to open a graphics device that plots entirely t

Re: [R] nth kludge

2023-03-09 Thread Jan van der Laan
ist(. = .), enclos = parent.frame()) } 1:3 |> dot(func(1, ., mean(.))) This seams simpler than the lambda notation and more general than your solution. Not sure if this has any drawbacks. HTH, Jan On 08-03-2023 21:23, avi.e.gr...@gmail.com wrote: I see many are not thrilled with the co

Re: [R] foreign package: unable to read S-Plus objects

2023-01-17 Thread Jan van der Laan
You could try to see what stattransfer can make of it. They have a free version that imports only part of the data. You could use that to see if stattransfer would help and perhaps discover what format it is in. HTH Jsn On 16-01-2023 23:22, Joseph Voelkel wrote: Dear foreign maintainers and

Re: [R] Reading very large text files into R

2022-09-29 Thread Jan van der Laan
You're sure the extra column is indeed an extra column? According to the documentation (https://artefacts.ceda.ac.uk/badc_datadocs/ukmo-midas/RH_Table.html) there should be 15 columns. Could it, for example, be that one of the columns contains records with commas? Jan On 29-09-2022 15

Re: [R] How to represent tree-structured values

2022-05-30 Thread Jan van der Laan
mple(1:9, n, replace = TRUE),   event = sample(0:1, n, replace = TRUE)   ) tab <- dta[, .(n = .N, rate = sum(event)/.N),   by = .(level1, level2, level3)] treemap(tab, index = names(tab)[1:3], vSize = "n", vColor = "rate",   type = "value", fontsize.labels = 20*c(

[R] splitting data matrix into submatrices

2022-01-04 Thread Faheem Jan via R-help
I have data in a matrix form of order 1826*24 where 1826 represents the days and 24 hourly observations on each data. My objective is to split the matrix into working (Monday to Friday) and non-working (Saturday and Sunday) submatrices. Can anyone help me that how I will do that splitting using

Re: [R] vectorization of loops in R

2021-11-17 Thread Jan van der Laan
seems to contain an error: `s = df[df$y == i,]` should be `s = df$z[df$y == i]` I think. HTH, Jan On 17-11-2021 14:20, Luigi Marongiu wrote: Hello, I have a dataframe with 3 variables. I want to loop through it to get the mean value of the variable `z`, as follows: ``` df = data.frame(x = c

Re: [R] Is there a hash data structure for R

2021-11-03 Thread Jan van der Laan
ptions, for example %in%, match, duplicated. These are also vectorised; so two vectors: one with keys and one with values might actually be faster than an environment in some use cases. Best, Jan And there are also packages for many features like sets as well as functions to manipulate these

Re: [R] Is there a hash data structure for R

2021-11-02 Thread Jan van der Laan
ate a data.frame with multiple columns with the same name. But as Duncan Murdoch mentions you can usually control for that. Best, Jan On 02-11-2021 11:32, Yonghua Peng wrote: But for data.frame the colnames can be duplicated. Am I right? Regards. On Tue, Nov 2, 2021 at 6:29 PM Jan van der L

Re: [R] Is there a hash data structure for R

2021-11-02 Thread Jan van der Laan
True, but in a lot of cases where a python user might use a dict an R user will probably use a list; or when we are talking about arrays of dicts in python, the R solution will probably be a data.frame (with each dict field in a separate column). Jan On 02-11-2021 11:18, Eric Berger

Re: [R] Getting different results with set.seed()

2021-08-19 Thread Jan van der Laan
age? In that case you also have to set the seed in the parallel workers. Best, Jan On 19-08-2021 11:25, PIKAL Petr wrote: Hi Did you try different order? Step 2: set.seed (123) Step 1. Self-coded functions (these functions generate random numbers as well) Step 3: Call those functions. S

[R] Mean absolute error from data matrix

2021-06-23 Thread Faheem Jan via R-help
I have data matrix of order 24*2192 where 2192 are the days and 24 are hour's of a single day,so simple words I have 2192 days and each day having 24 observations.the data matrix is divided into two matrix,the ist matrix is of order 24*1827 and second is of order 24*365. Suppose the ist column

Re: [R] Read fst files

2021-06-09 Thread Jan van der Laan
accept. Also, because it is a binary compressed format using a compression method that is fast to read, compressing also to zip seems to defeat the purpose of fst. HTH, Jan On 09-06-2021 15:28, Duncan Murdoch wrote: On 09/06/2021 9:12 a.m., Jeff Reichman wrote: Duncan Yea that will work

Re: [R] What is an alternative to expand.grid if create a long vector?

2021-04-20 Thread Jan van der Laan
helping you decide which method to use does not fit on this list. Perhaps de overview linked to above (and the terms 'grid search' and 'optimization') can help you find an appropriate method. HTH, Jan On 20-04-2021 09:02, PIKAL Petr wrote: Hi Keep your mails on the list. Actually you did

Re: [R] What is an alternative to expand.grid if create a long vector?

2021-04-20 Thread Jan van der Laan
600/24/365 [1] 3170.979 years. -- Jan On 20-04-2021 03:46, Avi Gross via R-help wrote: Just some thoughts I am considering about the issue of how to make giant objects in memory without making them giant or all in memory. As stupid as this sounds, when things get really big, it ca

[R] Check accuracy of the model

2021-04-17 Thread Faheem Jan via R-help
- Hi, hope that you will be fine, I have a problem with functional time series, I am working with the hourly electricity spot price data, due to the large dimensionality I convert the discrete data into functional data. The model I use the functional autoregressive model of order

Re: [R] /usr/local/lib/R/site-library is not writable

2021-04-08 Thread Jan van der Laan
centrally on the server/network, so I actually usually end up with a mixture of central, personal and project libraries. Theory vs practice. HTH, Jan On 08-04-2021 02:58, Dirk Eddelbuettel wrote: Hi Gene, "It's complicated". (Not really, but listen for a sec...) We need to ship a defa

[R] forecast accuracy

2021-02-17 Thread Faheem Jan via R-help
I am new in the functional time series,  my question may be stupid as  I am new, I am  functional forecasting one year a head, Know I want to check the forecast accuracy by calculating the mean absolute percentage error, but I am unable to due this R, please help me or suggest me any link which

[R] forecast accuracy

2021-02-05 Thread Faheem Jan via R-help
I am working in the functional time series, I obtain the one year ahead forecast in the functional format, Know i want to forecast accuracy for example mean absolute percentage error in R, please help how i do this in R [[alternative HTML version deleted]]

[R] forecast accuracy

2021-02-04 Thread Faheem Jan via R-help
I am working in the functional time series, I obtain the one year ahead forecast in the functional format, Know i want to forecast accuracy for example mean absolute percentage error in R, please help how i do this in R [[alternative HTML version deleted]]

Re: [R] Col names in a data frame

2021-01-21 Thread Jan T. Kim via R-help
lly, I don't find the results of make.names that useful, though, and I tend to sanitise them myself when working with data frames with unwieldy column names). Best regards, Jan On Thu, Jan 21, 2021 at 03:58:44PM -0500, Bernard McGarvey wrote: > Here is an example piece of code to illustrate

Re: [R] Help with connection issue for R (just joined, leading R for our agency)

2020-12-15 Thread Jan van der Laan
a relatively recent version though. HTH, Jan On 14-12-2020 12:54, Michael Dewey wrote: Just to add to Petr's comment there are other basic editors with syntax highlighting like Notepad++ which are also OK if you want a fairly minimalist approach. Michael On 14/12/2020 08:16, PIKAL Petr wrote

[R] Help in R code

2020-10-18 Thread Faheem Jan via R-help
Good morning,  Please help me to code this code in R. I working in the multivariate time series data, know my objective is that to one year forecast of the hourly time series data, using first five as a training set and the remaining one year as validation. For this  I transform the the data

[R] Help in Coding

2020-10-13 Thread Faheem Jan via R-help
Good morning dear administrators, Please help me to code this code in R. I working in the multivariate time series data, know my objective is that to one year forecast of the hourly time series data, using first five as a training set and the remaining one year as validation. For this  I

[R] Installing a Package

2020-10-11 Thread Faheem Jan via R-help
Hello, I am working in the nonparametric functional data analysis, i stack in a simple problem is that i am  going to install a package in the name of nfda which is not present in the  R Cran, know how i am going to install this package in R studio from archives or some thing else. please

[R] Help in R code

2020-10-04 Thread Faheem Jan via R-help
Hello , i am working in the functional time series using themultivariate time series data(hourly time series data). Sir  i am usingFAR model more than one order for which no statistical package is available inR, so for this i convert my data into functional form and obtained thefunctional

[R] help in R code

2020-10-02 Thread Faheem Jan via R-help
Hello , i am working in the functional time series using the multivariate time series data(hourly time series data). Sir  i am using FAR model more than one order for which no statistical package is available in R, so for this i convert my data into functional form and obtained the functional

Re: [R] Would Like Some Advise

2020-08-29 Thread Jan Galkowski
systems are deals with the Devil. It's what you put up with and deal with. As you can see, I opted to go the Windows route again, for probably the next 10 years. YMMV. - Jan On Sat, Aug 29, 2020, at 06:00, r-help-requ...@r-project.org wrote: > From: "Philip" > To: "r

Re: [R] How to read a file containing two types of rows - (for the Netflix challenge data format)

2020-01-31 Thread Jan Galkowski
ed '%s'.\n", file)) > ip<- D$ip > withinBlock<- sapply(X=ip, FUN=function(s) as.integer((strsplit(x=s, > split=".", fixed=TRUE)[[1]])[4])) > D$within.block<- withinBlock > return(D) > } > In short, one pass pulls in all the records into an internal

[R] Extracting a particular column from list

2020-01-16 Thread Faheem Jan via R-help
Hi. How to extract a column from the list.. I will be thanks full..  Sent from Yahoo Mail on Android [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] spurious locking of packages

2019-12-27 Thread Jan Galkowski
attached base packages: > [1] stats graphics grDevices utils datasets methods base > > loaded via a namespace (and not attached): > [1] compiler_3.6.2 > > > Eventually, I get to the end of P and call it done. Anyone have a suggestion for an easier workaround? - Jan Galkowsk

[R] Conversion of multivariate time series to functional time series

2019-09-19 Thread Faheem Jan via R-help
Hi, i am try to generalize the Functional autoregressive model of order one FAR(1) to FAR(p) through  functional principle component by  choosing a particular amount of variation, then using the functional scores of functional principle component  for the prediction of vector autoregressive

[R] Fw: How to read a file saved in Rstudio

2019-09-12 Thread Faheem Jan via R-help
Subject: How to read a result  saved in Rstudio HI, i run the simulation result in other computer with high speed computer ,i save the result in the rda file. know i want to open this file rda file  in my laptop, the file loaded in my laptop , i got the error like this 

[R] Durbin- Levinson algorithm

2019-09-04 Thread Faheem Jan via R-help
hi, i have a problem that how i could use Durbin- levinson algorithm for prediction in case of multiple time series? how i could do this in R... [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

[R] Functional final prediction error

2019-09-04 Thread Faheem Jan via R-help
Hi, my question is related functional data analysis, what is functional final prediction error how we can use to transform vector autoregressive model to its functional form...need help in this regard i will be thanks ful.. [[alternative HTML version deleted]]

Re: [R] R 3.6.1 and apcluster package

2019-07-18 Thread Jan Galkowski
I have confirmed that a complete workaround to these problems is available if, as Bill Dunlap suggested, "version=2" is used in all *save* incantations. Thanks Bill! - Jan On Thu, Jul 18, 2019, at 10:39, William Dunlap wrote: > Note that you can reproduce this in R-3.5.1 i

[R] R 3.6.1 and apcluster package

2019-07-18 Thread Jan Galkowski
> # Test for saving. Jan Galkowski, 17th July 2019. > # produceProtectionFault.R > > library(apcluster) > cl1 <- cbind(rnorm(100, 0.2, 0.05), rnorm(100, 0.8, 0.06)) > cl2 <- cbind(rnorm(50, 0.7, 0.08), rnorm(50, 0.3, 0.05)) > x <- rbind(cl1, cl2) > > ## comput

[R] R 3.6.1

2019-07-17 Thread Jan Galkowski
ars. My inclination is to drop back to 3.6.0 if it is just me or if no one knows about this problem. Thanks, - Jan Galkowski. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see ht

[R] functional autoregressive model of order more than one

2019-07-09 Thread Faheem Jan via R-help
HI, hope all of you will be fine. i am working in functional time series analysis. i fit the functional autoregressive model using FAR package in R, Know i want to generalize our model. How i can do this in R please help in this regard. i will be thankful   [[alternative HTML version

[R] functional autoregressive model of order two

2019-05-09 Thread Faheem Jan via R-help
HI, i am functional data analysis, using times series data to which i fit the functional autoregressive model of order one using FAR package in R, know i want to extend my model to order two as it is observed that the FAR package can  only do for order one., can any body help me that how to

[R] fitting functional autoregresive model

2019-05-06 Thread Faheem Jan via R-help
Hi, i trying to  extend the functional autoregressive model one FAR(1) to fit the functional autoregressive model of order two FAR(2). the coding i do for far(1) is library(fda)library(far)# CREATE DUMMY VARIABLESfactor2dummy=function(x){  n=length(x)  tab=as.factor(names(table(x))) 

[R] Bifactor model and infit statistics?

2019-04-11 Thread kende jan via R-help
Goodafternoon, I amcurrently in the process of calibrating an item bank using a GPCM model. So, amI right to assume that the bifactor model allows me to work with my generalfactor by assimilating it to a one-factor model, without taking into account groupfactors? That is, I can estimate my

[R] readxl::excel_sheets in tryCatch() doesn't catch error

2019-02-06 Thread Phillip-Jan van Zyl via R-help
Hi R programmers I am reading multiple .xls and .xlsx files from a directory using readxl from tidyverse. When reading fails, the code should continue on to the next file. However, when I call the custom function readExcelSheets (in a loop and with the tryCatch function) I get an error for

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-23 Thread Jan T Kim via R-help
Hi Duncan, On Wed, Jan 23, 2019 at 10:02:00AM -0500, Duncan Murdoch wrote: > On 23/01/2019 5:27 a.m., Jan T Kim wrote: > >Hi Ivan & All, > > > >R's scoping system basically goes to all environments along the call > >stack when trying to resolve an unbound variable,

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-23 Thread Jan T Kim
cide whether and how the code should be rewritten, I'd say that depends on the underlying intentions / purposes. As it is, the code could be simplified to just print("secret"); but that's probably missing the point. Best regards, Jan [1] https://cran.r-project.org/doc/manuals/r-relea

Re: [R] Random projection

2018-12-05 Thread Jan Galkowski
Ms Fleming, This blog post (of mine) may be of interest and hopefully of help: https://667-per-cm.net/2018/11/20/the-johnson-lindenstrauss-lemma-and-the-paradoxical-power-of-random-linear-operators-part-1/ Cheers! -- Jan Galkowski (o°) Westwood, MA (pronouns: *he, him, his*) *Keep your energy

Re: [R] saveRDS() and readRDS() Why?

2018-11-07 Thread Jan van der Laan
nted to. Also, if the object is generated by a package, you might need to load the package to get the printing etc. of the object right. HTH, Jan On 07-11-18 09:45, Patrick Connolly wrote: On Wed, 07-Nov-2018 at 08:27AM +, Robert David Burbidge wrote: |> Hi Patrick, |> |> Fr

Re: [R] Plot a path

2018-11-01 Thread Jan van der Laan
ng(cbind(d$lon, d$lat))) %>% unname() %>% # Without the unname it doesn't work for some reason st_sfc() # Plot using leaflet leaflet() %>% addTiles() %>% addPolylines(data = lines) HTH - Jan On 01-11-18 11:27, Rui Barradas wrote: Hello, The following uses ggplot2. Fi

Re: [R] Calculating just a single row of dissimilarity/distance matrix

2018-10-27 Thread Jan van der Laan
are probably various other solutions too. -- Jan On 27-10-18 18:04, Aerenbkts bkts wrote: Dear Jan Thanks for your help. Actually it works for the first element. But I tried to calculate distance values for the first N rows. For example; gower_dist(iris[1:5,], iris) // gower distance f

Re: [R] Calculating just a single row of dissimilarity/distance matrix

2018-10-26 Thread Jan van der Laan
Using another implementation of the gower distance: library(gower) gower_dist(iris[1,], iris) HTH, Jan On 26-10-18 15:07, Aerenbkts bkts wrote: I have a data-frame with 30k rows and 10 features. I would like to calculate distance matrix like below; gower_dist <- daisy(data-fr

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread Annaert Jan
relation coefficient, known at least since Kendall, M. G. (1954). Note on bias in the estimation of autocorrelation. Biometrika, 41(3-4), 403-404. The bias is approximately -1/T, with T sample size, which explains why it seems to disappear in the larger sample size

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm

2018-10-04 Thread Annaert Jan
Did you take into account that the sample serial correlation coefficient has a bias of approximately -1/T (with T the sample size)? Its variance is approximately 1/T. Jan Annaert -Original Message- From: R-help On Behalf Of hmh Sent: donderdag 4 oktober 2018 12:09 To: R Subject: [R

Re: [R] Erase content of dataframe in a single stroke

2018-09-27 Thread Jan van der Laan
Or testdf <- testdf[FALSE, ] or testdf <- testdf[numeric(0), ] which seems to be slightly faster. Best, Jan Op 27-9-2018 om 10:32 schreef PIKAL Petr: Hm I would use testdf<-data.frame(A=c(1,2),B=c(2,3),C=c(3,4)) str(testdf) 'data.frame': 2 obs. of 3 variables: $ A: num

Re: [R] reading data problem

2018-09-24 Thread Jan T Kim via R-help
hmm... I don't see the quote="" paraneter in your read.csv call Best regards, Jan -- Sent from my mobile. Apologies for typos and terseness On Mon, Sep 24, 2018, 20:40 greg holly wrote: > Hi Jan; > > Thanks so much for this. Yes, I did. Her is my code to read

Re: [R] reading data problem

2018-09-24 Thread Jan T Kim via R-help
Yet one more: have you tried adding quote="" to your read.table parameters? Quote characters have a 50% chance of being balanced, and they can encompass multiple lines... On Mon, Sep 24, 2018 at 11:40:47AM -0700, Bert Gunter wrote: > One more question: > > 5. Have you tried shutting down,

Re: [R] R shared library (/usr/lib64/R/lib/libR.so) not found.

2018-08-23 Thread Jan T Kim via R-help
nstalled Rstudio for some MOOC, and ended up putting a symlink in somewhere like /usr/lib* , because Rstudio was only available as a binary with the location of the shared lib hard-baked into it. Depending on your this may be irrelevant, apologies in that case. Best regards, Jan On Thu, Aug

Re: [R] security using R at work

2018-08-09 Thread Jan van der Laan
safe. Jan On 09-08-18 09:19, Rainer M Krug wrote: I can not agree more, Barry. Very nicely put. Rainer On 8 Aug 2018, at 18:10, Barry Rowlingson wrote: On Wed, Aug 8, 2018 at 4:09 PM, Laurence Clark wrote: Hello all, I want to download R and use it for work purposes. I hope to use

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-03 Thread Annaert Jan
ot;(Intercept)=0", "x=1")) Linear hypothesis test Hypothesis: (Intercept) = 0 x = 1 Model 1: restricted model Model 2: y ~ x Res.Df RSS Df Sum of Sq F Pr(>F) 1 10 10.6218 2 8 9.0001 21.6217 0.7207 0.5155 Jan From: R-help on

Re: [R] (no subject)

2018-07-10 Thread Werning, Jan-Philipp
Hi, thanks a lot! Now it works. Yours Jan Am 10.07.2018 um 09:00 schrieb PIKAL Petr mailto:petr.pi...@precheza.cz>>: Hi see in line -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Werning, Jan- Philipp Sent: Monday, July 9, 2018 9:42 PM

[R] (no subject)

2018-07-09 Thread Werning, Jan-Philipp
ection in R studio, now both are the same, in the value section as "Numed num" Yet, the model will not run using these values ultimately coming from the csv. What am I doing wrong here? It would be great if you could help. Thanks a lot in advance Yours

[R] [R-pkgs] Natural Language Processing for non-English languages with udpipe

2018-01-16 Thread Jan Wijffels
://universaldependencies.org all the best, Jan Jan Wijffels Statistician www.bnosac.be | +32 486 611708 [[alternative HTML version deleted]] ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages

[R] Numerical stability in chisq.test

2017-12-27 Thread Jan Motl
er rather than in the decreasing order? Best regards, Jan Motl PS: This post is based on discussion on https://stackoverflow.com/questions/47847295/why-does-chisq-test-sort-data-in-descending-order-before-summation <https://stackoverflow.com/questions/47847295/why-does-chisq-test-sort-data-i

[R] [R-pkgs] release of version 0.2 of the textrank package

2017-12-21 Thread Jan Wijffels
/vignettes/textrank.html and it also plays nicely with the udpipe package ​ https://CRAN.R-project.org/package=udpipe which is good for parts-of-speech tagging, lemmatisation, dependency parsing and general NLP processing. ​all the best, Jan Jan Wijffels Statistician www.bnosac.be [[alternative

[R] DeSolve Package and Moving Average

2017-11-29 Thread Werning, Jan-Philipp
estep exists, this is logical. Yet I would expect the movavg function to produce a new value in each of the 120 timesteps, as it is the case with all other flow, stock and aux calculations as well. It would be great if you could help me with fixing this problem. Many thanks in advance

Re: [R] R and LINGO?

2017-11-10 Thread Jan Olsen Røyland
, assume zero discount rate.) Med Vennelig Hilsen Jan Olsen R�yland [[alternative HTML version deleted]] __ 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

[R] Linear regression with tranformed dependant variable

2017-10-23 Thread kende jan via R-help
Dear all, I am trying to fit a multiple linear regression model with a transformed dependant variable (the normality assumption was not verified...).  I have realised a sqrt(variable) transformation... The results are great, but I don't know how to interprete the beta coefficients... Is it

Re: [R] Help understanding why glm and lrm.fit runs with my data, but lrm does not

2017-09-14 Thread Jan van der Laan
the maximum number of iterations. One possible solution is to try to increase the maximum number of iterations, e.g.: fit1 <- lrm(DAY30~AGE+HYP+KILLIP+HRT+ANT, data = gusto2, maxit = 100) HTH, Jan On 14-09-17 09:30, Bonnett, Laura wrote: Dear all, I am using the publically available Gus

[R] How to extract values after using metabin from the package meta?

2017-05-04 Thread jan Pierre
Hello, I’m trying to do a meta-analysis with R. I tried to use the function metabin from the package meta : data <- data.frame(matrix(rnorm(40,25), nrow=17, ncol=8))

[R] R 3.4.0 on Windows 7 Home Premium installed apparently fine, but packages failing to load ...

2017-04-25 Thread Jan Galkowski
5 sums checked package ‘SparseM’ successfully unpacked and MD5 sums checked package ‘survival’ successfully unpacked and MD5 sums checked package ‘VineCopula’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\Jan\AppData\Local\Temp\Rtmpyekpgu\download

Re: [ESS] Curly brace indentation

2016-12-08 Thread Jan T Kim via ESS-help
Hi Martin and All, thanks for your reply, please see my comments inline below: On Thu, Dec 08, 2016 at 09:09:10AM +0100, Martin Maechler wrote: > >>>>> Jan T Kim via ESS-help <ess-help@r-project.org> > >>>>> on Tue, 6 Dec 2016 01:11:20 + writes

[ESS] Curly brace indentation

2016-12-05 Thread Jan T Kim via ESS-help
es occurs only after some delay caused by briefly flashing the cursor at the corresponding opening brace. Quite possibly I'm using a clumsy approach to try to get indentation during typing consistent with that produced by indent-region, so suggestions where I may have messed up are welcome. Best

Re: [R] function which returns number of occurrences of a pattern in string

2016-10-24 Thread Jan Kacaba
many more very useful functions with not too much more typing. > > On Thu, Oct 20, 2016 at 5:47 PM, Jan Kacaba <jan.kac...@gmail.com> wrote: > > Hello dear R-help > > > > I tried to find function which returns number of occurrences of a pattern > > in string.

[R] function which returns number of occurrences of a pattern in string

2016-10-20 Thread Jan Kacaba
Hello dear R-help I tried to find function which returns number of occurrences of a pattern in string. The closest match I've found is str_locate_all in stringr package. I can use str_locate_all but write my function but I don't want reinvent wheel. JK [[alternative HTML version

Re: [R] strange output of cat function used in recursive function

2016-10-01 Thread Jan Kacaba
2016-10-01 18:02 GMT+02:00 David Winsemius <dwinsem...@comcast.net>: > >> On Oct 1, 2016, at 8:44 AM, Jan Kacaba <jan.kac...@gmail.com> wrote: >> >> Hello Dear R-help >> >> I tried to understand how recursive programming works in R. Bellow i

[R] strange output of cat function used in recursive function

2016-10-01 Thread Jan Kacaba
Hello Dear R-help I tried to understand how recursive programming works in R. Bellow is simple recursive function. binary1 <- function(n) { if(n > 1) { binary(as.integer(n/2)) } cat(n %% 2) } When I call binary1(10) I get 1010. I believe that cat function stores value to a buffer

[R] R Studio: Run script upon saving or exiting

2016-08-13 Thread Jan Kacaba
Dear R help, I would like to run script upon saving project files or exiting the R Studio. For example I would like to backup whole project in another directory. The backup directory should be named such that incremental version number will added to project name. Is it somehow possible? Even

[R] print all variables inside function

2016-05-23 Thread Jan Kacaba
Hello dear R-help I would like to use some short and simple names multiple times inside one script without collisions. I need to wrap the variables inside some object. I know I can use class function or environment. For example as follows: exmp1<-function(){ # knowns pa=0.35 pb=0.35

Re: [R] break string at specified possitions

2016-05-17 Thread Jan Kacaba
t(x, at=PartitioningByEnd(ends)) > } > > Will be much faster than substring (e.g. 100x or 1000x) when > chopping a string like a Human chromosome into hundreds or > thousands of fragments. > > Biostrings is a Bioconductor package: > > https://bioconductor.org/packag

Re: [R] break string at specified possitions

2016-05-12 Thread Jan Kacaba
t; > On Thu, May 12, 2016 at 10:05 AM, Jim Lemon <drjimle...@gmail.com> wrote: >> Hi Jan, >> This might be helpful: >> >> chop_string<-function(x,ends) { >> starts<-c(1,ends[-length(ends)]-1) >> return(substring(x,starts,ends)) >> } >>

Re: [R] break string at specified possitions

2016-05-11 Thread Jan Kacaba
am's 'stringr' package: > https://cran.r-project.org/web/packages/stringr/stringr.pdf > > Cheers, > > Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkel

[R] break string at specified possitions

2016-05-11 Thread Jan Kacaba
Dear R-help I would like to split long string at specified precomputed positions. 'substring' needs beginings and ends. Is there a native function which accepts positions so I don't have to count second argument? For example I have vector of possitions pos<-c(5,10,19). Substring needs input

[R] svyciprop object

2016-05-06 Thread kende jan via R-help
Hi, I'd like to access to the different elements in a svyciprop object (to the confidence intervals in particular...). But none of the functions I know works.Thank you for your help ! > grr <- svyciprop(~temp==bzz, dclus1)> grr                               2.5%   > 97.5%temp == bzz 0.040719697

[R] row names, coulmn names

2016-05-01 Thread Jan Kacaba
Hello dear R helpers, Is it possible to have more than 1 row for column names in data.frame, array, tbl_df? I would like to have column numbers in the first row, string names in the second row, physical unit in third row. How would I do it? Derek [[alternative HTML version deleted]]

[R] inserting row(column) in array or dataframe at specified row(column)

2016-05-01 Thread Jan Kacaba
Hello dear R users, Is there a function or package which can insert row, column or array in another array at specified place (row or column)? I have made several attempts at this function optimizing both speed, code readability and ease of use. The functions are of following format:

[R] (windows) opening document with particular exe file

2016-04-26 Thread Jan Kacaba
Hello dear R, I dont have specific task on mind just learning R. 1) Is it possible to open a document for example path1\myfile.pdf with program path2\pdfviewer.exe ? How would I do it in win? Does it differ in linux? 2) Is it possible to run a program and supply to it some streams? The streams

Re: [R] Accented characters, windows

2016-03-30 Thread Jan Kacaba
ring to a file. I hope there is no problem processing strings with other functions like paste, strsplit, grep though. Derek 2016-03-30 0:56 GMT+02:00 Duncan Murdoch <murdoch.dun...@gmail.com>: > On 29/03/2016 5:39 PM, Jan Kacaba wrote: > >> I have problem with accente

[R] Accented characters, windows

2016-03-29 Thread Jan Kacaba
I have problem with accented characters. My OS is Win 8.1 and I'm using RStudio. I make string : av="ěščřž" When I call "av" I get result bellow. > av [1] "ìšèøž" The resulting characters are different. I have similar problem when I write string to a file. In RGUI if I call "av" it prints

[R] R studio kniter

2016-03-22 Thread Jan Kacaba
Hello, is it possible to run kiniter by script instead by clicking on button compile PDF? Say I have "texfile.rnw" and "myscript.R". I would like to knit texfile.rnw by runnig script "myscript.R". In "myscript.R" I would write something like this: knit("texfile.rnw") [[alternative HTML

Re: [R] How to reach the column names in a huge .RData file without loading it

2016-03-19 Thread Jan T Kim
On Wed, Mar 16, 2016 at 03:18:27PM -0400, Duncan Murdoch wrote: > On 16/03/2016 1:40 PM, Jan Kim wrote: > >Barry: that's an interesting hack. > > > >I do feel compelled to make two comments, though, regarding the > >general issue rather than the scraping idea: &

Re: [R] How to reach the column names in a huge .RData file without loading it

2016-03-19 Thread Jan Kim
is normally adequate or at least good enough, but .RData images are never a good idea. Best regards, Jan P.S.: I've seen .RData images containing many months worth of interactive work, and multiple variants of data frames in variables with more or less similar names, so the set of strings scraped off these

[R] treating integer(0) and NULL in conditions and loops

2016-03-11 Thread Jan Kacaba
Hello, I have following problem in loops. It occurred to me multiple times bellow is an example. Inside if() I have sometimes function f(x) which may return integer(0). If I test f(x)>1 and f(x)=integer(0) I get error. Maybe it can be solved more eloquently without loop or swithces. I don't

[R] assign a vector to list sequence

2016-03-09 Thread Jan Kacaba
Hello I would like to assign a vector to list sequence. I'm trying my code bellow, but the output is not what inteded. # my code mls=vector(mode="list") # my list cseq=c(1:3) # my vector mls[cseq]=cseq I get following: [[1]] [1] 1 [[1]] [2] 2 [[1]] [2] 3 What I need is this: [[1]] [1] 1 2 3

  1   2   3   4   5   >