Re: [R] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-29 Thread Abby Spurdle
On Sat, Jul 25, 2020 at 12:40 AM Martin Maechler wrote: > Good answers to this question will depend very much on how many > 'Machine' and 'Region' levels there are. I second that. And unless I missed something, the OP hasn't answered this question, as such. But "10k+" combinations, does imply

Re: [R] Accessing the C++ source associated with the rgl function shade3d

2020-07-29 Thread Rasmus Liland
Dear Byron, On 2020-07-29 18:04 -0400, Duncan Murdoch wrote: > The arrow3d function is also a pure R > function, but not a generic. You can > see the source by typing "arrow3d". ... but if I type rgl::shade3d, I get > rgl::shade3d function (x, ...)

Re: [R] Help with read.csv.sql()

2020-07-29 Thread Rasmus Liland
On 2020-07-29 22:56 +0200, Ulrik Stervbo wrote: > So, 50% on topic :-) I guess so haha :-) Still I hope this is useful for H , others, or he solved it but still no bottom line volatile situation open for new ideas. __ R-help@r-project.org mailing

Re: [R] Accessing the C++ source associated with the rgl function shade3d

2020-07-29 Thread Jeff Newmiller
To begin with, don't assume it is in C++... R supports multiple compiled languages, and rgl appears to have both C++ and C in it. I googled "r rgl github" and found an online copy of the src (source) files right away. The official way is to find the CRAN package page and download the tar.gz

Re: [R] Accessing the C++ source associated with the rgl function shade3d

2020-07-29 Thread Duncan Murdoch
On 29/07/2020 5:35 p.m., Byron Dom via R-help wrote: How can I access the C++ source associated with the rgl function shade3d. More specifically, I'm interested in the part of the code used by arrow3d to draw arrow heads. I'm not familiar with how GitHub is organized and I've put in a lot of

[R] Accessing the C++ source associated with the rgl function shade3d

2020-07-29 Thread Byron Dom via R-help
How can I access the C++ source associated with the rgl function shade3d. More specifically, I'm interested in the part of the code used by arrow3d to draw arrow heads. I'm not familiar with how GitHub is organized and I've put in a lot of effort doing searches there and on the web in general.

Re: [R] Help with read.csv.sql()

