similar to: Unexpected returned value from a function

Displaying 20 results from an estimated 30000 matches similar to: "Unexpected returned value from a function"

2008 Sep 23
2
Counting character occurrences in data frame
Hi R-Users, I have a data frame containing year, month, day, and code columns. The code column is a unique character of set ('E','A','B') - I am trying to determine an efficient way of summarizing the count of each of these codes by month and year without having to use for...loops and subsets. Does anyone have any suggestions? Thanks in advance, Dave Here is a snapshot
2009 Feb 02
1
xyplot with lowess curves
I am trying to change the attributes of the lowess lines fit to an xyplot command, but have been unsuccessful in my search of the online help. Right now, both the points and lowess line come out in the same color (blue). I am unsure how I can change the properties of the lowess line separately. xyplot ( SnowLineElevation ~ Year | Model, data = data, ylim = c(0,1800), type =
2009 Apr 30
1
Creating datasets in packages
I am developing an R package which includes datasets. The build and install works correctly. However, when I access the dataset ("BowRiver"), I get: > data(BowRiver) > BowRiver Error: object "BowRiver" not found. However, I can access the dataset from > data Example R datasets (such as USArrests) are loaded and can be accessed by the dataset name: >
2008 Apr 28
1
strptime format argument
I am getting an unanticipated result attempting to format a datetime string date1 <- strptime('2005 297 1030 35', '%Y %j %H%M %S') # returns "2005-10-24 10:12:35" date2 <- strptime('2005 297 912 35', '%Y %j %H%M %S') # returns NA Are there any ways to adjust the format argument (e.g., '%H') to accept one or two digit hours?
2008 Nov 18
1
Namespaces of imported packages
Hi, I am trying to build an R package. My existing code makes use of the bitops and chron packages. So I have included statements to import required functionality into the NAMESPACE file using import(). When I run Rcmd build, and error is generated "Error: package 'bitops' does not have a name space" I exclude the import(bitops) statement from the NAMESPACE file and rebuild
2010 Feb 22
1
lmom: plotting log Pearson Type III
Can anyone show me how to add a log Pearson type III plot using the evdistq() command to an extreme value plot using the lmom package? Attached sample code below... Thanks in advance, Dave library(lmom) # annual maximum daily streamflows Mackenzie River mackenzieRiver = c(26600, 30300, 34000, 32000, 29200, 28300, 28600, 26400, 28300, 28800, 29000, 22100, 32900, 31800, 21600, 32100, 27000,
2010 May 13
1
aggregate.zoo
I have been using aggregate function to determine the annual minimum in a daily time series. However, I was also hoping to determine the date of occurrence without having to loop through each year to identify the date of each minimum returned from aggregate(). Is there a more convenient way of doing so? Thanks in advance, Dave library(zoo) n <- 1000 dly <- zoo( x = rnorm(n), order.by
2012 Mar 14
3
Needing a better solution to a lookup problem.
I have a solution (actually a few) to this problem, but none are computationally efficient enough to be useful. I'm hoping someone can enlighten me to a better solution. I have data frame of chromosome/position pairs (along with other data for the location). For each pair I need to determine if it is with in a given data frame of ranges. I need to keep only the pairs that are within any of
2015 Sep 29
3
making object.size() more meaningful on environments?
Hi, Currently object.size() is not very useful on environments as it always returns 56 bytes, no matter how big the environment is: env1 <- new.env() object.size(env1) # 56 bytes env2 <- new.env(hash=TRUE, size=75000000L) object.size(env2) # 56 bytes env3 <- list2env(list(a=runif(25000000), L=LETTERS)) object.size(env3) # 56 bytes This makes it pretty useless on
2007 Aug 02
1
New user help with plot.default
Hi - I'm just starting out with R and have come up against a problem with what should be a simple operation. I'm plotting a range of safety standards for 7 different chemicals. I don't want the standard box and whisker plot - I just a dot for each value. Whilst using "plot.default" I get the error "invalid xlim value" - which is confusing since using the same script
2008 Sep 02
2
two lattice graphs in one object
When I create a lattice/Trellis type graph, I typically write a function that returns the graph, as in do.graph <- function(x, y, ...) { require(lattice) return(xyplot(y~x, ...)) } My question today is this: If I want two graphs on one page, one way of achieving it is to print the objects into defined areas, as in gr1 <- xyplot(rnorm(111) ~ runif(111)) gr2 <-
2005 Jul 27
1
Question on glm for Poisson distribution.
Good afternoon, I REALLY try to answer to my question as an autonomous student searching in the huge pile of papers on my desk and on the Internet but I can't find out the solution. Would you mind giving me some help? Please. ######################################### I'm trying to use glm with factors: > Pyr.1.glm<-glm(Pyrale~Trait,DataRav,family=poisson) If I have correctly
2007 Jun 19
2
axis labels in multiple plots
Hi, I'am trying to make a multiple bar plot over a map and I'm having difficulties with the distance between axes labels and the axis. Trying to control this with mgp does not help because it controls both axes simultaneously. For example, with default values (mgp = c(3, 1, 0)) y-axis labels are ok, but x-axis labels are not. Setting mgp = c(3, 0, 0) gives good x-axis labels but the
2006 Dec 08
1
missing factor levels in a lattice barchart panel cause unexpected failure
Hi all - I'm trying to generate lattice barchart graphs with missing values, and came across the following: This does not run. I would expect it to: library(lattice) D = data.frame(X=1, Y=factor(letters[2], letters[1:2])) barchart(~ X, D, groups=Y) Error in grid.Call.graphics("L_rect", x$x, x$y, x$width, x$height, resolveHJust(x$just, : invalid line type which is simply
2011 Oct 25
4
comparing two tables
Hi everybody, I would like to know whether it is possible to compare to tables for certain parameters. I have these two tables: gene table name chr start end str accession Length gen1 4 646752 646838 + MI0005806 86 gen12 2L 243035 243141 - MI0005821 106 gen3 2L 159838 159928 + MI0005813 90 gen7 2L
2017 Jun 02
4
sum() returns NA on a long *logical* vector when nb of TRUE values exceeds 2^31
Hi, I have a long numeric vector 'xx' and I want to use sum() to count the number of elements that satisfy some criteria like non-zero values or values lower than a certain threshold etc... The problem is: sum() returns an NA (with a warning) if the count is greater than 2^31. For example: > xx <- runif(3e9) > sum(xx < 0.9) [1] NA Warning message: In sum(xx
2013 Mar 04
2
[LLVMdev] Unexpected DSAnalysis behavior
Hi, during the hunt for a bug causing strange behavior of our automatic parallelization framework, I found some, at least for me, unexpected behavior of the DataStructureAnalysis in Poolalloc. Consider the following simplified program: ==================== int ARR[4] = {1, 2, 3, 4}; int a(int pos) { return ARR[pos]; } int sum(int op_a, int op_b) { return a(op_a) + a(op_b); } int
2008 May 05
3
troubles with R CMD check and examples under Ubuntu gutsy
Dear listers, I was used to package pgirmess under Windows with everything OK, but, for the first time, I had a trial this afternoon on Ubuntu 7.10 gutsy (I have a double boot computer and work more and more under unix) and R 2.7.0. Everything went OK except this: sudo R CMD check pgirmess ..... * checking examples ... ERROR Running examples in 'pgirmess-Ex.R' failed. The error most
2003 Oct 05
3
stepAIC problem
Dear R-users I have a probelm running stepAIC in R1.7.1 I wrote a program which used stepAIC as a part of it, and it worked fine while I was using the previous version of R1.7.0. However, I found the program did not work any more. Now, R produces a message which tells "Error in as.data.frame.default(data) : can't coerce function into a data.frame" every time I run the part of
2017 Jan 19
3
Corrupted idmap...
OK, so since it appears our only recourse is to build a new domain from scratch, how can we prevent this from happening again? We have several Gentoo workstations, a bunch of Windows 7 workstations, and a few NAS devices which run Linux of some flavor. How do we use NIS attributes without killing our domain? The Samba guide even has instructions for using ADUC to set the UID/GID for users and