similar to: (-8)^(1/3) == NaN?

Displaying 20 results from an estimated 4000 matches similar to: "(-8)^(1/3) == NaN?"

2004 Apr 27
4
Problems raised to 1/3 power and NaN
I am debugging some code and found a function that returns and error most of the time. I have issolated the problem to when it raises an argument to the 1/3 power but for the life of me I can not figure out why it is not working. i have gone through the FAQs and have found nothing (not to say I might have missed something). I am highly embarrased with my inability find the problem (my face is
2008 Sep 23
2
R-2.7.2 infected?
I tried downloading R-2.7.2 (http://cran.cnr.berkeley.edu/bin/windows/base/R-2.7.2-win32.exe, both from Berkeley and cran) and both times I got a warning from Computer Associates eTrust Antivirus (version 7.1.710) that the Win32/Adclicker.JO trojan was detected: The Win32/Adclicker.JO was detected in C:\USERS\USER\APPDATA\LOCAL\MICROSOFT\WINDOWS\TEMPORARY INTERNET
2012 Jul 30
3
replace values in vector from a replacement table
Dear all I've got stuck when trying to replace values in a vector by selecting replacements from a replacement table. I'm trying to use only base functions. Here's a dummy example: > (x <- rep(letters,2)) [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l"
2009 Dec 12
1
cube root on array
Dear R developers, is that right? > -27^(1/3) [1] -3 > c(-27,27)^(1/3) [1] NaN 3 i'm using sign( c(-27,27) ) * abs( c(-27,27)) ^(1/3) , thanks [[alternative HTML version deleted]]
2011 May 12
1
about vector to the power of a decimal
Hi why I can't do this? m<-c(1,-2,3) m^2.1 with a negative number in it ,but I can do this to a single negative number like -2^2.1~ Thank you ~ JIngsi [[alternative HTML version deleted]]
2009 Jan 03
5
Power functions?
I had a question about the basic power functions in R. For example from the R console I enter: -1 ^ 2 [1] -1 but also -1^3 [1] -1 -0.1^2 [1] -0.01 Normally pow(-1, 2) return either -Infinity or NaN. Has R taken over the math functions? If so I would think that -1^2 is 1 not -1 and -0.1^2 is 0.01 not -0.01. Thank you. Kevin
2008 Jul 01
5
WIERD: Basic computing in R
Can someone please enlighten me as to why the following happens? > -2.7^8.6 [1] -5125.407 > p<- -2.7 > q<- 8.6 > p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to variables and then the computation is repeated. Thanks in advance for any suggetsions. Kris.
2010 Jan 13
4
<= returns wrong result? Why
Dear all, Does anybody know the probable reason why <= gives false when it should give true? These two variables are of the same type, and everything works in the cycle but then it stops when they are equal. this is the output result > Rk[47] <= RB[21] [1] FALSE > Rk[47] [1] 0.002842007 > RB[21] [1] 0.002842007 Thanks a lot. [[alternative HTML version deleted]]
2012 Jul 10
3
fill 0-row data.frame with 1 line of NAs
Dear all Is there a simpler method to achieve the following: When I obtain an empty data.frame after subsetting, I need for it to contain one line of NAs. Here's a dummy example: > (.xb <- iris[ iris$Species=='zz', ]) [1] Sepal.Length Sepal.Width Petal.Length Petal.Width Species <0 rows> (or 0-length row.names) > dim(.xb) [1] 0 5 > (.xa <-
2005 Jan 19
4
Writing rules direct to Kernel
Hi, I''m interested to write rules direct in Kernel space memory and not to execute the tc command. Have anyone done this before ? Any ideas ? Sources ? Thank you, Liviu -- This message was scanned for spam and viruses by BitDefender. For more information please visit http://linux.bitdefender.com/ _______________________________________________ LARTC mailing list /
2005 Jul 12
5
R: to the power
hi all why does R do this: (-8)^(1/3)=NaN the answer should be : -2 a silly question but i kept on getting errors in some of my code due to this problem. i solve the problem as follows: say we want : (-a)^(1/3) then : sign(a)*(a^(1/3)) works but there has to be a simpler way of soing such a simple mathematical operation. thanking you / allan
2009 May 15
4
replace "%" with "\%"
Dear all, I'm trying to gsub() "%" with "\%" with no obvious success. > temp1 <- c("mean", "sd", "0%", "25%", "50%", "75%", "100%") > temp1 [1] "mean" "sd" "0%" "25%" "50%" "75%" "100%" > gsub("%",
2007 Oct 17
3
Trouble with R CMD INSTALL
Why does R CMD INSTALL work for some packages (e.g., lme4) but not others (e.g., nlme)? Thanks, Gang
2013 Apr 15
6
how to transform string to "Camel Case"?
Dear all, Given the following vector: > (z <- c('R project', 'hello world', 'something Else')) [1] "R project" "hello world" "something Else" I know how to obtain all capitals or all lower case letters: > tolower(z) [1] "r project" "hello world" "something else" > toupper(z) [1] "R
2008 Mar 16
3
rgl build warnings and loading error on Linux
Dear useRs, I have several problems in using rgl-0.77 (and recent earlier versions) on Gentoo Linux with a custom-built v. 2.6.22 kernel. Currently I use R-2.6.1. When I build rgl, # R CMD INSTALL "/home/liviu/inst/dwn/R/rgl_0.77.tar.gz" or install.packages("rgl", dependencies=TRUE, method ="wget"), I notice the following warning messages: i686-pc-linux-gnu-g++
2009 Aug 20
4
expanding 1:12 months to Jan:Dec
Dear R users I would like to do some spreadsheet style expansion of dates. For example, I would need to obtain a vector of months. I approached in an obviously wrong way: > paste(01:12) [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" > as.Date(paste(01:12),
2009 Aug 04
2
100% CPU when running (cran2deb) JGR on Debian
Dear all, I installed the amd64 cran2deb [1] JGR binaries on a fresh Debian testing, and JGR is missbehaving. When JGR starts up, one core of the CPU goes to 100% and stays there, even though I am keeping it idle and not performing any operation. I tried JGR with both sun-java6-jdk and openjdk-6-jdk, debian-liv:/home/liviu# update-alternatives --config java There are 4 choices for the alternative
2010 May 11
5
Regressions with fixed-effect in R
Hi there, Maybe people who know both R and econometrics will be able to answer my questions. I want to run panel regressions in R with fixed-effect. I know two ways to do it. First, I can include factor(grouping_variable) in my regression equation. Second, I plan to subtract group mean from my variables and run OLS panel regression with function lm(). I plan to do it with the second way because
2011 Mar 06
4
sorting & subsetting a data.frame
Dear all This may be obvious, but I cannot get it working. I'm trying to subset & sort a data frame in one go. x <- iris x$Species1 <- as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine with(x, x[order(Sepal.Length, rev(sort(Species1))),]) ##gets subsetted, but not sorted as expected with(x, x[(Sepal.Length==6.7) &
2010 Oct 09
4
same random numbers in different sessions
Dear all I'm using Xubuntu Lucid and I keep getting the same random numbers whenever I start a new session of R. For example, I keep getting > sample(1:1000, 1) [1] 87 or > rnorm(1:10) [1] -1.3618103 0.4241701 1.0720076 0.2208145 -0.5375314 -0.4846588 [7] 0.7576768 0.6527407 -0.6868786 0.8718527 I expected that some set.seed() instruction woudl be present in a config file in