Re: [R] Error when loading shared library - stringini()

2015-04-16 Thread arnaud gaboury
On Thu, Apr 16, 2015 at 3:25 PM, arnaud gaboury wrote: > On a Linux 64 bits, R.3.1.2, with tidyr() loaded. > > gabx@hortensia [R] separate(rawStats, 'toto') > Error in dyn.load(file, DLLpath = DLLpath, ...) : > unable to load shared object > '/developemen

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread arnaud gaboury
On Mon, Apr 20, 2015 at 9:10 AM, arnaud gaboury wrote: > R 3.2.0 on Linux > > > library(tidyr) > > playerStats <- c("LVL 10", "5,671,448 AP l6,000,000 AP", "Unique > Portals Visited 1,038", > "XM

[R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread arnaud gaboury
R 3.2.0 on Linux library(tidyr) playerStats <- c("LVL 10", "5,671,448 AP l6,000,000 AP", "Unique Portals Visited 1,038", "XM Collected 15,327,123 XM", "Hacks 14,268", "Resonators Deployed 11,126", "Links Created 1,744", "Control Fields Created 294", "Mind Units Ca

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread arnaud gaboury
-- extract_numeric function (x) { as.numeric(gsub("[^0-9.-]+", "", as.character(x))) } - Is there any particular reason for the hyphen in gsub() ? Why not remove it thus ? TY much Jim > > Jim

Re: [R] misbehavior with extract_numeric() from tidyr

2015-04-20 Thread arnaud gaboury
adley Wickham " > to report problems in a user-contributed package. > > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Mon, Apr 20, 2015 at 12:10 AM, arnaud gaboury > wrote: > >> R 3.2.0 on Linux >> >&

[R] upgrading issues with Rcpp

2015-02-11 Thread arnaud gaboury
gabx@hortensia [R] sessionInfo() R version 3.1.2 (2014-10-31) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 [6] LC_MESSAGES=en_US.UTF-8LC_PAPER=en_US.UTF-8 LC_NAM

[R] apply two functions to column

2015-02-12 Thread arnaud gaboury
I am little lost between all the possibilities to apply a function to a data.frame or data.table. Here is mine: structure(list(name = c("poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "cruzecontrol", "agreenmamba", "agreenmamba", "vairis", "

[R] gsub : replace regex pattern with values from another data.frame

2015-02-12 Thread arnaud gaboury
I have two df (and dt): df1 structure(list(name = c("poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "poisonivy", "cruzecontrol", "agreenmamba", "agreenmamba", "vairis", "vairis", "vairis", "vairis", "vairis", "vairis", "xaeth"), text = c("ok", "need items

Re: [R] gsub : replace regex pattern with values from another data.frame

2015-02-12 Thread arnaud gaboury
On Thu, Feb 12, 2015 at 3:40 PM, arnaud gaboury wrote: > I have two df (and dt): > > df1 > structure(list(name = c("poisonivy", "poisonivy", "poisonivy", > "poisonivy", "poisonivy", "poisonivy", "poisonivy&

Re: [R] gsub : replace regex pattern with values from another data.frame

2015-02-12 Thread arnaud gaboury
On Thu, Feb 12, 2015 at 7:12 PM, arnaud gaboury wrote: > On Thu, Feb 12, 2015 at 3:40 PM, arnaud gaboury > wrote: >> I have two df (and dt): >> >> df1 >> structure(list(name = c("poisonivy", "poisonivy", "poisonivy", >&

[R] replace values in one df by values from key pairs in another df

2015-02-13 Thread arnaud gaboury
I have been searching for a while now, but can't put all pieces of the puzzle together. Goal : I want to replace all these kinds of patterns <@U032FHV3S> by this <@agreenmamba>. In a more generic way, it is replacing 'id' by user 'name'. I have two df: The first, 'history', is some message histor

Re: [R] replace values in one df by values from key pairs in another df

2015-02-13 Thread arnaud gaboury
This is the wrong part of my code. > >> idName=users[users$id %in% ext] > idname > 1: U03AEKWTL agreenmamba > 2: U032FHV3S poisonivy > 3: U03AEKYL4 vairis > Best is to use: idNames <- users[pmatch(ext, users$id, duplicates.ok = T)]. This leave me with an ordered and dupl

Re: [R] Running R Remotely on LINUX

2015-04-14 Thread arnaud gaboury
On Tue, Apr 14, 2015 at 7:09 PM, Sarah Goslee wrote: > > Hi Michael, > > On Tue, Apr 14, 2015 at 12:57 PM, Michael Haenlein > wrote: > > Dear all, > > > > I am used to running R locally on my Windows-based PC. Since some of my > > computations are taking a lot of time I am now trying to move to a

Re: [R] Running R Remotely on LINUX

2015-04-14 Thread arnaud gaboury
On Tue, Apr 14, 2015 at 10:09 PM, John Sorkin wrote: > I suggest that you investigate installing RStudio server on the Linux > Box. If you do this, you can logon to RStudio (on the Linux server), and > it will look exactly like RStudio running on a windows box. You may need > some help configurin

[R] Error when loading shared library - stringini()

2015-04-16 Thread arnaud gaboury
On a Linux 64 bits, R.3.1.2, with tidyr() loaded. gabx@hortensia [R] separate(rawStats, 'toto') Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/developement/language/r/library/stringi/libs/stringi.so': libicui18n.so.54: cannot open shared object file: No such f

[R] Regex - subsetting parts of a file name.

2014-07-31 Thread arnaud gaboury
A directory is full of data.frames cache files. All these files have the same pattern: df.some_name.RData my.cache.list <- c("df.subject_test.RData", "df.subject_train.RData", "df.y_test.RData", "df.y_train.RData") I want to keep only the part inside the two points. After lots of headache using

Re: [R] Regex - subsetting parts of a file name.

2014-07-31 Thread arnaud gaboury
> > R> as.vector(sapply(my.cache.list, function(x)strsplit(x, "\\.")[[1]][2])) > [1] "subject_test" "subject_train" "y_test""y_train" > > > R> gsub("df\\.(.*)\\.RData", "\\1", my.cache.list) > [1] "subject_test" "subject_train" "y_test""y_train" > > > Note that "." will match any

Re: [R] Help on installing "R" packages in a Citrix

2014-08-22 Thread arnaud gaboury
On Fri, Aug 22, 2014 at 2:03 PM, S Ellison wrote: >> We are currently trying to migrate 3 users of "R" to a citrix based >> environment, but are coming across major issues trying to install the >> packages to the relevant image. > Please be more precised in your issue. __

Re: [R] Using openBLAS in R under Unix / Linux

2014-08-28 Thread arnaud gaboury
On Thu, Aug 28, 2014 at 11:45 AM, Martin Spindler wrote: > Dear all, > I would like to us openBLAS in R under Linux / Unix. > Which steps do I have to undertake? Does someone know a detailed > description? (I found some sources on the web, but none was really > helpful for me.) > Thanks and best,

Re: [R] Building R for better performance

2014-09-02 Thread arnaud gaboury
> The best that I can see for R would be if someone were to post a "how > to use MKL for compiling R" type document. I build R with MKL and ICC on my Archlinux box[1][2]. If I can help in anything, I will do it. [1]https://wiki.archlinux.org/index.php/R [2]https://aur.archlinux.org/packages/r-mk

Re: [R] Building R for better performance

2014-09-11 Thread arnaud gaboury
>> I got the benchmark script, which I've attached, from Texas Advanced >> Computing Center. Here are my results (elapsed times, in secs): Where can we get the benchmark script? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

Re: [R] Best Beginner Books?

2014-10-01 Thread arnaud gaboury
On Thu, Oct 2, 2014 at 4:54 AM, Jason Eyerly wrote: > A lot of excellent suggestions! Thank you everyone for the input. I’ve > purchased via Amazon: > > "A Beginner's Guide to R" by Zuur > "Data Manipulation with R" by Spector > “Introductory Statistics with R.” by Peter Dalgaard > > Are there an

Re: [R] Running R in Server

2015-08-18 Thread arnaud gaboury
On Sun, Aug 16, 2015, 2:29 PM Swagato Chatterjee wrote: Hello, I have written a R script which runs a regression of a dataset and saves the result in a csv file. Now this dataset has to be edited periodically which is done in a server. I need to run the R script in a server so that the results

[R] Build R with optimized BLAS library

2015-08-22 Thread arnaud gaboury
I want to build R with an optimized BLAS library. My OS: Fedora 22 Hardware: CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 Thread(s) per core: 2 Vendor ID: GenuineIntel Model name: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz I am a little confused when it comes to choose a method

Re: [R] Build R with optimized BLAS library

2015-08-22 Thread arnaud gaboury
--- Sent from my phone. Please excuse my brevity. On August 22, 2015 7:51:39 AM PDT, arnaud gaboury wrote: >I want to build R with an optimized BLAS library. >My OS: Fedora 22 >Hardware: CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian >CPU(s)

[R] R environment variables

2015-10-10 Thread arnaud gaboury
I was doing some cleaning ony my linux machine and, among others, I try to clean my R environment variables accordingly [0] and [1]. I am not really sure how to declare in a clean manner these startup variables. Here is my setup: 1- my home folder -$ ls ~/.config/R env/ helper/ Renviron Rprofi

[R] change col types of a df/tbl_df

2015-12-10 Thread arnaud gaboury
Here is a sample of my data frame, obtained with read_csv2 from readr package. myDf <- structure(list(X15 = c("30.09.2015", "05.10.2015", "30.09.2015", "29.09.2015", "10.10.2015"), X16 = c("02.10.2015", "06.10.2015", "01.10.2015", "01.10.2015", "13.10.2015"), X17 = c("Grains", "Grains", "Grains",

Re: [R] change col types of a df/tbl_df

2015-12-10 Thread arnaud gaboury
On Thu, Dec 10, 2015 at 12:54 PM, Duncan Murdoch wrote: > On 10/12/2015 6:12 AM, arnaud gaboury wrote: > >> Here is a sample of my data frame, obtained with read_csv2 from readr >> package. >> >> myDf <- structure(list(X15 = c("30.09.2015", &q

Re: [R] change col types of a df/tbl_df

2015-12-10 Thread arnaud gaboury
On Thu, Dec 10, 2015 at 1:47 PM, Giorgio Garziano < giorgio.garzi...@ericsson.com> wrote: > my_convert <- function(col) { > v <- grep("[0-9]{2}.[0-9]{2}.[0-9]{4}", col); > w <- grep("[0-9]+,[0-9]+", col) > col2 <- col > if (length(v) == length(col)){ > col2 <- as.Date(col, format="%d.%

[R] sum specific rows in a data frame

2010-04-14 Thread arnaud Gaboury
I have a data frame called "pose": DESCRIPTION QUANITY CLOSING.PRICE 1 WHEAT May/101467.75 2 WHEAT May/102467.75 3 WHEAT May/101467.75 4 WHEAT May/101467.75 5 COTTON NO.2 May/101 78.1

Re: [R] sum specific rows in a data frame

2010-04-14 Thread arnaud Gaboury
CLOSING.PRICE POSITION 1 COTTON NO.2 May/10 78.133 2 WHEAT May/10 467.754 Op is a data.frame object.The trick is done! ******* Arnaud Gaboury Mobile: +41 79 392 79 56 BBM: 255B488F __ R-help@

[R] sum rows in a data.frame

2010-04-15 Thread arnaud Gaboury
Dear group, Here is a data.frame, "lme": > lme DESCRIPTION CLOSING.PRICE POSITION 4PRIMARY NICKEL USD 04/06/1025,755.71000 5PRIMARY NICKEL USD 10/06/1025,760.86000 6 PRM HGH GD ALUMINIUM USD 09/07/10 2,415.90000 8 SPC

[R] sum rows in a data.frame...solution

2010-04-15 Thread arnaud Gaboury
0 16 SPCL HIGH GRAD2,393.0 If someone has a better idea, it is welcomed. -Original Message- From: arnaud Gaboury [mailto:arnaud.gabo...@gmail.com] Sent: Thursday, April 15, 2010 9:50 AM To: 'r-help@r-project.org' Subject: sum rows in a data.frame Dear group, Her

[R] data.frame and ddply

2010-04-15 Thread arnaud Gaboury
Dear group, I have this following data.frame: > c DESCRIPTION CREATED.DATE QUANITY CLOSING.PRICE 26 PRM HGH GD ALU 2010-04-09 -12,415.9000 27 PRM HGH GD ALU 2010-04-09 12,415.9000 28 PRIMARY NICKEL 2010-03-04 1 25,755.7100 29 PRIMARY NICKEL 2010-03-05

Re: [R] Replace / with - in date

2010-04-15 Thread arnaud Gaboury
Why don't you try something like : Xd$x=as.date(xd$x,format="%y/%m/%d"). > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Christian Raschke > Sent: Thursday, April 15, 2010 8:28 PM > To: r-help@r-project.org > Subject: Re:

[R] data frame manipulation

2010-04-16 Thread arnaud Gaboury
Dear group, Here is my data.frame : df <- structure(list(DESCRIPTION = c("PRM HGH GD ALU", "PRM HGH GD ALU", "PRIMARY NICKEL", "PRIMARY NICKEL", "PRIMARY NICKEL", "PRIMARY NICKEL", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STANDARD LEAD ", "STA

Re: [R] data frame manipulation

2010-04-16 Thread arnaud Gaboury
the CREATED.DATE ******* Arnaud Gaboury Mobile: +41 79 392 79 56 BBM: 255B488F *** From: Ista Zahn [mailto:istaz...@gmail.com] Sent: Friday, April 16, 2010 1:05 PM To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] data frame manipulation Hi, I'm not sure I understand

Re: [R] data frame manipulation

2010-04-16 Thread arnaud Gaboury
Excellent!! You saved me hours and hours of turning around and around. TY so much. From: Ista Zahn [mailto:istaz...@gmail.com] Sent: Friday, April 16, 2010 1:37 PM To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] data frame manipulation It works for me... > DF <- + str

[R] data.frame and ddply

2010-04-16 Thread arnaud Gaboury
class = "data.frame") Here is my code : >opfut=ddply(futures, c("CONTRAT","SETTLEMENT"), summarise, POSITION= sum(QUANTITY)) Here is the output: > opfut CONTRAT SETTLEMENT POSITION 1 SUGAR NO.11 May/10 16.54005 2

Re: [R] data.frame and ddply

2010-04-16 Thread arnaud Gaboury
oo.com] > Sent: Friday, April 16, 2010 4:02 PM > To: arnaud Gaboury; r-help@r-project.org > Subject: Re: [R] data.frame and ddply > > You can do something like this after the output from opfut > opfut <- data.frame(opfut$CONTRAT,opfut$POSITION,opfut$SETTLEMENT) > name

[R] read.csv data frame thousands separator

2010-04-23 Thread arnaud Gaboury
.", "1,386.", "1,388.", "1,389.", "1,389." ), Net.Charges..sum. = c(-4.32, -4.32, -21.6, -4.32, -4.32, -4.32, -4.32, -4.32, -4.32, -4.32, -4.32, -12.5, -12.5, -12.5, -12.5, -12.5, -3.3, -3.3, -3.3, -3.3, -3.3, -3.3, -3.3, -3.3)

[R] substract start from the end of the vector

2010-04-23 Thread arnaud Gaboury
06/102020-03-041 25,755.71 In the DESCRIPTION column, I want to get rid of the date (09/07/10 .). I know the function substr(x, start, stop), but in my case, I need to indicate I want to start from the end of the vector, and I have no idea how to pass this arg

Re: [R] substract start from the end of the vector

2010-04-23 Thread arnaud Gaboury
23, 2010 6:11 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] substract start from the end of the vector > > Hi, > > On Fri, Apr 23, 2010 at 11:57 AM, arnaud Gaboury > wrote: > > Dear group, > > > > Here is my df : > > >

[R] save a data frame in environment

2010-04-27 Thread arnaud Gaboury
o have the 2 Dataframes "PositionFut" & "PositionLme" in my environment, as I will need them later for another function. If I do a save(), it will be saved in my directory, but won't see it when I do ls(), even if I do a get() before. What is the process to save thes

Re: [R] save a data frame in environment

2010-04-27 Thread arnaud Gaboury
2010 11:44 AM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] save a data frame in environment > > Don't print them but return() them from your function position() within > a list. Then you will have a list of two data.frames for later usage > a

[R] data frame manipulation and regex

2010-04-28 Thread arnaud Gaboury
Dear group, Here is my data.frame : avprix <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN May/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SPCL HIGH GRADE ZINC USD Jul/10", "STANDARD LEAD USD Jul/10"), prix = c(-1.5, -1082, 11084, 1983.5, -2464, -118), quantity = c(0, -3, 8,

[R] gsub,regex and replacing

2010-04-28 Thread arnaud Gaboury
Dear group, I need to modify some characters in a data frame. I want to use gsub and the regex functionalities to do this. Here is the data frame (df): DESCRIPTIONprix quantity 1 CORN Jul/10-1.50 2 CORN May/10 -1082.0

Re: [R] gsub,regex and replacing

2010-04-28 Thread arnaud Gaboury
, -1082, 11084, 1983.5, -2464, -118), quantity = c(0, -3, 8, 2, -1, 0)), .Names = c("DESCRIPTION", "prix", "quantity"), row.names = c(NA, -6L), class = "data.frame") From: jim holtman [mailto:jholt...@gmail.com] Sent: Wednesday, April 28, 2010 1:31

Re: [R] data frame manipulation and regex

2010-04-28 Thread arnaud Gaboury
TY so much david. We are getting close. But I need to keep "USD" in my object name (i.e "STANDARD LEAD USD") ******* Arnaud Gaboury Mobile: +41 79 392 79 56 BBM: 255B488F *** > -Original Message- > From: David

[R] data frame move columns

2010-04-28 Thread arnaud Gaboury
Dear group, Here is my df: avprix <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN May/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), prix = c(-1.5, -1082, 11084, 1983.5, -2464, -118), quantity = c(0, -3, 8, 2, -1, 0), fees = c(-8.

Re: [R] data frame move columns

2010-04-28 Thread arnaud Gaboury
I want the 0s to be at the end or beginning. > -Original Message- > From: Erik Iverson [mailto:er...@ccbr.umn.edu] > Sent: Wednesday, April 28, 2010 5:21 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] data frame move columns > > > >

Re: [R] data frame move columns

2010-04-28 Thread arnaud Gaboury
TY david. Here we go with a correct code! > -Original Message- > From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Wednesday, April 28, 2010 5:28 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] data frame move columns > > >

[R] convert Factor as numeric

2010-04-29 Thread arnaud Gaboury
Dear group, I know this issue has been already covered, and before you reply I must say I have read the R-FAQ and search the mailing list archive. I still can't manage to change my factor to numeric as I couldn't find any clear answer. Here is my df : Pose1 <- structure(list(DESCRIPTION = struct

Re: [R] convert Factor as numeric

2010-04-29 Thread arnaud Gaboury
TY petr, I was just trying something like that few mn ago :-) as.numeric(gsub(",", "", S)) does exactly what I want. > -Original Message- > From: Petr PIKAL [mailto:petr.pi...@precheza.cz] > Sent: Thursday, April 29, 2010 1:28 PM > To: arnaud Ga

[R] read.csv and blank character in object name of my data.frame

2010-04-30 Thread arnaud Gaboury
Dear group, Here is my data frame: position100415 <- structure(list(DESCRIPTION = structure(1:9, .Label = c(" SUGAR NO.11 Jul/10 ", " SUGAR NO.11 May/10 ", "CORN May/10 ", "COTTON NO.2 Jul/10 ", "CRUDE OIL miNY May/10 ", "ROBUSTA COFFEE (10) Jul/10 ", "SILVER May/10 ", "SOYBEANS Jul/10 ", "WHE

Re: [R] read.csv and blank character in object name of my data.frame

2010-04-30 Thread arnaud Gaboury
TY so much, I ignored about this argument. Adding stripe.white=T as an argument in my read.csv does the job. > -Original Message- > From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] > Sent: Friday, April 30, 2010 1:08 PM > To: arnaud Gaboury > Cc: r-hel

[R] short question about data frame manipulation

2010-04-30 Thread arnaud Gaboury
Dear group, I am losing my mind with a simple question. Sorry if obvious, but I maybe start to be confused after days and days of reading documentations. Df : df <- structure(list(a = 1:3, b = 4:6, c = structure(c(1L, 1L, 1L), class = "factor", .Label = "w")), .Names = c("a", "b", "c"), row.na

[R] getting historical data from cryptocurrency exchange

2020-11-25 Thread arnaud gaboury
I need to download basic OHLCV (Open, High, Low, Close, Volume) in a hourly format from various cryptocurrency exchanges. There is the crypto package[0] but it has been removed from CRAN. Then there is the coinmarketcapr[1] package on CRAN, but it is limited to a paid service, coinmarketcap, which

[R] apply a function to a list of lists

2023-09-19 Thread arnaud gaboury
I have a list of 9 lists called my.list. Each one of these 9 lists is itself a list of 6 data.frames. Most of these data.frames have 0 rows and 0 columns. I want to return all data.frames from the list with row numbers different from 0. I first created the following function: non_empty_df <- funct

[R] replace character by numeric value

2023-09-27 Thread arnaud gaboury
I have two data.frames: mydf1 <- structure(list(symbol = "ETHUSDT", cummulative_quote_qty = 1999.9122, side = "BUY", time = structure(1695656875.805, tzone = "", class = c("POSIXct", "POSIXt"))), row.names = c(NA, -1L), class = c("data.table", "data.frame")) mydf2 <- structure(list(symbol = c("ET

Re: [R] replace character by numeric value

2023-09-28 Thread arnaud gaboury
or your answer. Why not use > factors? Are you trying to test contrasts maybe? I would be surprised if > the function for the statistical test you are trying to use does not > deal with that already on its own. > > HTH, > Ivan > > > On 27/09/2023 13:01, arnaud gaboury

[R] transform a list of arrays to tibble

2023-10-17 Thread arnaud gaboury
I work with a list of crypto assets daily closing prices in a xts class. Here is a limited example: asset.xts.lst <- list(BTCUSDT = structure(c(26759.63, 26862, 26852.48, 27154.15, 27973.45), dim = c(5L, 1L), index = structure(c(1697068800, 1697155200, 1697241600, 1697328000, 1697414400), tzone =

Re: [R] transform a list of arrays to tibble

2023-10-17 Thread arnaud gaboury
ake a suggestion, if you really want a tibble that allows you > to know what each row is for, consider one of many methods for saving the > previous row names as a new column. I used that to take the data.frame > version I made above and got: > > > temp <- as_tibble(result.

[R] merge two data frames

2010-08-04 Thread arnaud gaboury
Dear list, here are my two data frames: av <- structure(list(DESCRIPTION = c("COFFEE C Sep/10", "COPPER Sep/10", "CORN Dec/10", "CRUDE OIL miNY Sep/10", "GOLD Aug/10", "HENRY HUB NATURAL GAS Sep/10", "PALLADIUM Sep/10", "SILVER Sep/10", "SOYBEANS Nov/10", "SPCL HIGH GRADE ZINC USD", "SUGAR NO.11

Re: [R] merge two data frames

2010-08-04 Thread arnaud gaboury
;> 978, 0, 0, 0)), .Names = c("DESCRIPTION", "pl", "PL", "POSITION", >> "SETTLEMENT"), row.names = c(NA, -13L), class = "data.frame") >> >> I am looking for one data frame with the column $PL=zz$PL+av$PL. >> I have

[R] Regex and gsub

2010-05-11 Thread arnaud Gaboury
quot;, "POSITION", "prix"), row.names = c(NA, -17L), class = "data.frame") I want to remove all the dates in $DESCRIPTION. I was thinking using something like this: >df3$DESCRIPTION<- gsub("here is a regex expression","",df3$DESCRIPTION). Can&#

Re: [R] Regex and gsub

2010-05-11 Thread arnaud Gaboury
TY for the two answers. Both work. > -Original Message- > From: Phil Spector [mailto:spec...@stat.berkeley.edu] > Sent: Tuesday, May 11, 2010 11:21 AM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] Regex and gsub > > df3$DESCRIPTION = >

[R] merging data frame

2010-05-11 Thread arnaud Gaboury
Dear group, I have 3 data frames I would like to merge. Here they are: pose16 <- structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 12L), .Label = c("COPPER May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS

Re: [R] merging data frame

2010-05-11 Thread arnaud Gaboury
In fact, that is one solution. I can then do a ddply(x,"DESCRIPTION",summarise, pl=sum(prix),quantity=sum(POSITION)). It does work. I was just wandering if it exists another solution. From: jim holtman [mailto:jholt...@gmail.com] Sent: Tuesday, May 11, 2010 2:14 PM To: arnaud Gab

[R] merge two data frames

2010-05-11 Thread arnaud Gaboury
Dear group, I have these 2 following data frame: allcon <- structure(list(DESCRIPTION = structure(1:17, .Label = c("COFFEE C Jul/10", "COPPER May/10", "CORN Jul/10", "CORN May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "HENRY HUB NATURAL GAS May/10", "ROBUSTA COFFEE (10

Re: [R] merge two data frames

2010-05-11 Thread arnaud Gaboury
vice, I would SYSTEMATICALLY add the argument strip.white=T when I read a csv file, so all blanks are removed. > -Original Message- > From: arnaud Gaboury [mailto:arnaud.gabo...@gmail.com] > Sent: Tuesday, May 11, 2010 4:25 PM > To: r-help@r-project.org > Cc: 'arnaud Gaboury&

[R] data frame subscription

2010-05-12 Thread arnaud Gaboury
Dear group, Here is my df : pose16 <- structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 12L), .Label = c("COPPER May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11

Re: [R] data frame subscription

2010-05-12 Thread arnaud Gaboury
t; > c(702.9, -244.77, -166.48, -2273.8, -24876, -2985, -80.9, 15.95, > > -2512.5, > > 2423) > > > > > > On Wed, May 12, 2010 at 11:53 AM, arnaud Gaboury > > wrote: > > > >> The result is different with your code. > >> > >> M

Re: [R] data frame subscription

2010-05-12 Thread arnaud Gaboury
M HGH GD ALUMINIUM USD", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), class = "factor"), POSITION = c(2, -3, -2, -2, -18, -3, -5, 1, -5, 1), prix = c(-702.9, 244.77, 166.48, 2273.8, 24876, 2985, 80.9, -15.95, 2512.5, -2423)), .Names = c("DES

Re: [R] data frame subscription

2010-05-12 Thread arnaud Gaboury
TY. Didn't know this function. From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Wednesday, May 12, 2010 3:32 PM To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] data frame subscription Try this: transform(pose16, prix = POSITION * SETTLEMENT, SETTLEMENT =

[R] access objects in my environment

2010-05-13 Thread arnaud Gaboury
Dear group, Here are my objects in my environment: > ls() [1] "Pos100415" "Pos100416" "posA" "pose15""pose16""pose16t" "position" "trade" "x" I need to pass the object "Pos100415" to a function. This element is a data.frame, obtained through a function: Pos(x)<-myfun(x) with

Re: [R] access objects in my environment

2010-05-13 Thread arnaud Gaboury
Wonderful!! TY so much for the help. > -Original Message- > From: Patrizio Frederic [mailto:frederic.patri...@gmail.com] > Sent: Thursday, May 13, 2010 10:47 AM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] access objects in my environment >

[R] long command line cut in 2 parts

2010-05-13 Thread arnaud Gaboury
Dear group, I have this command line in a function: zz<-merge(transform(merge(value,allcon,all.y=T),SHORTDESCRIPTION=NULL,VALUE= NULL,PL=-VALUE*pl,quantity=NULL),PosB,all.x=T,sort=F) I want to cut it in 2 lines (just for convenient purpose). Here is what I did : zz<-merge(transform(merge(value

Re: [R] long command line cut in 2 parts

2010-05-13 Thread arnaud Gaboury
Removing the + sign resolves the problem. TY > -Original Message- > From: Muhammad Rahiz [mailto:muhammad.ra...@ouce.ox.ac.uk] > Sent: Thursday, May 13, 2010 3:15 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] long command line cut in 2 part

[R] regex and sub

2010-05-14 Thread arnaud Gaboury
Dear group, Here is an object: z <- c("LSCPos100415.csv", "LSCPos100416.csv", "LSCPos100419.csv", "LSCPos100420.csv", "LSCPos100421.csv", "LSCPos100422.csv", "LSCPos100423.csv", "LSCPos100426.csv", "LSCPos100427.csv", "LSCPos100428.csv", "LSCPos100429.csv", "LSCPos100430.csv", "LSCPos100503.cs

Re: [R] regex and sub

2010-05-14 Thread arnaud Gaboury
Of course this helps! I didn't noticed the difference between sub and gsub. TY > -Original Message- > From: Bernd Weiss [mailto:bernd.we...@uni-koeln.de] > Sent: Friday, May 14, 2010 12:23 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R

[R] writing function

2010-05-20 Thread arnaud Gaboury
Dear group, I am trying to write functions, but as a beginner, everything is not so obvious. Let's say I want the results in a list of elemts like this : tot1, tot2, etc Here is a function: toto <- function(x,y) { for(i in x:y){ paste(c("tot",i),collapse="")<-(i*2) } } If I type this : >to

[R] select elements in a list

2010-05-21 Thread arnaud Gaboury
want is 100415,100416,100419,100420. The object "l" is a list, but can be of any other kind if it can help. I tried something like this : >select<-l[c(x:y)] But it doesn't return the needed result Any help would be appreciated *** Arnaud Gaboury Mobile

Re: [R] select elements in a list

2010-05-21 Thread arnaud Gaboury
See ?which for more info. > > HTH, > Ivan > > Le 5/21/2010 11:07, arnaud Gaboury a écrit : > > Dear group, > > > > Here is a list : > > > > l<- > > list("100415", "100416", "100419", "100420"

[R] indexing problem

2010-05-21 Thread arnaud Gaboury
Dear group, Here is my environment : > ls() [1] "l" "PLglobal" "Pos100415" "Pos100416" "Pos100419" "Pos100420" "position" "select" "Trad100415" "Trad100416" "Trad100419" "Trad100420" "trade" "y" With objects : > l [1] "100415" "100416" "100419" "100420" "100421" "10

Re: [R] indexing problem

2010-05-21 Thread arnaud Gaboury
ip about "select" not to use as an object name > -Original Message- > From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Friday, May 21, 2010 4:00 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] indexing problem > > > On Ma

Re: [R] indexing problem

2010-05-21 Thread arnaud Gaboury
t] > Sent: Friday, May 21, 2010 4:00 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] indexing problem > > > On May 21, 2010, at 9:19 AM, arnaud Gaboury wrote: > > > Dear group, > > > > Here is my environment : > > > >

[R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
Dear group, I have a function, let's call it myfun, wich give me a list of result: R1,R2,R3... There is a loop in this function to get my results. Here is the structure of my function: Myfun<-function() { For (i in X ){ ---instructions- Ri { { All Results (R1,R2...) are Data.

Re: [R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
[,2] [,3] [1,] "DailyPL100416" "DailyPL100419" "DailyPL100420" That's not what I want! I expect "DF" to be a data.frame binded by row. I suspect there is an issue with get() or assign(), or something like that. Any help is

Re: [R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
Maybe is there a neater solution, but the function mget() does the trick. So until further advice, I will work with your solution. Thank you > -Original Message- > From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] > Sent: Monday, May 24, 2010 5:07 PM > To: arnaud Gab

Re: [R] writing function:loop and rbind

2010-05-24 Thread arnaud Gaboury
Do you think there is a way to add somewhere the argument row.names=NULL ? Or should I have to write another line to remove the row.names? > -Original Message- > From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] > Sent: Monday, May 24, 2010 5:07 PM > To: arnaud Gaboury

[R] writing function

2010-05-24 Thread arnaud Gaboury
Dear group, Here is my environment after I run a function, myfun() >myfun() > ls() [1] "allcon""avprix16" "DailyPL100416" "DailyPL100419" "DailyPL100420" "l" "ll""myl" "PL" "PLdaily" "PLglobal" "PLmonthly" [13] "Pos100415" "Pos100

Re: [R] writing function

2010-05-24 Thread arnaud Gaboury
Thank you so much. You are totally right. > -Original Message- > From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] > Sent: Monday, May 24, 2010 6:33 PM > To: arnaud Gaboury > Cc: r-help@r-project.org > Subject: Re: [R] writing function > > My guess is that ei

[R] writing function : can't find an object

2010-05-26 Thread arnaud Gaboury
Dear group, Here is my function: #return the daily PL for day y PLDaily<-function(x,y) { #find elements in my directory with "LSCPos" in the name, keep the numeric part in the name and #create a list l<-gsub("\\D","",dir()[grep("LSCPos",dir())]) #select in the list the desired elements

[R] (no subject)

2010-05-26 Thread arnaud Gaboury
ge if one of the element of the POSITION column is different from zero. I tried using mapply with some line like this : > mapply(if,u$POSITION,==0,print("WARNING:POSITIONS ARE WRONG",quote=F)) But it seems it is not the correct way to pass the various arguments. Any help is appreci

[R] condition apply to elements of a data frame column

2010-05-26 Thread arnaud Gaboury
Oops, forgot to give a subject > -Original Message- > From: arnaud Gaboury [mailto:arnaud.gabo...@gmail.com] > Sent: Wednesday, May 26, 2010 2:31 PM > To: r-help@r-project.org > Cc: 'arnaud Gaboury' > Subject: > > Dear group, > > Here is my dat

Re: [R] condition apply to elements of a data frame column

2010-05-26 Thread arnaud Gaboury
se in fact (minimum of one element different from zero). From: Joris Meys [mailto:jorism...@gmail.com] Sent: Wednesday, May 26, 2010 2:48 PM To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] (no subject) What exactly are you trying to do? If you want to know which position is w

[R] data frame manipulation change elements meeting criteria

2010-05-26 Thread arnaud Gaboury
Dear group, Here is my df : trade <- structure(list(Trade.Status = c("DEL", "INS", "INS"), Instrument.Long.Name = c("SUGAR NO.11", "CORN", "CORN"), Delivery.Prompt.Date = c("Jul/10", "Jul/10", "Jul/10"), Buy.Sell..Cleared. = c("Sell", "Buy", "Buy"), Volume = c(1L, 2L, 1L), Price = c("15.2500",

Re: [R] data frame manipulation change elements meeting criteria

2010-05-26 Thread arnaud Gaboury
<- X for (i in which(Y=="DEL")){     new.vect[i]<-switch(   EXPR = X[i],   Sell="Buy",       Buy="Sell",   X[i]) } cbind(new.vect,X,Y) On Wed, May 26, 2010 at 7:43 PM, arnaud Gaboury wrote: Dear group, Here is my df : trade <- structure(list(Tr

[R] switch function

2010-05-27 Thread arnaud Gaboury
Dear group, Here is my df : trades <- structure(list(Trade.Status = c("DEL", "INS", "INS"), Instrument.Long.Name = c("SUGAR NO.11", "CORN", "CORN"), Delivery.Prompt.Date = c("Jul/10", "Jul/10", "Jul/10"), Buy.Sell..Cleared. = c("Sell", "Buy", "Buy"), Volume = c(1L, 2L, 1L), Price = c("15.2500", "

  1   2   >