similar to: Testing for warning inside functions

Displaying 20 results from an estimated 300 matches similar to: "Testing for warning inside functions"

2007 Dec 20
1
auto named savings (pngs & data-frames)
Hello, i only got a small problem. i try to create automatic new dataframes, or png?s. the main problem i got is: how can i create automatic a new name for a file (read out by simply "for") - i tried to use "(paste...) but theres an errormessage, about a wrong declination. R told it is as.character, but need as.Real. Should i use another method than "paste"? i tried as
2012 Nov 09
1
Mean of matrices entries in list of lists
Hey there, I've got a list of lists with matrices: A list with 13 entries (representing years), each of them another list with 12 matrices (representing one month). In each matrix there are as many rows as there are hours in the different months and 2 columns, since two meteorological parameters are measured. What I want to do is to calculate the hourly mean values for each month over the
2013 Jan 15
1
[PATCH 2/3] xen_platform: Do not use old_portio-style callbacks
From: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Andreas Färber <afaerber@suse.de> --- hw/xen_platform.c | 21 ++++++++++----------- 1 Datei geändert, 10 Zeilen hinzugefügt(+), 11 Zeilen entfernt(-) diff --git a/hw/xen_platform.c b/hw/xen_platform.c index ca66047..8866468 100644 --- a/hw/xen_platform.c +++
2010 Mar 08
2
fit a gamma pdf using Residual Sum-of-Squares
Hi all, I would like to fit a gamma pdf to my data using the method of RSS (Residual Sum-of-Squares). Here are the data: x <- c(86, 90, 94, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174) y <- c(2, 5, 10, 17, 26, 60, 94, 128, 137, 128, 77, 68, 65, 60, 51, 26, 17, 9, 5, 2, 3, 7, 3) I have typed the following code, using nls method:
2008 Sep 10
1
help: error handling in try
First time to post and searched archive for this problem with no clue. My version is 2.5.1. Below is a function to check if a given date is a valid date to a given date function object. It uses try (also tried tryCatch but with same problem). When given an invalid date, I am hoping try will generate en error message which would be picked up by the geterrmessage and thus expecting a false result.
2012 Aug 03
3
Sum two Vectors of different length
Dear all, in one part of my code I want to sum two vectors element-wise the problem is that either the 1st vector or the 2nd vector always have one or two less elements example of my problem In TotalVector + (datalist2[[1]]$dataset$Results[[j]]$Results[[time]]$Sweep) :   Länge des längeren Objektes          ist kein Vielfaches der Länge des kürzeren Objektes Browse[1]> str(TotalVector)  int
2012 Apr 03
1
rpart error message
Hi R-helpers, I am using rpart package for decision tree using R.We are invoking R environment through JRI from our java application.Hence, the result of R command is returned in REXP and we use geterrMessage() to retrieve the error. When we execute the following command, cnr_model<-rpart(as.factor(Species)~Sepal Length+Sepal Width+Petal Length, method="class",
2010 Apr 01
3
reading excel into R
Dear all, I am new R user and I am sure that this question has been asked quite often and I have also googled it and read about it! I understood that in order to read excel sheet into R you need to open it and saved it as csv or text, is this true? or you can use read.delim2 and read.csv2 to do this without the following error > dat <- read.csv2(file="C:\\Dokumente und
2012 Oct 31
1
Strange compiling behaviour
Compiling this little function gets me some strange behaviour .initDataDir <- function(){ if(file.exists(LOCATION)) { if(as.logical(file.info(LOCATION)["isdir"]))return stop(LOCATION, " exists but is not a directory") } Z <- dir.create(LOCATION) if(!Z){ stop(geterrmessage()) ## stop("Juggel") } return(Z) } > .initDataDir <-
2018 Feb 22
2
Problem with geterrmessage()
R 3.4.3 OS X Colleagues I have a 20K line script in which I encounter an unexpected problem. If the script detects presence of a particular file USERCODE.txt, it executes: source(?USERCODE.txt?) If that file is not present, the script executes without a problem. There might be syntax errors in USERCODE.txt; therefore, the code above is embedded in a try command:
2018 Feb 22
0
Problem with geterrmessage()
Only the default error handler puts the error message in a buffer where it can be retrieved with geterrmessage. try() replaces the default error handler. Either look at the value returned by try() or use tryCatch with conditionMessage. Best, luke On Thu, 22 Feb 2018, Dennis Fisher wrote: > R 3.4.3 > OS X > > Colleagues > > I have a 20K line script in which I encounter an
2018 Feb 22
2
Problem with geterrmessage()
Luke Thanks ? I revised the code to: ERRORMESSAGE <- try(source(USERSCRIPTFILE, local=T), silent=T) print(ERRORMESSAGE) now returns: $value [1] 0 $visible [1] FALSE Not clear what to make of that. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com > On Feb 22, 2018, at 12:45 PM, luke-tierney at
2016 May 04
4
Is it possible to retrieve the last error? (not error *message*)
Hi, at the R prompt, is it possible to retrieve the last error (as in condition object of class "error")? I'm not asking for geterrmessage(), which only returns the error message (as a character string). I'm basically looking for a .Last.error or .Last.condition, analogously to .Last.value for values, which can be used when it is "too late" (not possible) to go back
2019 Jun 08
2
Determining the exit code of an "almost finished" R script
Dear All, I'm using "reg.finalizer" in a function that is to be called in R scripts to do some cleanup on success. I have not found a way to run the function only if the script run without errors, so when the exit code is expected to be 0. What I've tried is checking "geterrmessage()", but unfortunately it's not perfect: if an error was handled with eg
2005 Oct 13
3
aggregate slow with many rows - alternative?
Hi, I use the code below to aggregate / cnt my test data. It works fine, but the problem is with my real data (33'000 rows) where the function is really slow (nothing happened in half an hour). Does anybody know of other functions that I could use? Thanks, Hans-Peter -------------- dat <- data.frame( Datum = c( 32586, 32587, 32587, 32625, 32656, 32656, 32656, 32672, 32672, 32699 ),
2019 Jun 08
2
Determining the exit code of an "almost finished" R script
On Sat, Jun 8, 2019 at 2:13 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > On 08/06/2019 7:42 a.m., Gergely Dar?czi wrote: > > Dear All, > > > > I'm using "reg.finalizer" in a function that is to be called in R scripts > > to do some cleanup on success. I have not found a way to run the function > > only if the script run without
2001 May 15
3
box around a barplot
Hi, is it possible to draw a box around the following barplot; using "box=TRUE" won't work. ---------- pc<-c(1,2,5,29,27) barplot(pc,ylim=c(0,30),yaxs="r",xaxs="r",ylab="Anzahl" ,names.arg=c("Mac","286er","386er","486er","Pentium I") ,axisnames=T,col="gray") ---------- Thanks in
2007 Oct 04
2
plot from source file
Dear list Maybe someone can help with the following problem: I have a source file containing the following code for plotting: pdf(file = 'data/mario/boxplot.pdf') bwplot(sig100 ~ target | group, data = fish, main = 'Boxplot der Signale in 100 Zellen nach Gruppe', xlab = '', ylab = 'Anzahl der Signale') dev.off() pdf(file = 'data/mario/xyplot.pdf')
2013 Jan 31
2
use name (not values!) of a dataframe inside a funktion
Dear Listers, can anyone help me, please. Since several days i try to figure out, how to assign values, vectors, functions etc to variables with dynamically generated names inside of functions. Sometimes I succeed, but the success is rather arbitrary, it seems. up to now i don't fully understand, why things like get, assign, <<- etc do sometimes work, and sometimes not. here's one
2019 May 04
2
read.table() fails with https in R 3.6 but not in R 3.5
In versions of R prior to 3.6.0 the following invocation succeeds, returning the data frame shown: > read.table("https://www.dwds.de/r/stat?corpus=kern&cnt=tokens&date=decade&format=text", header=TRUE) Dekade Anzahl 1 1900 11467254 2 1910 13023370 3 1920 13434601 4 1930 13296355 5 1940 12121250 6 1950 13191131 7 1960 10587420 8 1970 10944129 9