Re: [R] iterators : checkFunc with ireadLines

2020-05-23 Thread William Michels via R-help
Hi Laurent, Seeking to give you an "R-only" solution, I thought the read.fwf() function might be useful (to read-in your first column of data, only). However Jeff is correct that this is a poor strategy, since read.fwf() reads the entire file into R (documented in "Fixed-width-format files",

[R] Wordcloud errors

2020-05-23 Thread Bryan Mac
Hi all, I am trying to create word clouds using this script but I am getting warnings. Script: if (runtype=="native") { words <- Corpus(VectorSource(test123b[,2])) wordcloud(words, min.freq = minfreq, max.words=300, random.order = FALSE ,colors=brewer.pal(9,"Reds")[0:-3])

Re: [R] [External Email] Re: [External] Re: access for free more than 500 essential Springer Nature textbooks

2020-05-23 Thread peter dalgaard
Some of them are generally available. At least they look that way from here E.g., (shameless plug...) https://link.springer.com/book/10.1007/978-0-387-79054-1 -pd > On 23 May 2020, at 06:15 , Christopher W. Ryan wrote: > > Am I interpreting this offer correctly, that it is for libraries

Re: [R] Wordcloud warnings

2020-05-23 Thread John Kane
Hi Brian, i think we may need a bit more information. It looks like you are doing some text mining; can you tell us what libraries you have loaded and perhaps provide us with some sample data? And an example of what you are doing? See the links below for some suggestions

Re: [R] access for free more than 500 essential Springer Nature textbooks

2020-05-23 Thread Patrick (Malone Quantitative)
Thanks, Rich! I found several books to peruse. On Fri, May 22, 2020 at 12:29 PM Richard M. Heiberger wrote: > Springer has just made available free access to many books through July. > This is part of their global program to support educators, students > and academics > affected by coronavirus

Re: [R] min rows multiplication by the max rows

2020-05-23 Thread Jeff Newmiller
Please post using plain text format... otherwise what we see can be corrupted as compared to what you saw. The obvious solution is: apply( M, 1, min ) * apply( N, 1, max ) but Google sez there is an optimized version useful with large matrices: library( Rfast ) rowMins( M ) * rowMins( N )

Re: [R] min rows multiplication by the max rows

2020-05-23 Thread Rui Barradas
Hello, I have just found out that you are cross posting [1]. Please do not cross post, ask a question, wait for an answer and after or 3 days, if you don't have a (satisfactory) answer, ask somewhere else. [1]

Re: [R] min rows multiplication by the max rows

2020-05-23 Thread Rui Barradas
Hello, Use ?apply on each of the matrices. min_max <- function(X, Y, na.rm = FALSE){ Min <- apply(X, 1, min, na.rm = na.rm) Max <- apply(Y, 1, max, na.rm = na.rm) Min*Max } min_max(M, N) #[1] 4 3 4 Hope this helps, Rui Barradas Às 15:30 de 23/05/20, Vahid Borji escreveu: Hi my R

[R] min rows multiplication by the max rows

2020-05-23 Thread Vahid Borji
Hi my R friends, I have two matrices as follows: M<-matrix(c(1,4,1,3,1,4,2,3,1,2,1,2),3) 1322 4131 1412 N<-matrix(c(1,1,2,2,3,4,-2,2,1,4,3,-1),3) 12 -24 1323 241 -1 I want to find a vector which is a matrix 1*3 and each of

Re: [R] How to make a vector with string elements without space

2020-05-23 Thread Boris Steipe
The c() is unnecessary. paste() returns a vector. Paste separates elements with " " by default. Set the separator to "" instead. paste("c",1:10, sep = "") ... or use paste0(), which has "" as default separator. paste0("c",1:10) ?paste is your friend. B. > On 2020-05-23, at 22:25, Vahid

[R] How to make a vector with string elements without space

2020-05-23 Thread Vahid Borji
Hello my r friends, I want to make a vector with elements (c1,c2,...,c10). I wrote the below code: c(paste("c",1:10)) My code works but it gives me elements like "c 1", "c 2" to "c 10". I mean there is a space between each c and its corresponding number. I want the elements of the vector to be

Re: [R] Bayesian estimation with MCMC

2020-05-23 Thread Ivan Krylov
On Sat, 23 May 2020 14:58:34 +0530 Christofer Bogaso wrote: >Any pointer will be highly appreciated. "Getting help with R" [1] describes several ways of looking for R-related things. In particular, there is a Bayesian CRAN Task View [2], which (as of now) has 52 occurrences of "MCMC". -- Best

Re: [R] Bayesian estimation with MCMC

2020-05-23 Thread Eric Berger
Hi Christofer, Did you try web search? I entered 'R CRAN Bayesian parameter estimation with MCMC' and it came back with the following which seems relevant. https://cran.r-project.org/web/packages/airGR/vignettes/V02.2_param_mcmc.html There are other search results, such as:

Re: [R] The best way for making speciall matrix

2020-05-23 Thread Rui Barradas
Hello, Please keep this on the list, R-help is threaded and it becomes part of the archives, maybe it will be usefull to others. You are now asking 2 other different questions. Are you looking for something like this? two_values_mat <- function(n, fill = 1, diagonal = 0){ m <-

Re: [R] The best way for making speciall matrix

2020-05-23 Thread Abby Spurdle
This sounds like a homework question... But... numerical linear algebra rocks... cbind (diag (1:3), 4:6) On Sat, May 23, 2020 at 9:46 PM Vahid Borji wrote: > > Hi my friends, > > I want to make the below matrix in r: > > 1 0 0 4 > > 0 2 0 5 > > 0 0 3 6 > > I used the below code: > >

Re: [R] The best way for making speciall matrix

2020-05-23 Thread Rui Barradas
Hello, Use diag() and cbind(). special_mat <- function(n){ if(n %% 2 != 0) { msg <- paste(sQuote(n), 'is not a multiple of 2, will use') n <- 2*(n%/% 2) msg <- paste(msg, sQuote(n)) warning(msg) } x <- diag(n/2) diag(x) <- seq.int(n/2) cbind(x, (n/2 + 1):n) }

Re: [R] The best way for making speciall matrix

2020-05-23 Thread Ashim Kapoor
Dear Vahid, Would this help? > row1<- c(1,0,0,4) > row2<- c(0,2,0,5) > row3<- c(0,0,3,6) > mymatrix <- rbind(row1,row2,row3) > mymatrix [,1] [,2] [,3] [,4] row11004 row20205 row30036 > Best Regards, Ashim On Sat, May 23, 2020 at 3:16 PM

[R] The best way for making speciall matrix

2020-05-23 Thread Vahid Borji
Hi my friends, I want to make the below matrix in r: 1 0 0 4 0 2 0 5 0 0 3 6 I used the below code: matrix(c(1,0,0,0,2,0,0,0,3,4,5,6),nrow=3) My code works. But I do not like my solution way. I am thinking to find the simplest way for making this matrix. Do you think my code is the simplest

[R] Bayesian estimation with MCMC

2020-05-23 Thread Christofer Bogaso
Hi, In python there is a package called pymc3 for Bayesian parameter estimation with MCMC. I am curious if there is any equivalent package available for R. Any pointer will be highly appreciated. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] access for free more than 500 essential Springer Nature textbooks

2020-05-23 Thread Abby Spurdle
> My book is > Statistical Analysis and Data Display, Richard M. Heiberger, Burt > Holland, 2nd ed. 2015 In all fairness, I thought should look at your book. I was quite impressed by the chapter on multiple comparisons. And may look again, later. In my personal opinion (diverging slightly),

[R] Wordcloud warnings

2020-05-23 Thread Bryan Mac
Hi, I am having trouble understanding why I am getting this warning and how to fix it. I don’t have any of these functions in my script.. This is the warning: warning messages: 1: in tm_map.simplecorpus(corpus, tm::removepunctuation) : transformation drops documents 2: in