search for: lippelanna24

Displaying 20 results from an estimated 23 matches for "lippelanna24".

2010 Jan 26
4
Error with toString
Hello there, I want to create a string from strings and numbers, here is my code: str <- "name" & toString(20) but it returns me this error: Error in toString(20) : could not find function ".jcall" what did I do wrong? I couldn't find this error anywhere... -- View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1290327.html Sent from
2010 Mar 25
4
Convert number to Date
Hello, I have a date value in excel: 1/4/2010 which in number format gives me 40182. When I read this with read.xls from R I get same 40182 so what I do is that I use the as.Date() function but here is what the as.Date() function returns me: > as.Date(40182) [1] "2080-01-06" Why don't I get the same thing as in excel? Thanks! ----- Anna Lippel -- View this message in context:
2010 Feb 12
3
Code working but too slow, any idea for how to speed it up ?(no loop in it)
Hello my friends, here is a code I wrote with no loops on matrix that is taking too long (2 seconds and I call him 720 times --> 12 minutes): mat1 and mat2 are both matrix with 103 columns and 164 rows. sequence <- matrix(seq(1 : ncol(mat1))) returns <- apply(sequence, 1, function, mat1= mat1, mat2 = mat2, day = 1) function<- function(mat1, mat2, colNb, day){
2010 Jan 20
1
Retrieving data through bbg or excel, what is faster?
Hello, I need to retrieve datas from bloomberg. I want to retrieve those datas in the fastest way as possible. I have two options: writing the datas from bbg to excel and reading from r the excel sheet or directly read the datas from from r with a Rbbg connection. Which connection is faster? Thank you -- View this message in context:
2010 Feb 02
2
Retrieve distinct values within a whole data frame
Hello everyone, I am trying to retrieve the list of distinct values within a whole data frame. I tried to use unique() function but it retrieves the distinct values within each column or row, I want it for the entire data frame, any idea? ----- Anna Lippel -- View this message in context: http://n4.nabble.com/Retrieve-distinct-values-within-a-whole-data-frame-tp1460205p1460205.html Sent from
2010 Jan 26
3
Apply a function on an array with the parameter as an array
Hello R buddies, I want to apply a function on an array but for each element of the array I want to use a different parameter, So here is how I tried to enter the function: apply(as.matrix(X),2, function, parameter1 = arrayOfParameter) I put X as a matrix because it was initially an element of a list. It returns me an array with the same length as X but with values that I don't even
2010 Mar 17
2
Troubles on retrieving rownames
Hi guys, I am using the blp() function from RBloomberg package which returns a matrix of prices with the columns corresponding to the security name and the columns to the date. When I have a look at the matrix I can see the rownames (dates) on the left of the prices but when I call the rownames() function it returns me a NULL value. It worked perfectly until I had to reinstall the RBloomberg
2010 Jan 29
3
Applying a function on each columns of a matrix
Hello everyone, I have the following matrix [,1] [,2] [,3] [,4] [1,] 0.002809706 0.0063856960 0.0063856960 0.011749681 [2,] 0.004893124 0.0023118418 -0.0005122951 -0.014646465 [3,] 0.003547897 0.0063355297 0.0030410542 0.011403953 [4,] 0.004838299 -0.0040383645 -0.0090406831 -0.011027569 [5,] 0.035648755 0.0334815590 0.0380977404
2010 Mar 11
2
Can't convert list to matrix properly
Hi guys, here is a list of names that I have: MyList: > myList<-list("A", "B","C","D") > myList [[1]] [1] "A" [[2]] [1] "B" [[3]] [1] "C" [[4]] [1] "D" I want to turn this list into a matrix of 1 row and 4 columns with those four components (A, B, C, D) so here is what I do: myDataFrame <-
2010 Mar 03
5
filtering signals per day
Hello R lovers, I have a vector of dates and signals. I want to filter the signals per day in a way that only the first signal of the day remains like this: Dates Signals Filtered Signal 2006-11-02 0 0 2006-11-02 1 1 2006-11-02 0 0 2006-11-02 1 0 2006-11-02 1
2010 Jan 29
7
Simple question on replace a matrix row
Hello, I have a matrix mat1 of dim [1,8] and mat2 of dim[30,8], I want to replace the first row of mat2 with mat1, this is what I do: mat2[1,]<-mat1 but it transforms mat2 in a list I don't understand, I want it to stay a matrix... ----- Anna Lippel -- View this message in context: http://n4.nabble.com/Simple-question-on-replace-a-matrix-row-tp1427857p1427857.html Sent from the R help
2010 Jan 20
0
Error on using blpGetData() function from RBloomberg package
Hello, I am using te blpGetData() function to retrieve closing prices from bloomberg on r. This is the code that I wrote: library(RBloomberg) conn=blpConnect blpGetData(conn,"ANF UN Equity","PX_LAST","2009/09/01","2009/09/10") and I get the following error: Error in substring(paste("0", v$day, sep = ""), first = nchar(paste(v$day))) :
2010 Jan 22
2
Counting Na values on a time serie only on the past datas
Hello everyone, I have a time serie of n values, some are na's. I want to get a vector of size n whose elements represent on the time t < n the number of missing values between o and t. I know I can do it with a loop but I wanted to know if there was a function or a special syntax to do this. Thanks a lot! -- View this message in context:
2010 Jan 23
1
How to apply a function on each column of a matrix
Hello everyone, I get for each date a measure for n elements in the form of a matrix. I am converting it to a ts object using ts(). I want to apply a function on each column. I started using the apply function ( set to 2) but what it returns is a matrix with the same columns representing the function applied on the last column of the initial matrix. I have been trying to use the sapply function or
2010 Jan 28
2
Error on using lag function
Hello everyone, I have a vector P and I want to replace each of its missing values by its next element, for example: P[i] = NA --> P[i] = P[i+1] To do this I am using the replace() and lag() functions like this: P <- replace(as.ts(P),is.na(as.ts(P)),as.ts(lag(P,1))) but here is the error that I get: Warning message: In NextMethod("[<-") : number of items to replace is not a
2010 Feb 03
2
Delete missing value rows from a matrix
Hi everyone, I have a matrix with many Na's. Some rows contain some Na's and some others are entirely composed of Na's. I want to delete the rows that are entirely composed of Na's but not the other ones so I can't use a simple removeNA. Has any one an idea? ----- Anna Lippel -- View this message in context:
2010 Apr 05
1
Deleting many list elements in one time
Hi guys, here is a simple thing I want to do but it doesn't work: I have a vector of the element indexes that I want to delete called index so when I write myList[[index]] <- NULL to delete these elements here is what I get: Error in myList[[index]] <- NULL : more elements supplied than there are to replace Isn't it possible to delete multiple elements? ----- Anna Lippel --
2010 Apr 19
2
Using split and then unsplit
Hello everyone, I use the split function splitting with the f function on a 3 columns and more than 100 000 rows data frame. Once it's split I have a list of data frames still with 3 columns and n rows. I manipulate those list elements and get a list of data frames still with 3 columns but less rows. So when I unsplit it, I get an error as I use the same factor function I used to split ( f in
2010 Feb 02
1
Build a matrix from another matrix by specifying the indexes
Hello R specialists, I have a base vector called vBase with 102 elements. I have another vector vec1 which elements are only part of vBase but is shorter. I transform vec1 so I get a vector with the same size as vBase and with each common element on the same indexed row. If a value is missing in vec1 then I put a Na like this: vec1 vBase Amsterdam Amsterdam Na
2010 Feb 02
1
Finding the difference between two vectors
Hello everyone, I have two vectors having only one element different: vector1 vector2 vector1 TWC TWC TWC VFC TWX NA VIA/B VFC VFC