[R] showing the complexity of r code.....

2021-08-26 Thread akshay kulkarni
dear members, I am a stock trader and a data science freelancer. I am weighing the advantages of taking a R course in coursera to show my proficiency in R in some freelancing sites. But I have already done extensive research on Stock trading and data science, using R

Re: [R] Help with clinical trials.gov AACT database

2021-08-26 Thread bharat rawlley via R-help
I am completely stuck here, any help would be greatly appreciated! On Thursday, 26 August, 2021, 04:18:31 pm GMT-4, bharat rawlley via R-help wrote:  Hello, I am trying to use R to access the clinicaltrials.gov AACT database to create a list of facility_investigators for a specific to

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Kai Yang via R-help
Thank you all of your help. The error message gone. On Thursday, August 26, 2021, 04:07:59 PM PDT, Avi Gross via R-help wrote: This illustrates many things but in particular, why there is a difference between saying you tried:     class(eth) And saying the function you (think y

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Avi Gross via R-help
This illustrates many things but in particular, why there is a difference between saying you tried: class(eth) And saying the function you (think you) called is documented to return a data.frame. Just typing something asking for the class would rapidly have shown it was not a dat

[R] Help with clinical trials.gov AACT database

2021-08-26 Thread bharat rawlley via R-help
 Hello, I am trying to use R to access the clinicaltrials.gov AACT database to create a list of facility_investigators for a specific topic. The following code is an example of how to get a list of all clinical trials on the topic TP53 library(dplyr) library(RPostgreSQL) aact = src_postgres(d

Re: [R] Potential bug/unexpected behaviour in model matrix

2021-08-26 Thread Andrew Simmons
Hello, I'm not so sure this is a bug, it appears to be behaving as intended from the documentation. I would suggest using argument 'physical' from 'setkey' to avoid reordering the rows. Something like: x <- data.table::data.table(V1 = 9:0) y <- data.table::copy(x) data.table::setkey(x, V1, ph

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Andrew Simmons
Hello, Package 'officer' has a function 'read_xlsx', so when you attach those packages in that order, it returns 'read_xlsx' from package 'officer' instead of 'readxl'. To avoid the confusion, instead of eth <- read_xlsx("c:/temp/eth.xlsx") try eth <- readxl::read_xlsx("c:/temp/eth.xlsx") whi

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Bill Dunlap
The packages "officer" and "readxl" both contain functions named "read_xlsx". It looks like you want the one from readxl so refer to it as readxl::read_xlsx instead of just read_xlsx. -Bill On Thu, Aug 26, 2021 at 12:03 PM Kai Yang via R-help wrote: > Hi all, > I found something, but I don't

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread John C Frain
officer redefines the read_xlsx command. You should have got a message to that effect when you loaded the officer package. You can use the version from the readxl package with readxl::read_xlsx() command. John C Frain 3 Aranleigh Park Rathfarnham Dublin 14 Ireland www.tcd.ie/Economics/staff/fr

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Kai Yang via R-help
Hi all, I found something, but I don't know why it happen. when I submitted the following code, the Eth is data frame. I can see 14 obs. of 2 variables library(readxl) library(ggplot2) eth <- read_xlsx("c:/temp/eth.xlsx") but when I add more package (see below,) the Eth is "List of 1" library(r

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Kai Yang via R-help
Hi All, 1. the eth is a data frame (not sure that based on error message?) that I load it from excel file. Here is the code: eth <- read_xlsx("c:/temp/eth.xlsx") 2. I try to use the code to convert eth into eth2, but I got error message: > eth2 <- data.frame(eth) Error in as.data.frame.default(x[

[R] Potential bug/unexpected behaviour in model matrix

2021-08-26 Thread Leonidas Lundell
Dear R-project, Apologies if I am sending this to the wrong list, and thank you for your enormous contribution. I discovered a subtle interaction between the data.table package and model.matrix function that influences the output to the point that you will get completely erroneous results: d

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Avi Gross via R-help
Kai, The answer is fairly probable to find if you examine your variable "eth" as that is the only time you are being asked to provide the argument as in "ggplot(data=eth, ..) ...) As the message states, it expects that argument to be a data frame or something it can change into a data.frame.

Re: [R] Augmented Dickie-Fuller test

2021-08-26 Thread John C Frain
Your series shows a strong seasonal pattern that looks fairly constant. I would think that the adf style test is not appropriate. What are you trying to achieve? John C Frain 3 Aranleigh Park Rathfarnham Dublin 14 Ireland www.tcd.ie/Economics/staff/frainj/home.html https://jcfrain.wordpress.co

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Andrew Simmons
The class of 'eth' must be incorrect. You could try 'as.data.frame' or possibly 'as.list' to convert 'eth' to an acceptable form. On Thu, Aug 26, 2021, 11:53 Kai Yang via R-help wrote: > Hello List, > I got an error message when I submit the code below > ggplot(eth, aes(ymax=ymax, ymin=ymin, xma

Re: [R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Thierry Onkelinx via R-help
eth is not a dataframe but of the class rxlsx. You'll need to convert eth into a dataframe. ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg /

[R] ggplot error of "`data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class rxlsx"

2021-08-26 Thread Kai Yang via R-help
Hello List, I got an error message when I submit the code below ggplot(eth, aes(ymax=ymax, ymin=ymin, xmax=4, xmin=3, fill=ethnicity)) +  geom_rect() +  coord_polar(theta="y")  +  xlim(c(2, 4)   )  Error: `data` must be a data frame, or other object coercible by `fortify()`, not an S3 object wit

[R] Augmented Dickie-Fuller test

2021-08-26 Thread Nick Wray
Hello: I've downloaded this dataset, and when I plot it it is clearly non-stationary df <- read.csv(' https://raw.githubusercontent.com/ourcodingclub/CC-time-series/master/monthly_milk.csv ') plot(df,type="l") But when I apply the Augmented Dickie-Fuller Test I get a p value of 0.01, implying t