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

2020-07-30 Thread H
On 07/30/2020 06:09 PM, Gabor Grothendieck wrote: > Probably simplest to assign the names afterwards as others have > suggested but it could be done like this: > > library(sqldf) > write.csv(BOD, "BOD.csv", quote = FALSE, row.names = FALSE) # test data > > read.csv.sql("BOD.csv", "select Tim

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

2020-07-30 Thread Gabor Grothendieck
Probably simplest to assign the names afterwards as others have suggested but it could be done like this: library(sqldf) write.csv(BOD, "BOD.csv", quote = FALSE, row.names = FALSE) # test data read.csv.sql("BOD.csv", "select Time as Time2, demand as demand2 from file") giving the column n

Re: [R] How to generate this type of scatter plots in R

2020-07-30 Thread Paul Bivand
This looks like a beeswarm plot - using package beeswarm or (for ggplot users) ggbeeswarm. Paul On Thu, 23 Jul 2020 at 05:31, Jim Lemon wrote: > > Hi John, > Perhaps "dendroPlot" in the plotrix package? > > JIm > > On Thu, Jul 23, 2020 at 11:00 AM array chip via R-help > wrote: > > > > > > Hell

Re: [R] adding new level with new values and transpose the dataframe

2020-07-30 Thread Rasmus Liland
On 2020-07-30 18:07 +0300, Engin Yılmaz wrote: | El jueves, 30 de julio de 2020, Rasmus Liland escribió: | | On 2020-07-30 21:13 +1000, Jim Lemon wrote: | | | On Thu, Jul 30, 2020 at 8:33 PM Engin Yılmaz wrote: | | | | | | | | I have 3 different factors for every | | | | month in my dataframe.The c

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

2020-07-30 Thread Ritwik Mohapatra
Hi All, Thanks for all the suggestions and help.I have gone for simpler plots with lesser values for demonstration now which served the purpose. Regards, Ritwik On Thu, 30 Jul, 2020, 22:00 Dr Eberhard Lisse, wrote: > I always find two things helpful > > 1) RTFM > > 2) Asking myself what inform

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

2020-07-30 Thread Dr Eberhard Lisse
I always find two things helpful 1) RTFM 2) Asking myself what information do I want to convey before thinking about how to do that. >From the below I can not understand what you want to tell your audience. I don't think it's helpful trying to read 17298 names on a plot so maybe show the

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

2020-07-30 Thread Eric Berger
Duncan writes: >> " ... If you're using RStudio, a really convenient way to view the source >> ..." This is fantastic! Thank you for this Duncan. On Thu, Jul 30, 2020 at 3:45 PM Duncan Murdoch wrote: > > On 29/07/2020 6:34 p.m., Jeff Newmiller wrote: > > To begin with, don't assume it is in C++

Re: [R] adding new level with new values and transpose the dataframe

2020-07-30 Thread Rasmus Liland
Hi Engin, On 2020-07-30 21:13 +1000, Jim Lemon wrote: | On Thu, Jul 30, 2020 at 8:33 PM Engin Yılmaz wrote: | | | | I have 3 different factors for every | | month in my dataframe.The column of | | classification description has 3 | | factors. | | | | Question 1: | | I need to add a new factor t

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

2020-07-30 Thread Duncan Murdoch
On 29/07/2020 6:34 p.m., Jeff Newmiller wrote: 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. Also a few thousand lines of Javascript, but in this case, the interesting code is all in R. I googled "r rgl gi

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

2020-07-30 Thread Rasmus Liland
On 2020-07-30 05:23 -0400, Duncan Murdoch wrote: > On 29/07/2020 7:27 p.m., Rasmus Liland wrote: > > 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

Re: [R] adding new level with new values and transpose the dataframe

2020-07-30 Thread Jim Lemon
Hi Engin, If you know what all the levels are, you can specify these in the format command: Classification_Description<-factor(Classification_Description, levels=c("Total Surplus (+) or Deficit (-)","Borrowing from the Public", "By other means")) This ensures that all the levels are encoded ev

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

2020-07-30 Thread Jim Lemon
Hi Ritwik, Carlos made an excellent suggestion and there are at least two ways to plot "machine" and "region" as the cells in a 2D matrix and then add two more variables (say count and price) as the attributes of each cell. Is the data you are using publicly available? If so a demonstration of this

[R] adding new level with new values and transpose the dataframe

2020-07-30 Thread Engin Yılmaz
* Record Date* *Classification Description* *Current Month Budget Amount* 2020-06-30 Total Surplus (+) or Deficit (-) -864,074,068,492 2020-06-30 Borrowing from the Public 716,272,172,707 2020-06-30 By Other Means 420,704,500,379 2020-05-31 Borrowing from the Public 759

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

2020-07-30 Thread Duncan Murdoch
On 29/07/2020 7:27 p.m., Rasmus Liland wrote: 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 func

Re: [R] R Subset by Factor levels

2020-07-30 Thread Engin Yılmaz
I solve this as follows m2 <- subset(m1,`Classification Description`=="Borrowing from the Public" | `Classification Description`=="By Other Means" | `Classification Description`=="Total Surplus (+) or Deficit (-)") sincerely Engin YILMAZ Engin Yılmaz , 29 Tem 2020 Çar, 16:57 tarihinde şunu yazd