similar to: NA preserved in logical call - I don't understand this behavior because NA is not equal to 0

Displaying 20 results from an estimated 1000 matches similar to: "NA preserved in logical call - I don't understand this behavior because NA is not equal to 0"

2010 Sep 15
1
approxfun returning value higher than I would expect
Below is the code that I am using in a much larger function. I would expect a bankfull measure at zero to be between 0.6 and 0.8 approxfun is returning 0.8136986. I am sure that I am missing something. measure_bkf <- (structure(list(measurment_num = c(0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4), bankfull_depths_m = c(-0.48, -0.48, -0.42, -0.26, 0.58,
2010 Feb 04
1
for loop with if statment problem
Both of the approx functions work correctly individually, but they are not being distinguished in the for loop by the if statments. Any help would be appreciated. for loop of interest is below x <- (structure(list(Site = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2010 Feb 03
1
Additional field data collection
This is a subset of a much larger dataframe. I would like to be able to automate finding the pair of x, y coordinates where the line crosses zero agian x <- (structure(list(bankfull_depths_m = c(0, 0.17, 0.38, 0.37, 0.36, 0.39, 0.47, 0.48, 0.19, 0.05, -0.05, -0.09), measurment_num_m = c(0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4)), .Names = c("bankfull_depths_m",
2007 Jun 04
2
missing IntegerFromString()
I have created a DLL not so long ago using C code. My code used the IntegerFromString() function that used to be exported in the Rinternals.h header file (and thus easily accessible). Recently I upgraded to R 2.5.0 and my DLL stopped working. I see that the IntegerFromString() function is not exported in any of the header files in the RHOME\include directory. Is it possible for me to use it
2005 Aug 17
4
accesing slots of S4 class in C code
I am trying to use a custom S4 object in my C code and I cannot get the access to its slots working. The following is a toy example, but even this crashes. In R I have: setClass("pd", representation(data="numeric")) x <- new("pd", data=1:5) test <- function(pd.obj) { res <- .C("TestFun", pd.obj) res} test(x) (Of couse
2009 Dec 15
1
for loop for automatic pdf generation
I know this is not reproducible, but I don't want to clog up mail boxes with the data frame. I would be happy to send this off list. I am sure that I am missing something simple. The plotting works if I just paste the call to qplot into R and replace the [i] with a number. Thanks for all of your help in advance. #loop to spit out PDFs list.names <-
2003 Oct 01
1
Macintosh binaries; was: Rcmdr and Macintosh
I am a Windows user and trying to make life easier for my Mac-using students. After investigating the Mac situation more, it appears that the key to easy use is having precompiled binaries. However the packages I am interested in (Rcmdr and its required package, car) do not have one. I do not have easy access to a Mac, so I have a plea to Macintosh users: could someone please create them if it is
2003 Sep 29
1
Rcmdr and Macintosh
Hi everyone! I am planning to use R and Rcmdr in a basic stat course. I have no access to a computer lab, but I can expect all students to have a laptop. Of couse, I have no control over their OS and in my experience several of them will have Macs. I have Windows. My question is the following: can I expect them to be able to install R, Tcl/Tk and Rcmdr (i.e. does anybody has experinece with it?)
2012 Jan 21
2
4th corner analysis ade4 - what do the colors mean
I have used the fourthcorner function as suggest by dray and legendre (model 2 and 4 then combine). I plot the combined value with plot(four.comb, type="G"). What do the colors mean? I have both grey and black bars. many thanks, Stephen -- Stephen Sefick ************************************************** Auburn University Biological Sciences 331 Funchess Hall Auburn, Alabama
2010 Jul 14
0
.Rprofile interfering with update.packages()
I know this is a double post, but the subject line was really misleading. Sorry again. This is the first time that I have tried to update packages with a tinkered around with .Rprofile. I start R with R --vanilla and it does not load my .Rprofile, but when I issue the command update.packages() R downloads the packages as expected, but then seems to load .Rprofile before compiling the packages
2010 Sep 08
1
problem with max in a function
s <- 1.00 max(s) returns 1 is there anyway that I can get it to return 1.00. I am using the results of this max statement in a grep statement and it returns the wrong numbers, I will provide more information and code if it would make more sense in context. -- Stephen Sefick ____________________________________ | Auburn University? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? | | Department of
2012 Apr 25
1
fill a dataframe with zeros where the rows are a smaller subset of a larger dataframe (species by site)
row <- c("a","b","c","d","e","f","g") #rows from larger data frame row.1 <- c("a","b","c","g") #rows of smaller data frame because d, e, and f don't contain any of the species, but the zeros are important x <- data.frame(sp1=rnorm(4), sp2=rnorm(4), sp3=rnorm(4),
2012 Jul 24
2
Convert Package Interest?
I am thinking about submitting a package to CRAN that contains some units conversion functions that I use on a regular basis. Would this be helpful to the community, or would it be better to keep this as a personal package? I don't want to clutter CRAN. many thanks, -- Stephen Sefick ************************************************** Auburn University Biological Sciences 331 Funchess
2012 Jul 18
1
ggplot2 qplot pch not working anymore
Is there a way to use a continuous variable to pch in qplot? I believe this worked in previous version. I need to specify certain values of a shape for particular points so that multiple graphs all show the same shapes for the same streams. I have gone to the original data and added a pch column that I would like to use to specify the shapes to pch in qplot. Any help would be greatly
2010 Jul 08
0
0 exit status on packages update try
I am not entirely sure what is going on. I am sure that I am missing something. maptools won't detach... Thanks for all of your help. R 2.11.1 OS Ubuntu 10.04 R --vanilla install.packages("sp", dep=TRUE) Loading required package: reshape Loading required package: plyr Loading required package: grid Loading required package: proto This is vegan 1.17-3 Loading required package:
2011 Jan 06
1
[zoo] - Individual zoo or data frames from non-continuous zoo series
#Is there a way to break the below zoo object into non-NA data frames algorithmically #this is a small example of a much larger problem. #It is really no even necessary to have the continuous chunks #end up as zoo objects but it is important to have them end #up with the index column. #thanks for all of your help in advance, and #if you need anything else please let me know library(zoo) ind.
2010 Jun 28
1
Zoo series to a date time stamp that is regular
NOTE: I will provide data if necessary, but I didn't want clutter everyones mailbox All: I have a time series with level and temperature data for 11 sites for each of three bases. I will have to do this more than once is what I am saying here. OK, The time series are zoo objects with index values in chron format. The problem is that the date and times should be at even 15 min intervals,
2013 May 01
3
Chron format question h:m not working
R 2.12.2 on Scientific Linux 6.4 #works chron(times.="15:00:00", format=c(times="h:m:s")) #doesn't work chron(times.="15:00", format=c(times="h:m")) From chron Manual: The times format can be any permutation of "h", "m", and "s" separated by any one non-special character. The default is "h:m:s". what am I
2010 Jul 15
1
loess line predicting number where the line crosses zero twice
These data represent stream channel cross-sectional surveys. I would like to be able to find the measurement on the tape (measure) where the Bank Full Depth (bkf_depths) is 0. This will happen twice because the channel has two sides. I thought fitting a loess line to these data and then predicting the measurment number would do it. I was wrong. Below is my failed attempt. My naive thought is
2010 Jun 29
3
formating chron date times for printing
the date were created with chron with this argument format=c(dates="Y/m/d", times="H:M:S")) so I have the dates being displayed as (10/06/22 12:00:00) I would like to have them displayed as "2010-06-22 12:00:00" or "%Y-%m-%d %H:%M:%S" and then I can convert these for mergeing with another data frame x <- (structure(c(14464, 14464.0104166667,