similar to: data frame manipulation with condition

Displaying 20 results from an estimated 7000 matches similar to: "data frame manipulation with condition"

2012 Feb 07
1
replace elements of a data frame
Hello, I am getting mad at finding a simple way to replace elements of a df. Here is a short df : > names<-c("BO","C","CL") > price<-c("10","25","20") > df<-data.frame(names,price) I want to replace "BO" by "BOB", "C" by "CR", "CL" by "CLO", and the list is
2012 Feb 09
2
ifelse
Hello, I need to print a screen message after a test. >list<-c("10","1","100","10") >ifelse(all(list %in% c(1,10,100)==TRUE),cat("YES\n"),cat("NO\n")) YES Error in ifelse(all(l %in% c(1, 10, 100) == TRUE), cat("YES\n"), cat("NO\n")) : replacement has length zero I have the correct answer, YES, but with
2012 Feb 27
1
compare two data frames with same columns names but of different dimensions
Dear List, I want to compare and return the rows which are NOT in the two data frames. Classic methods don't work as the df have NOT the same dimensions. Here are one example of my df: reported <- structure(list(Product = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 3L, 4L, 5L, 5L), .Label = c("Cocoa", "Coffee C", "GC", "Sugar No 11", "ZS"),
2012 Feb 24
1
data frame manipulation with conditions
Dear list, n00b question, but still can't find any easy answer. Here is a df: > df<-data.frame(cbind(x=c("AA","BB","CC","AA"),y=1:4)) > df x y 1 AA 1 2 BB 2 3 CC 3 4 AA 4 I want to modify this df this way : if df$x=="AA" then df$y=df$y*10 if df$x=="BB" then df$y=df$y*25 and so on with other conditions. TY for any
2012 Feb 27
2
compare two data frames of different dimensions and only keep unique rows
Dear list, I am still struggling with something that should be easy: I compare two data frames with a lot of common rows and want to keep only rows that are NOT in both data frames, unique. Here are an example of these data frame. reported <- structure(list(Product = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 3L, 4L, 5L, 5L), .Label = c("Cocoa", "Coffee C", "GC",
2012 Feb 27
1
Ubuntu jaunty - R can't be install
Dear helpers, I would like to install R on a computer with Ubuntu Jaunty. Unfortunately, Jaunty does not appear in any CRAN mirror website I have tried (France, Canada, Italy, Germany). Could you give me any mirror website allowing installation on Jaunty?or could you give me a procedure to passby this problem? Thanks for your help, Best regards, Marine Veyssi?re
2012 Feb 24
3
install rJava in Ubuntu 11.10
I am trying to install rJava on a WUBI Ubuntu 11.10 installation of R with no luck. I was originally trying to install the iplots package and encountered this rJava problem. Code used: install.packages("rJava") (CRAN mirrors --Canada(ON) and Canada(QC2) I installed iplots with no problem on Windows 7. I know just about zero about Ubuntu or Linux in general so I have no idea what I
2010 Apr 30
3
short question about data frame manipulation
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.names = c(NA, -3L), class =
2010 May 26
1
data frame manipulation change elements meeting criteria
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,
2010 Jun 01
1
data frame manipulation ddply
Dear group, Here is my data frame: futures <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "LIVE CATTLE Aug/10", "LIVE CATTLE Aug/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11
2010 Jun 02
8
bind select data frames
Dear group, Here is my environment: > ls() [1] "DailyPL100419" "DailyPL100420" "DailyPL100421" "dd" "i" "l" "PLglobal" "Pos100416" "Pos100419" "Pos100420" "Pos100421" "position" [13] "result" "sel"
2010 May 26
5
(no subject)
Dear group, Here is my data frame: > dput(u) structure(list(DESCRIPTION = structure(c(2L, 5L, 6L, 7L, 9L, 11L, 12L, 15L, 14L, 16L, 1L, 10L, 3L, 4L, 13L, 8L, 17L), .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
2010 Jun 01
1
data frame manipulation with zero rows
Dear group, Here is the kind of data.frame I obtain every day with my function : futures <- structure(list(DESCRIPTION = c("CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "CORN Jul/10", "LIVE CATTLE Aug/10", "LIVE CATTLE Aug/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11 Jul/10", "SUGAR
2010 Apr 16
1
data frame manipulation
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 ",
2015 Aug 24
3
Build optimized R : openblas, MKL, ATLAS
On Mon, Aug 24, 2015 at 11:29 AM, Bj?rn-Helge Mevik <b.h.mevik at usit.uio.no> wrote: > arnaud gaboury <arnaud.gaboury at gmail.com> writes: > >> - Intel MKL: this is part of Intel Parallel Studio and is a paid >> software. Now, there is the MKL package distributed by >> Revolutionanalytics, but I am not certain how this can be distributed >> for free. Is
2010 Jun 02
3
which function
Dear group, Here is a list of elements : l <- c("100415", "100416", "100419", "100420", "100421", "100422", "100423", "100426", "100427", "100428", "100429", "100430", "100503", "100504", "100505", "100506", "100507",
2010 Apr 23
3
substract start from the end of the vector
Dear group, Here is my df : df <- structure(list(DESCRIPTION = c("PRM HGH GD ALUMINIUM USD 09/07/10 ", "PRM HGH GD ALUMINIUM USD 09/07/10 ", "PRIMARY NICKEL USD 04/06/10 " ), CREATED.DATE = structure(c(18361, 18361, 18325), class = "Date"), QUANITY = c(-1L, 1L, 1L), CLOSING.PRICE = c("2,415.90", "2,415.90",
2014 Aug 12
2
Re: issue when building/making package from git
On Tue, Aug 12, 2014 at 5:44 PM, Richard W.M. Jones <rjones@redhat.com> wrote: > > Please try my suggestions here: > > https://www.redhat.com/archives/libguestfs/2014-August/msg00099.html > :: Synchronizing package databases... core is up to date extra is up to date community 2.3 MiB 3.07M/s 00:01
2015 Dec 05
1
R_PROFILE_USER
On Sat, Dec 5, 2015, 9:39 PM peter dalgaard <pdalgd at gmail.com> wrote: > On 05 Dec 2015, at 18:07 , arnaud gaboury <arnaud.gaboury at gmail.com> wrote: > > In my shell environment, I have set a path to R_PROFILE_USER. The > file, Rprofile.R, is a collection of small hacks. > > I want to build rstudio-server from source. Best is to $ unset > R_PROFILE_USER
2015 Sep 02
4
Build R with MKL and ICC
After a few days of reading and headache, I finally gave a try at building R from source with Intel MKL and ICC. Documentation and posts on this topic are rather incomplete, sometime fantasist et do not give much explanations about configure options. As I am not sure if mine is correct, I would appreciate some advices and hints. OS: Fedora 22 parallel_studio_xe_2016 Hardware : 8 Thread(s) per