similar to: sorting question

Displaying 20 results from an estimated 900 matches similar to: "sorting question"

2009 Aug 05
7
why is 0 not an integer?
Why when I assign 0 to an element of an integer vector does the type change to numeric? Here is a particularly perplexing example: > v <- 0:10 > v [1] 0 1 2 3 4 5 6 7 8 9 10 > class(v) [1] "integer" > v[1] <- 0 > class(v) [1] "numeric" #!! > -- View this message in context:
2009 Aug 05
7
why is 0 not an integer?
Why when I assign 0 to an element of an integer vector does the type change to numeric? Here is a particularly perplexing example: > v <- 0:10 > v [1] 0 1 2 3 4 5 6 7 8 9 10 > class(v) [1] "integer" > v[1] <- 0 > class(v) [1] "numeric" #!! > -- View this message in context:
2009 Feb 13
3
R Help
Hi, I have a list of numbers (classified as a list) that contains integer(0) empty vectors. How do I convert those integer(0) into NAs? Thanks [[alternative HTML version deleted]]
2004 Jul 30
2
mirroring in both directions with rsync
When operating in daemon mode, will rsync check to see which file is newer and decide which direction to transfer based on that? Example, We have 2 terminal servers, A and B. I want users to be able to work on either server and have their home directories on both stay in sync. If a user logs into server A and changes files, the server would know to transfer the file from A to B. If they log
2009 Jul 08
2
print() to file?
I'd like to write some objects (eg arrays) to a log file. cat() flattens them out. I'd like them formatted as in 'print' but print only writes to stdout. Is there a simple way to achieve this result? Thanks -- View this message in context: http://www.nabble.com/print%28%29-to-file--tp24397445p24397445.html Sent from the R help mailing list archive at Nabble.com.
2009 Jun 17
4
searching help for partial matches
The situation is that I know there is a function and know approximately what the name is, and want to find the exact name. Is there a way of searching for near-matches (similar to unix apropos). For example, I know there is a function called something like allequal (or allequals or AllEquals or...). But ?allequal, etc, return nothing, only if I remember the name can I get help via ?all.equal.
2009 Jul 07
3
vectorizing a function
I'm sure I'm missing something obvious but I'm not seeing how to simply "vectorize" a function of two or more variables. Say I have f <- function(x,y) if (x>0) y else -y Now I have vectors x and y of equal length and I'd like to apply f element-wise. I.e. conceptually z <- f(x,y) where x, y, z are vectors of the same length Some magic involving apply?
2010 Mar 11
4
Forecast
sample report data that i want to forecast quarter quarter_index Revenue 2007 Q1 1 $3,856,799 2007 Q2 2 $4,243,328 2007 Q3 3 $4,930,369 2007 Q4 4 $5,443,579 2008 Q1 5 $5,164,830 2008 Q2 6 $5,104,413 2008 Q3 7
2009 Aug 04
4
array slice notation?
Suppose I have an n-diml array A and I want to extract the first "row" -- ie all elements A[1, ...] Interactively if I know 'n' I can write A[1,,,,,] with (n-1) commas. How do I do the same more generally, eg in a script? (I can think of doing this by converting A to a vector then extracting the approp elements then reshaping it to an array, but I wonder if there isn't a
2012 Feb 03
3
Cannot get "==" operator to return TRUE
I have a data.frame named "df". The dput of df is at the bottom of this e-mail. What I'd like to do is replace the "n/a " values with NA. On Mac OSX, it works to do this: df[df == "n/a"] <- NA However, it does not work on Ubuntu. See below. Thanks in advance, Garrett > x <- df[27, 4] # complete data.frame dput is below > dput(x) "n/a?"
2012 Apr 12
4
Definition of "lag" is opposite in ts and xts objects!
Example: Will ts objects be obsolete or modified? > a [,1] 1983 Q1 2.747365190 1983 Q2 2.791594762 1983 Q3 -0.009953715 1983 Q4 -0.015059485 1984 Q1 -1.190061246 1984 Q2 -0.553031799 1984 Q3 0.686874720 1984 Q4 0.953911035> lag(a,4) [,1] 1983 Q1 NA 1983 Q2 NA 1983 Q3 NA 1983 Q4 NA 1984 Q1 2.747365190 1984 Q2
2010 Mar 10
3
see the example and help me
sample report data that i want to forecast quarter quarter_index Revenue 2007 Q1 1 $3,856,799 2007 Q2 2 $4,243,328 2007 Q3 3 $4,930,369 2007 Q4 4 $5,443,579 2008 Q1 5 $5,164,830 2008 Q2 6 $5,104,413 2008 Q3 7
2009 Feb 19
2
table with 3 variables
I have the initial matrice: > *data.frame(Subject=rep(100:101, each=4), Quarter=rep(paste("Q",1:4, sep=""),2), Boolean = rep(c("Y","N"),4))* Subject Quarter Boolean 1 100 Q1 Y 2 100 Q2 N 3 100 Q3 Y 4 100 Q4 N 5 101 Q1 Y 6 101 Q2 N 7 101 Q3 Y 8 101
2005 Nov 12
1
computation on a table
Hello, I have a table (1) of the form q1 q3 q4 q8 q9 A 5 2 0 1 3 B 2 0 2 4 4 I have another table (2): q1 q2 q3 q4 q5 q6 q7 q8 q9 C 10 7 4 2 6 9 3 1 2 I would like to divide the numbers in table (1) by the number of the appropriate column in table (2): q1 q3 q4 q8 q9 A 5/10 2/4 0/2 1/1 3/2 B 2/10 0/4 2/2 4/1 4/2
2008 Mar 02
1
question on lag.zoo
Hi Guys, I'm using zoo package now. I found lag is not doing what I assumed. > x <- zoo(11:21) > z <- zoo(1:10, yearqtr(seq(1959.25, 1961.5, by = 0.25)), frequency = 4) > x 1 2 3 4 5 6 7 8 9 10 11 11 12 13 14 15 16 17 18 19 20 21 > lag(x) 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 > z 1959 Q2 1959 Q3 1959 Q4 1960 Q1 1960 Q2 1960 Q3 1960 Q4
2010 Jan 24
2
Creating directories & folders
Dear R users, I would like to create the following 3 folders (FUND1, FUND2, MARINE) within the 'parent.dir' as defined below. FUND1 <- "FD1 Q4 2009" FUND2 <- "FD2 Q4 2009" MARINE <- "MARINE Q4 2009" parent.dir <- "D:/....................." folders <- c("FUND1", "FUND2", "MARINE") for (i in
2012 Feb 17
4
How can I tabulate time series data (in RStudio or any other R editor)?
Hello, I have a question on how to tabulate the time series data. I use RStudio, but if can be done in any other R editor, it should work in RStudio as well. > a1<-11:22 > a1ts<-ts(a1, frequency=4, start=c(1978,1)) > a1ts Qtr1 Qtr2 Qtr3 Qtr4 1978 11 12 13 14 1979 15 16 17 18 1980 19 20 21 22 If I click the variable "a1ts" on the
2008 Feb 01
2
the "union" of several data frame rows
Hi, I have a question about how to obtain the union of several data frame rows. I'm trying to create a common key for several tests composed of different items. Here is a small scale version of the problem. These are keys for 4 different tests, not all mutually exclusive: id q1 q2 q3 q4 q5 q6 1 A C 2 B D 3 A D B 4 C D B D I would like
2009 Feb 19
2
table with 3 varialbes
I have the initial matrice: > *data.frame(Subject=rep(100:101, each=4), Quarter=rep(paste("Q",1:4, sep=""),2), Boolean = rep(c("Y","N"),4))* Subject Quarter Boolean 1 100 Q1 Y 2 100 Q2 N 3 100 Q3 Y 4 100 Q4 N 5 101 Q1 Y 6 101 Q2 N 7 101 Q3 Y 8 101
2011 Mar 14
2
data.frame transformation
Hi R users, I have following data frame df<-data.frame(q1=c(0,0,33.33,"check"),q2=c(0,33.33,"check",9.156), q3=c("check","check",25,100),q4=c(7.123,35,100,"check")) and i would like to replace every element that is less then 10 with . (dot) in order to obtain this: q1 q2 q3 q4 1 . . check . 2 . 33.33 check 35