2020-07-29 Thread Ulrik Stervbo via R-help
True, but the question was also how to control for formats and naming columns while loading the file. The only way I know how to do this (sans work on my part) is through the functions in readr. So, 50% on topic :-) Best, Ulrik On 29 Jul 2020, 17:59, at 17:59, Rasmus Liland wrote: >Dear

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread Duncan Murdoch
On 29/07/2020 4:16 p.m., Sebastien Bihorel wrote: Thanks Duncan, (Sorry for the repeated email) People working in my field are frequently (and rightly) accused of butchering statistical terminology. So I guess I'm guilty as charged  I will look into the suggested path. One question though

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread Sebastien Bihorel via R-help
Thanks Duncan, (Sorry for the repeated email) People working in my field are frequently (and rightly) accused of butchering statistical terminology. So I guess I'm guilty as charged  I will look into the suggested path. One question though in your expression of loglik, p is "a + b*x/(c+x)".

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread Sebastien Bihorel via R-help
Thanks Duncan, People working in my field are frequently (and rightly) accused of butchering statistical terminology. So I guess I'm guilty as charged  I will look into the suggested path. One question though in your expression: loglik <- sum( resp*log(p) + (1-resp)*log1p(-p) ) a + b*x/(c+x)

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread Duncan Murdoch
Just a quick note about jargon: you are using the word "likelihood" in a way that I (and maybe some others) find confusing. (In fact, I think you used it two different ways, but maybe I'm just confused.) I would say that likelihood is the probability of observing the entire data set,

Re: [R] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-29 Thread Carlos Ortega
Hello Ritwik, There is another possibility. You can count (crosstab) the number of elements for each Region and Machine (with table() function) and represent this table with geom_tile() function. Wit this you will get an equivalent of a heatmap which will give you a good sense of which

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread J C Nash
My earlier posting on this thread was misleading. I thought the OP was trying to fit a sigmoid to data. The problem is about fitting 0,1 responses. The reproducible example cleared this up. Another strong demonstration that a "simple reproducible example" can bring clarity so much more quickly

Re: [R] Help with read.csv.sql()

2020-07-29 Thread Rasmus Liland
Dear Ulrik, On 2020-07-29 17:14 +0200, Ulrik Stervbo via R-help wrote: > library(readr) > read_csv( This thread was about sqldf::read.csv.sql ... What is the purpose of bringing up readr::read_csv? I am unfamilliar with it, so it might be a good one. Best, Rasmus signature.asc

Re: [R] Help with read.csv.sql()

2020-07-29 Thread Ulrik Stervbo via R-help
You might achieve this using readr: ``` library(readr) lines <- "Id, Date, Time, Quality, Lat, Long STM05-1, 2005/02/28, 17:35, Good, -35.562, 177.158 STM05-1, 2005/02/28, 19:44, Good, -35.487, 177.129 STM05-1, 2005/02/28, 23:01, Unknown, -35.399, 177.064 STM05-1, 2005/03/01,

Re: [R] Help with read.csv.sql()

2020-07-29 Thread Ulrik Stervbo via R-help
You might achieve this using readr: ``` library(readr) lines <- "Id, Date, Time, Quality, Lat, Long STM05-1, 2005/02/28, 17:35, Good, -35.562, 177.158 STM05-1, 2005/02/28, 19:44, Good, -35.487, 177.129 STM05-1, 2005/02/28, 23:01, Unknown, -35.399, 177.064 STM05-1, 2005/03/01,

Re: [R] Dataframe with different lengths

2020-07-29 Thread Ulrik Stervbo via R-help
Hi Pedro, I see you use dplyr and ggplot2. Are you looking for something like this: ``` library(ggplot2) library(dplyr) test_data <- data.frame( year = c(rep("2018", 10), rep("2019", 8), rep("2020", 6)), value = sample(c(1:100), 24) ) test_data <- test_data %>% group_by(year) %>%

Re: [R] R Subset by Factor levels

2020-07-29 Thread Rui Barradas
Hello, Try %in% instead of == in: m2<-m1[m1$`Classification Description` == levels(m1$`Classification Description`)[c(1,15,2,4],] Hope this helps, Rui Barradas Às 14:57 de 29/07/2020, Engin Yılmaz escreveu: Dear I try to create a new subset from my dataframe. My dataframe's name is m1.

Re: [R] R Subset by Factor levels

2020-07-29 Thread Rasmus Liland
Dear Engin, On 2020-07-29 16:57 +0300, Engin Yılmaz wrote: > Dear > > I try to create a new subset from my dataframe. > My dataframe's name is m1. > "Classification Description" column has 15 different factors. > The following code is used creating a subset for 1 factor. >

Re: [R] Removing a space from a string

2020-07-29 Thread Dennis Fisher
Richard Per your requests: 1. Plain text: no spaces 2. read_docx: spaces 3. read_rtf: no spaces 4. Not requested by you: copying from the Word document, then pasting into “vim”: no spaces The Word document was created by hand but #1, #3, and #4 confirm that

[R] R Subset by Factor levels

2020-07-29 Thread Engin Yılmaz
Dear I try to create a new subset from my dataframe. My dataframe's name is m1. "Classification Description" column has 15 different factors. The following code is used creating a subset for 1 factor. m2<-m1[m1$`Classification Description` == levels(m1$`Classification Description`)[1],] My aim

Re: [R] Nonlinear logistic regression fitting

2020-07-29 Thread Sebastien Bihorel via R-help
Thank your, Pr. Nash, for your perspective on the issue. Here is an example of binary data/response (resp) that were simulated and re-estimated assuming a non linear effect of the predictor (x) on the likelihood of response. For re-estimation, I have used gnlm::bnlr for the logistic

Re: [R] Arranging ggplot2 objects with ggplotGrob()

2020-07-29 Thread Ulrik Stervbo via R-help
Then this should work: ``` library(ggplot2) library(cowplot) p1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point() p2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width * 1000)) + geom_point() plot_grid(p1, p2, ncol = 1, align = "hv", rel_heights = c(2, 1), axis =

Re: [R] How to create a readable plot in R with 10000+ values in a dataframe

2020-07-29 Thread Jim Lemon
Hi Ritwik, I haven't seen any further answers to your request, so I'll make a suggestion. I don't think there is any sensible way to illustrate that many data points on a single plot. I would try to segment the data by machine type or similar and plot a number of plots. Jim On Fri, Jul 24, 2020

Re: [R] Removing a space from a string

2020-07-29 Thread Kimmo Elo
Hi! How about this? --- snip --- > x <- c("STRING 01. Remainder of the string","STR ING 01. Remainder of the string","STRIN G 01. Remainder of the string","STR IN G 01. Remainder of the string") > x1<-unlist(strsplit(x,"\\.")) > for (i in seq(1,length(x1),2)) { x[(i+1) %/%