[R] Inverse of Probit

2013-11-19 Thread Calum
preciated, Thanks, Calum -- View this message in context: http://r.789695.n4.nabble.com/Inverse-of-Probit-tp4680752.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

[R] Problem plotting curve on survival curve (something silly?)

2008-03-02 Thread Calum
OK this is bound to be something silly as I'm completely new to R - having started using it yesterday. However I am already warming to its lack of 'proper' GUI... I like being able to rerun a command by editing one parameter easily... try and do that in a Excel Chart Wizzard! I eventually want

Re: [R] Problem plotting curve on survival curve (something silly?)

2008-03-03 Thread Calum
> Calum wrote: > >> All of that is very nice so far. The I followed bits and pieces of >> other peoples posts in the past to plot on a weibull regression... >> >> > my_curve.Plac <- survreg( Surv(Survival, Censored==0)~ >> TreatmentGroup, subse

Re: [R] Problem plotting curve on survival curve

2008-03-03 Thread Calum
Terry Therneau wrote: > > It is easier to get survival curves using the predict function. Here is a > simple example: >> tfit <- survreg(Surv(time, status) ~ factor(ph.ecog), data=lung) >> tdata <- data.frame(ph.ecog=factor(0:3)) >> qpred <- predict(tfit, newdata= tdata, type='quantile', p=1:99/

Re: [R] Restoration of "rite" package of R as R-script editor or the like

2022-05-23 Thread CALUM POLWART
As has been said, it's not for R CRAN to fix. This is open source code. If the package maintainer is no longer keen anyone can fork the code, maintain it and release it back to Cran and provided it meets their rules it would be available for all. (If it doesn't you just need to provide the install

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-26 Thread CALUM POLWART
Not very clear what you are trying to do. But I'd have thought possibly dplyr left_join might be a solution for you. The base R equivalent is merge(). It might be a rbind or cbind can do it too. On Wed, 27 Jul 2022, 03:30 Ranjeet Kumar Jha, wrote: > Hello Everyone, > > I have dataset in a part

Re: [R] Remove line from data file

2022-09-18 Thread CALUM POLWART
>From the file? Or the data frame once its loaded? What format is the file? CSV? Do you know the line that needs deleted? mydf <- read.csv("myfile.csv") mydf2 <- mydf[-columnName == "valuetodelete", ] # Note the - infront of column name # or perhaps columnName != "value to delete", ] write.csv

Re: [R] Remove line from data file

2022-09-18 Thread CALUM POLWART
the change(s) using > Excel. > > > > For future reference, when I look at your solutions below, what do you > mean by “value to delete”? Could that just be a row number? I was wanting > to delete something like the 18th row in the dataframe? > > > > *From: *CALUM P

Re: [R] removing non-table lines

2022-09-18 Thread CALUM POLWART
Can you provide a sample of say the first 3 rows then the last 2 rows before the CSV starts. Are there always the same number of lines at the top? Or can it vary depending what non-sense the Met Office decided to contaminate it with? This should be solvable with some sample data. Base R or Tidyv

Re: [R] getting data from a "vertical" table into a "2-dimensional" grid

2022-10-21 Thread CALUM POLWART
You asked for base R but also said or using other methods. So for completeness here is a solution using Tidyverse library(tidyverse) data_original <- data.frame( year = c('1990', '1999', '1990', '1989'), size = c('s', 'l', 'xl', 'xs'), n = c(99, 33, 3, 4) ) data_original |> pivot_wider(

Re: [R] datatable using dt not able to print background colors

2022-12-17 Thread CALUM POLWART
I don't think this is an R issue, it's a HTML tables issue // browser issue. There are some hacks using background image (not R specific). BUT before you do any of this... Consider if colour is your answer! 8% of males are colour blind, so your table isn't as accessible as you may think it is. T

Re: [R] Reg: To change the x axis label in ts.plot function

2022-12-24 Thread CALUM POLWART
https://stackoverflow.com/questions/49679699/time-series-plot-change-x-axis-format-in-r Is as good a solution as possible using ts I think. On Sat, 24 Dec 2022, 18:58 Upananda Pani, wrote: > Dear All, > I have the data set with daily dates (5-days trading in a week) and price > data. I want

Re: [R] is it possible to run multiple rmd files together

2023-01-04 Thread CALUM POLWART
I get frustrated by our peers who reply "please provide a worked example" but OMG... Please provide a worked example! You can't use: source("filename.Rmd") as it isn't a simple set of R code. You can do: Rmarkdown::render("filename.Rmd") You can also knit child files. But it is completely uncl

Re: [R] Date order question

2023-01-04 Thread CALUM POLWART
On Wed, 4 Jan 2023, 21:29 Ebert,Timothy Aaron, wrote: > > As you are plotting strings, you could put a space character in front of > the December dates so that they are first. > date<-c(" 12-29"," 12-30","01-01") > That fixes the problem in this example. You can order all the dates by > putting m

Re: [R] connect MSSQL server problem

2023-03-17 Thread CALUM POLWART
This doesn't sound like it is R failing, it sounds like you don't know the appropriate connection details for the server. You need to find them out and come back rather than simply try different username and passwords... Can you connect to the server using any other ODBC connection and those crede

Re: [R] R does not run under latest RStudio

2023-04-07 Thread CALUM POLWART
R studio sometimes isn't happy with i386 versions. Although I thought they had put support back in. If you have the option for 64bit, use 64bit R. I've also had similar issues when R couldn't find the executable. But absolutely would expect if you post this on the community forum someone would be

Re: [R] R does not run under latest RStudio

2023-04-07 Thread CALUM POLWART
Obviously running R is pretty fundamental to running R studio. So it seems rather odd to be thinking you'd need to stop using R studio unless you are doing something odd On Fri, 7 Apr 2023, 02:18 Sorkin, John, wrote: > I have also had difficulty running R in RStudio. Has anyone else had > proble

Re: [R] Asking about R "Security" ..

2023-05-17 Thread CALUM POLWART
Chris Presumably you've also pointed her to the NHS R community and in particular is slack group? There are so many variables in what was even being asked it's going to take some time to work through, did the mean R or R Studio or R Studio Cloud... Before any packages.. On Wed, 17 May 2023, 10:4

Re: [R] Asking about R "Security" ..

2023-05-17 Thread CALUM POLWART
Chris replied off list to say he hadn't directed the OP to NHS R Community so it seems prudent to point a link here for eternity -- because there will be another NHS Security Audit with questions that don't fit R properly and the guys in the community may be best placed to answer them Linky: https

Re: [R] how to change the y-axis to logarithmic in a barplot ggplot

2023-07-16 Thread CALUM POLWART
Try adding scale_y_log10() This is a general R help list. It's not a ggplot list and you are likely to be chased off to ggplot's package maintainers nominated support pages. But really a Google search should surely have found this? On Sun, 16 Jul 2023, 22:51 Maria Lathouri via R-help, wrote:

Re: [R] how to change the y-axis to logarithmic in a barplot ggplot

2023-07-16 Thread CALUM POLWART
t; I will find the ggplot help. > > But I have tried everything, including what you have suggested and nothing > works. > > Kind regards, > Maria > > > > > > > Στις Κυριακή 16 Ιουλίου 2023 στις 11:22:36 μ.μ. GMT+1, ο χρήστης CALUM > POLWART έγραψε: > &

Re: [R] plotly question

2023-07-22 Thread CALUM POLWART
I was just replying to say which bit do you consider the indicator. But I see Boris has provided a Chat GPT solution. Running it hopefully shows you how to change colours on various parts. On Fri, 21 Jul 2023, 22:43 Jeff Newmiller, wrote: > plotly is _not_ associated with posit. I think you

[R] Live data collection, analysis & update of slides ..

2023-07-22 Thread CALUM POLWART
I'm looking for a way to do some live data analysis taking audience votes, presenting their results, potentially posing some new questions to vote on, and present those and vote. I'm interested in any suggestions from the collective minds here about the potential best approaches. I can obviously

Re: [R] geom_smooth

2023-08-11 Thread CALUM POLWART
+ geom_ribbon(stat = "smooth", se = TRUE, alpha = 0, # or, use fill = NA colour = "black", linetype = "dotted") Does that work? On Sat, 12 Aug 2023, 06:12 Rui Barradas, wrote: > Às 05:17 de 12/08/2023, Thomas Subia via R-help escreveu: >

Re: [R] OFF TOPIC: chatGPT glibly produces a lot of wrong answers?

2023-08-13 Thread CALUM POLWART
It does often behave better if you say to it "that doesn't seem to be working" and perhaps some error message It is afterall a language tool. Its function is to provide text that seems real. If you ask it a science question and ask it to provide references in Vancouver format, it can format the r

Re: [R] How to fix this problem

2023-09-25 Thread CALUM POLWART
Using readr to read the data might let you clean it on the way in... readr::read_csv("filename.csv", col_types = list(rep(col_numeric(),6)) On Mon, 25 Sep 2023, 16:54 Ebert,Timothy Aaron, wrote: > An update please: > Collectively we have suggested removing commas from the "E..coli" column, > ch

Re: [R] Question about R software and output

2023-10-03 Thread CALUM POLWART
Charity There is OFTEN confusion what we mean when we say "R". R is effectively a single bit of software with a ton of other bits of software as optional extras. You might think of some of those optional extras like apps on a phone. You'd say you have a phone when you can open the box and power

Re: [R] I need to create new variables based on two numeric variables and one dichotomize conditional category variables.

2023-11-04 Thread CALUM POLWART
I might have factored the gender. I'm not sure it would in any way be quicker. But might be to some extent easier to develop variations of. And is sort of what factors should be doing... # make dummy data gender <- c("Male", "Female", "Male", "Female") WC <- c(70,60,75,65) TG <- c(0.9, 1.1, 1.2,

Re: [R] I need to create new variables based on two numeric variables and one dichotomize conditional category variables.

2023-11-05 Thread CALUM POLWART
ded. An example might be aspects of the ggplot program > where you may get a mysterious order of presentation in the graph unless > you create a factor with the order you wish to have used and avoid it > making one invisibly. > > From: CALUM POLWART > Sent: Saturday, November 4, 2

Re: [R] ggplot adjust two y-axis

2023-11-25 Thread CALUM POLWART
This is doable. But it's also considered a data visualisation hell! So Hadley didn't make it easy. I can provide more details on how to do it later (replying from phone just now). BUT there is very much a question of should you be plotting like that. It's probably worth giving it serious thought b

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread CALUM POLWART
Can you provide a very simplified version of how the PDF is created? On Sat, 2 Dec 2023, 14:39 Dennis Fisher, wrote: > OS X > R 4.3.1 > > Colleagues > > I often create multipage PDFs [pdf()] in which the text "Page X" appears > in the margin. These PDFs are created automatically using a massi

Re: [R] adding "Page X of XX" to PDFs

2023-12-02 Thread CALUM POLWART
You could easily omit the Page X of xX, but leave the timestamp Then add Page X of XX programmatically using pdftools or some similar pdf command line tools. On Sat, 2 Dec 2023, 22:35 , wrote: > Having read all of the replies, it seems there are solutions for the > question and the OP points ou

Re: [R] Help request: Parsing docx files for key words and appending to a spreadsheet

2023-12-29 Thread CALUM POLWART
textreadr would be the obvious approach. When you say it is depreciated do you mean it's not available on cran? Sometimes maintaining a package on cran in just a pain in the ass. devtools::install_github("trinker/textreadr") Should let you install it. In theory docx files are actually just zip

Re: [R] Help request: Parsing docx files for key words and appending to a spreadsheet

2023-12-29 Thread CALUM POLWART
It sounded like he looked at officeR but I would agree content <- officer::docx_summary("filename.docx") Would get the text content into an object called content. That object is a data.frame so you can then manipulate it. To be more specific, we might need an example of the DF You can loop thi

Re: [R] Help request: Parsing docx files for key words and appending to a spreadsheet

2023-12-29 Thread CALUM POLWART
help(read_docx) says that the function only imports one docx file. In > order to read multiple files, use a for loop or the lapply function. > I told you people will suggest better ways to loop!! > > docx_summary(read_docx("Now they want us to charge our electric cars > from litter bins.docx"))

Re: [R] R interpreting numeric field as a boolean field

2024-01-30 Thread CALUM POLWART
And your other option - recode what gets imported. It may well be you will actually want the blanks to be NAs for instance rather than blank. I'm assuming the True and False are >$0 and $0 from your description. (Or maybe vice versa). So I'd have made my column name something like "OverZeroDollars"

Re: [R] Avoiding Delete key function as 'Quit R' in Rterm when there are no characters in cursor line

2024-02-09 Thread CALUM POLWART
I don't use term, but I've just tested it and this is reproducable. Is it a bug? Not sure. If you hit c after getting the message it will cancel the q() request. On Fri, 9 Feb 2024, 17:21 Duncan Murdoch, wrote: > That looks to me like a bug, but I don't use Windows any more, so I > won't offer

Re: [R] Including an external set of coded

2024-02-20 Thread CALUM POLWART
Are you asking to source lines 5-10 of a file for instance? Never seen that done in R. Feels a dodgy thing to do as changing line will screw things up. On the other hand - I'd often have functions in a file called perhaps "functions.R" and source("functions.R") Then I can call an individual func

Re: [R] Including an external set of coded

2024-02-20 Thread CALUM POLWART
t to do this is to keep > my main programs compact. > > Steven from iPhone > > On Feb 21, 2024, at 12:44 AM, CALUM POLWART wrote: > >  > Are you asking to source lines 5-10 of a file for instance? > > Never seen that done in R. Feels a dodgy thing to do as changing l

Re: [R] Problem with R coding

2024-03-12 Thread CALUM POLWART
That's almost certainly going to be either the utf-8 character in the path OR the use of one drive which isn't really a subfolder as I understand it. When I've had these issues in the past, I've been able to mount a drive (say U:/ ) which sites further down /up the folder tree so that R just calle

Re: [R] Exceptional slowness with read.csv

2024-04-08 Thread CALUM POLWART
data.table's fread is also fast. Not sure about error handling. But I can merge 300 csvs with a total of 0.5m lines and 50 columns in a couple of minutes versus a lifetime with read.csv or readr::read_csv On Mon, 8 Apr 2024, 16:19 Stevie Pederson, wrote: > Hi Dave, > > That's rather frustratin

Re: [R] Extracting values from Surv function in survival package

2024-05-15 Thread CALUM POLWART
More difficult than it should be IMO. survminer package is often helpful. But if you want to avoid dependency: library(survival) fit <- survfit( Surv(time,status)~sex,data=lung) surfable <-summary(fit)$table surfable # just the events surfable[,"events"] On Wed, 15 May 2024, 21:42 Dennis Fishe

Re: [R] Extracting values from Surv function in survival package

2024-05-16 Thread CALUM POLWART
I don't think that gives the summary of event numbers without extra work. library(survival) fit <- survfit( Surv(time,status)~sex,data=lung) summary(fit)$n.event [1] 3 1 2 1 1 1 1 2 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 3 1 1 1 1 1 2 [38] 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Re: [R] Current version of R, 4.4.0 and patch to correct the bug fix related to the RStudio viewer pane on Windows systems

2024-05-16 Thread CALUM POLWART
Do you receive RDS objects from unknown (untrusted) sources? ?? If not - the security issue is a non-issue as I understand it. On Thu, 16 May 2024, 16:21 Vega, Ann (she/her/hers) via R-help, < r-help@r-project.org> wrote: > I help to coordinate the USEPA's R user group. We have over 500 member

Re: [R] my R code worked well when running the first 1000 lines of R code

2024-06-12 Thread CALUM POLWART
I sometimes think people on this list are quite rude to posters. I'm afraid I'm likely to join in with some rudeness? 1. "Here is some code that works but also doesn't" is probably not going to get you an answer 2. I provide no information about the data it works on or doesn't 3. I tell you I'm u

Re: [R] Using the pipe, |>, syntax with "names<-"

2024-07-21 Thread CALUM POLWART
The tidy solution is rename literally: z |> rename(foo = 2) Or you could do it with other functions z |> select ( 1, foo = 2) Or z |> mutate( foo = 2 ) |> # untested (always worry that makes the whole column 2) select (-2) But that's akin to z$foo <- z[2] z[2] <- null On Sun, 21 Jul 2024,

Re: [R] Extract

2024-07-22 Thread CALUM POLWART
But have we lured you to the dark side with the tidyverse yet ;-) On Mon, 22 Jul 2024, 15:22 Bert Gunter, wrote: > Thanks. > > I found this to be quite informative and a nice example of how useful > R-Help can be as a resource for R users. > > Best, > Bert > > On Mon, Jul 22, 2024 at 4:50 AM G

Re: [R] If loop

2024-08-08 Thread CALUM POLWART
Is something wrong in the initialisation part that we don't see? joint12 <- marg1 <-F marg1 <-T if (joint12) { print ("joint 12") cat (joint12) } if (marg1) { print("marg 1") cat(marg1) } Would probably be my diagnostic approach On Fri, 9 Aug 2024, 04:45 Steven Yen, wrote: > Can som

Re: [R] If loop

2024-08-09 Thread CALUM POLWART
} else { > + {print ("cond21"); cat(cond21)} > + }} > > try1(joint12=TRUE) > [1] "joint12" > TRUE > [1] "marg1" > FALSE > > try1(marg1=TRUE) > [1] "marg1" > TRUE > [1] "joint12" > FALSE > > try

Re: [R] If loop

2024-08-09 Thread CALUM POLWART
returning the list. > Use of "<<-" is rarely a good idea in R. > > -- Bert > > On Fri, Aug 9, 2024 at 1:53 AM CALUM POLWART wrote: > > > > OK. The fact it's in a function is making things clearer. > > > > Are you trying to update the value

Re: [R] boxplot notch

2024-08-16 Thread CALUM POLWART
Unless I'm missing the point, you are sending the summary data MS1s to the plot. Is that not a VERY unusual way to do it. Let box plot do the summary? Otherwise what do you want the notches to show? On Fri, 16 Aug 2024, 17:21 Chris Evans via R-help, wrote: > That's not really a reprex Sibylle.

Re: [R] Terminating a cmd windows from R

2024-08-17 Thread CALUM POLWART
cmd taskkill /PID 1234 Will kill process 1234 if you know it id So shell.exec can likely do this for you On Sat, 17 Aug 2024, 12:31 Duncan Murdoch, wrote: > On 2024-08-17 6:21 a.m., SIMON Nicolas via R-help wrote: > > I would like to stop a dos shell windows following the cmd (execute) > comma

Re: [R] Fill NA values in columns with values of another column

2024-08-27 Thread CALUM POLWART
Bert I thought she meant she wanted to replace the NAs with the 6. But I could be wrong. It looks like the data is combined from cbind. I'm going to give tidyverse examples because it's (/s) *"always"* (/s) easier. require(tidyverse) # impute the missing NAs myData <- cbind(VB1d[,1],s1id[,1])

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread CALUM POLWART
Add: key = list(points=16:17) Into the dotplot section possibly without the autokey On Fri, 13 Sep 2024, 08:19 Christopher W. Ryan, wrote: > I am making a dotplot with lattice, as follows: > > dd %>% dotplot( segment ~ transit_time, groups = impact, data = ., >as.table = TRUE,

Re: [R] (no subject)

2024-09-16 Thread CALUM POLWART
Rui's solution is good. Bert's suggestion is also good! For Berts suggestion you'd make the list bit list(mean = mean_narm) But prior to that define a function: mean_narm<- function(x) { m <- mean(x, na.rm = T) if (!is.Nan (m)) { m <- NA } return (m) } Would do what you suggested in your r

Re: [R] Not sure this is something R could do but it feels like it should be.

2013-06-09 Thread Calum Polwart
Calum Hi Calum, I can only answer from the perspective of someone who calculated doses of alcohol for experimental subjects many years ago. It was not possible to apply a linear function across the range due to a number of factors. One is that BAC, which was the target value, is dependent upon

[R] Formatting output of plotKML

2013-11-29 Thread Calum Galleitch
Hello, I previously submitted the below query to r-sig-geo, but have had no response. Before I start bothering individual maintainers, I wonder if anyone on this list has any experience with the package and (or!) can diagnose my problems? Thanks, Calum Hello, I am having a little trouble with

Re: [R] puzzling Date math result

2012-04-17 Thread Calum Polwart
On Tue, 17 Apr 2012 10:44:40 -0400, Denis Chabot wrote: > Hi, > > I cannot make a reproducible example easily for my problem, so I'll > describe it as best as I can. YOU KIND OF NEED ONE... >> a=test1$période[21] > >> b=test2$date[22] > a f > argin-left:5px; width:100%">b > > [1] "2011

Re: [R] DPLYR Multiple Mutate Statements On Same DataFrame

2024-10-17 Thread CALUM POLWART
Why can't you do: df0 |> mutate( ... ) |> mutate( ... ) |> mutate( ... ) I've simplified the code to show passing the result of the first line to the next rather than focussing on the detail. This would work with %>% as well as |> but I am anticipating that the more modern native pipe ( |> )

Re: [R] store list objects in data.table

2024-09-21 Thread CALUM POLWART
I think there is a typo in your reprex l(x^2) ?? mydt[1,2] contains a list. Which when unlisted contains a load of data. I'm not sure what you are asking for? Are you trying to unlist that and have it as a row? Sort of pivot.wider if you like or unnest in tidyverse concepts? I think the data.tab

Re: [R] Problem with converting grib file to excel

2024-09-25 Thread CALUM POLWART
Noticeable lack of silence in the group on this one. I've not got time to test currently. But my experience of geo location files - they often had more than 2 dimensional data. In other words you might have a boundary of a region as an object with long and lat for maybe 100 data points making up t

Re: [R] Problem with converting grib file to excel

2024-09-26 Thread CALUM POLWART
>> if it can be made available. It does look like the finial step of > reading > >> the data into raster failed, so then did the rest of th commands. > >> > >> -Roy > >> > >> > >> > On Sep 25, 2024, at 3:24 PM, CALUM POLWART >

Re: [R] Is there a sexy way ...?

2024-09-28 Thread CALUM POLWART
Avi I fear this was all a huge social experiment. Testing if a post titled "sexy way" would increase engagement... On Sat, 28 Sep 2024, 07:21 , wrote: > I see a book coming: > "666 ways to do the same thing in R ranked by sexiness." > > Kidding aside, if you look under the covers of so

Re: [R] SQL and R

2024-12-11 Thread CALUM POLWART
And to answer the dependency question. Neither is dependent on the other. But both can be complimentary. If you consider that SQL*may* be a route to accessing your data (if it's in a database). And R *may* be a route to analysis of the data. If the data is in a CSV file, Excel file, API etc. y

Re: [R] Mutate issue help needed

2024-12-17 Thread CALUM POLWART
Indeed. When I try and recreate your problem I fail to find a problem. But almost certainly the issue lies in the file, or the reading of said file. Currently the code is fname <- "Buzz.txt" All <- fname That results in All containing "Buzz.txt" not the CONTENT of a file called Buzz.txt. As

Re: [R] Mutate issue help needed

2024-12-17 Thread CALUM POLWART
Am I being "thick" here .. mutate(data, *# text Is interpretated as mutate (data, * The star is the character... (Data is the line above being piped) Why have the comments been *'d?. Is that the source error or a posting error here? On Tue, 17 Dec 2024, 14:57 Ivan Krylov via R-help, wrote:

Re: [R] [off-topic] crossword

2024-12-13 Thread CALUM POLWART
Well to complicate things, I don't think RULES is the answer. This is a cryptic crossword clue. They usually contain the answer twice (well... Cryptically!!) Writes in C or R, say. I think the answer is CODER If you look up the definition of say in the dictionary one option is: 1. give in

Re: [R] Weird Behavior of mean

2024-12-13 Thread CALUM POLWART
I've not checked the code, but I think that result would happen if mean uses something like if (na.rm == TRUE) { # do something to remove the NA's } And as uses something like If (na.rm != FALSE) { # do something to remove the NA's } Or perhaps ever na.rm == T If you ever see posts from B

Re: [R] Creating a script in Rstudio

2024-12-05 Thread CALUM POLWART
Carlos you are gonna have to provide at least a tiny smidge of information Reagent dataset? What is this? What is your problem with creating a script in R Studio. File New.. It kinda feels this is either "how do I use R studio" (in which case YouTube feels your friend) or "how do I use some very

Re: [R] Spreadsheets data

2024-12-05 Thread CALUM POLWART
And R Studio has an import data function that will provide a import command.. BUT Spreadsheet is a broad scope On Thu, 5 Dec 2024, 23:38 Martin Møller Skarbiniks Pedersen, < traxpla...@gmail.com> wrote: > On Thu, 5 Dec 2024 at 23:16, Figueiredo, Carlos via R-help > wrote: > > > > Hi there > >

Re: [R] Citation for stock price data from Quantmod

2024-12-30 Thread CALUM POLWART
This isn't my field. But I'd have expected a sentence along the lines of: Stock prices were obtained from Yahoo Stocks[1] using the Quantmod R statistics package[2]. 1. Yahoo Citation 2. Quantmod citation That is readable. A further sentence: All analytical code is available from a publicly acc

Re: [R] Need help with time series

2025-01-14 Thread CALUM POLWART
acf wants a time series, so tries to make one: as.ts(myts) Time Series: Start = 19357 End = 20027 Frequency = 1 [1] 24957 NA NA NA NA NA NA NA NA NA [11] NA NA NA NA NA NA NA NA NA NA [21] NA NA NA NA

Re: [R] An opinion question, please

2025-04-07 Thread CALUM POLWART
Clearly something has gone terribly wrong. Everyone is saying use S3. This is an online discussion... So someone needs to support S4. Which frighteningly seems to be me! I'd caution you now... I first used an S4 object about two weeks ago and still have no real idea if they do what I think they do

Re: [R] Help Coding error

2025-03-29 Thread CALUM POLWART
So either: XX contains some non-finite numbers Or Something produced from it does. Non finite means things like 1÷0. R might show Inf or -Inf. But if there is maths happening in the function it might be passing something to it the is a 0 and so creating a Inf. But if there is a test of is.fini

[R] ?currency challenge ?knapsack challenge ?probabilities

2015-12-27 Thread Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)
ht simplify this? Sent from TypeMail<http://www.typeapp.com/r> On 27 Dec 2015, at 08:00, "Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)" mailto:calum.polw...@nhs.net>> wrote: ***

Re: [R] ?currency challenge ?knapsack challenge ?probabilities

2015-12-28 Thread Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)
Hi Jim Working on basis of exact match. but the 25% inncrements are rounded to imtegers, so like buying from a shop priced in whole numbers but changeis what you expect not 'roughly right' Thanks Calum On 27 Dec 2015, at 22:04, Jim Lemon mailto:drjimle...@gmail.com>> wrote

[R] Odd results with Chi-square test. (Not an R problem, but general statistics, I think)

2009-08-18 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
I'm far from an expert on stats but what I think you are saying is if you try and compare Baseline with Version 3 you don't think your p-value is as good as version 1 and 2. I'm not 100% sure you are meant to do that with p-values but I'll let someone else comment on that!. tot

[R] PowerCut Killed R - is my code retrievable?

2009-08-19 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
for the future? I know some people use IDE's but is that for serious programming or for building a small function and tweaking it? Thanks Calum This message may contain con

Re: [R] PowerCut Killed R - is my code retrievable?

2009-08-20 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
h it. I have no hands on expereince with GIT - one of my PHP projects has been discussing moveing to GIT / Bazzar for about 6 months. I see the advantage for them as they have multiple coders - is there some advanatge i might have missed for a lone programmer (sorry going well OT). Clearly e

[R] forest (meta) editing text

2009-08-22 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
OK - I've been doing some work on getting a forest plot or two together for a sub-group analaysis. Thats the crucial thing - because its a sub-group analysis rather than a meta-analsysis and all the forest (meta) and forestplot (rmeta) instructions assume you are doing a meta-analysis. I found

Re: [R] Partykit Document

2009-08-25 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
s/ipred/ipred.pdf - does indeed and there is a bookmarked section all about the GlaucomaM dataset. Gives you every field name and what it means... still none the wiser - I assume if you laser scan peoples eyes it means something! That same page would also be av

[R] Obtaining value of median survival for survfit function to use in calculation

2009-09-08 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
rves... so I'm sure it must be possible to automate. Ta Calum This message may contain confidential information. If yo...{{dropped:21}} _

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
> > # I tried defining a function like this > myplot <- function(...)plot(..., pch=19, col=c("blue","red")[treatment]) > > # So i can call it like this: > with(mydfr, myplot(Xmeas, Ymeas)) > > # but: > Error in plot.xy(xy, type, ...) : object 'treatment' not found > basically that is something like

[R] Exporting Numerous Graphs

2009-09-14 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
> I have got 27 graphs to export (not a lot...I know!). How can I fit all of > them into a single file like PNG without adjusting the size of the graphs? > What's in my mind is like pasting graphs into Word, in which I can just > scroll down to view the graphs. Pretty sure PNG can only cope with s

Re: [R] How to set default plotting colors by treatment?

2009-09-14 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
>> col=c("blue","red")mydfr$[treatment] > > Yes, but I would like to use the function for lots of other dataframes > as well, so embedding 'mydfr' in the function is not the ideal > solution... In that case I'd try something like: myplot <- function(..., tmnt) { plot(..., pch=19,

[R] Is there an equivalent of "echo"

2009-09-14 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Sorry I'm having one of those moments where I can't find the answer but I bet its obvious... I'm outputting my results to a file using sink() Is there a command simillar to php's echo command that would allow me to add some text to that file ie: dataFr$a = 1:10 dataFr$b = 2*1:10 sink ("filepat

[R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Hi guys I'm hoping someone can help me with this. It should be easy but it seems to get stuck for no obvious reason! I am trying to set a report up in odfWeave so that we can re-run the same analysis at 3 time points as the data matures and provide an 'instant' report. To simplify the situati

Re: [R] Contingency Table - output to odfWeave not working for matrix

2010-02-20 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Solved my own problem by using: odfTable.matrix( as.matrix ( with (mydata, table (site_id, reaction)) ) ) This message may contain confidential information. If yo...{{drop

[R] odfWeave - merged table cells, and adding information like totals and p-values

2010-02-21 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
exported table would not ideally be pure numbers. - As a p value usually links two columns I might have expected to use a merged cell which again brings me back to my original question ;-) Thanks Calum Polwart BSc(Hons) MSc MRPharmS SP IP Network Pharmacist - North of Engla

Re: [R] Superscripts and rounding

2009-07-28 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
I'm anything but an expert in R however if I'm labeling a graph axis with a superscript I have tended to use: > plot (x , y , xlab = expression ("label"^2)) But when you try to have more than one superscript it fails. Assuming you are in a UTF8 location (Western Europe) you could try: > plot

[R] Summarising Data for Forrest Plots

2009-07-28 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
I tried to post this a few times last week and it seems to have got stuck somehow so I'm trying from a different email in the hope that works. If somehow this has appeared on the list 20 tiems and I never saw any of them I apologize ;-) I'm basically an R-newbie. But I am VERY computer liter

Re: [R] Superscripts and rounding

2009-07-28 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Slightly confused because if I try: > newdata.yaxis = c(2.473, 3.123456, 3.23456, 2.67890, 1.56789) > newdata.yaxis_4 = round (newdata.yaxis, digits = 4) > newdata.yaxis [1] 2.47 3.123456 3.234560 2.678900 1.567890 > newdata.yaxis_4 [1] 2. 3.1235 3.2346 2.6789 1.5679 As you see - I ge

Re: [R] Superscripts and rounding

2009-07-28 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
So the issue is something to do with the [['xxx']] construction of your data. Can you explain what thats' all about - as it errors all over the shop when I try using that... You've set me on a mission to find the answer! So I'd really like to recreate a little bit of your data here, and play..

Re: [R] Summarising Data for Forrest Plots

2009-07-29 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
h I believe I can achieve using the metaplot or forrest plot functions, replacing the studies with the relevant sub groups. But my challenge has been converting the patient data above down to list subgroups. Other than by running a survival analysis individually on an individual subgroup

Re: [R] Summarising Data for Forrest Plots

2009-07-29 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
D >> 1 Age >65 >> 2 Age <= 65 >> 3 Male >> ... >> 9 Grade 0-2 Tox >> 10 Grade 3/4 Tox >> >Hi Calum, >Have you tried subsetting the dataset like this: > >meta.DSL(...,data=mydataset[mydataset$age <= 65,],...) >

Re: [R] Superscripts and rounding

2009-07-29 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
> > library(RODBC) > library(HYDAT) > You will need to install HYDAT (the zip file) from > http://www.geog.ubc.ca/~rdmoore/Rcode.htm > > Below is my current code - which works. The [[]] is the way i am accessing > the columns from the data frame. > > thanks again for all your help > > # load HY

Re: [R] Superscripts and rounding

2009-07-30 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
Duh! did it again! the variables need str in front of them don't they!! sub = sprintf('Seasonal station with natural streamflow - Lat: %s Lon: %s Gross Area %s km\UB2 - Effective Area %s km\UB2 ', round( str[['metadata']][['latitude']], digits=4 ), round( str[['metadata']][['longitude']], digits =

Re: [R] Summarising Data for Forrest Plots

2009-07-30 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
, sex, toxicity), event=survival )" which would magically do it for me ;-) I guess if this is something I start having to do lots I might have to write one. Surprised one doesn't seem to exist - perhaps the number of variations in what people want would be too complex.

Re: [R] Summarising Data for Forrest Plots

2009-07-30 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
>Ah, I think I see what you want. Try this on each pair of exclusive sets: >Then under65row and over65row should be the first two rows of your result. >Can't test this at the moment, but I don't think it's too far wrong. > I knew this shouldn't need so much work ;-) Not cracked it yet - because

[R] Using 'field names' of a data.frame in a function

2009-08-06 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
I may be doing this wrong! but I have a function which I have simplified a lot below. I want to pass some 'field names' of a data-frame to the function for it to then do some manipulation of. Here's my code: #build a simple dataset mydataset = data.frame ( ages=c('40-49','40-49','40-49','30-

  1   2   >