similar to: Concatenation

Displaying 20 results from an estimated 600 matches similar to: "Concatenation"

2012 Oct 12
3
Columns and rows
Hi, Could you please advice some easy way to do the following for a dataframe (header=F) having unequal column- & row- length. 1. Combine/stack/join contents from - a) multiple rows into one column. b) multiple columns into one row. 2. Stack contents from multiple columns (or, rows) into one column (or, row). Thank you. Cheers, Santana [[alternative HTML
2024 Nov 27
7
R Processing dataframe by group - equivalent to SAS by group processing with a first. and retain statments
I am an old, long time SAS programmer. I need to produce R code that processes a dataframe in a manner that is equivalent to that produced by using a by statement in SAS and an if first.day statement and a retain statement: I want to take data (olddata) that looks like this ID Day 1 1 1 1 1 2 1 2 1 3 1 3 1 4 1 4 1 5 1 5 2 5 2 5 2 5 2 6 2 6 2 6 3 10 3 10 and make it look like this: (withing each
2024 Dec 01
6
Identify first row of each ID within a data frame, create a variable first =1 for the first row and first=0 of all other rows
Dear R help folks, First my apologizes for sending several related questions to the list server. I am trying to learn how to manipulate data in R . . . and am having difficulty getting my program to work. I greatly appreciate the help and support list member give! I am trying to write a program that will run through a data frame organized by ID and for the first line of each new group of data
2024 Dec 01
2
Identify first row of each ID within a data frame, create a variable first =1 for the first row and first=0 of all other rows
Rui: "f these two, diff is faster. But of all the solutions posted so far, Ben Bolker's is the fastest." But the explicit version of diff is still considerably faster: > D <- c(rep(1,10),rep(2,6),rep(3,2)) > microbenchmark(c(1L,diff(D)), times = 1000L) Unit: microseconds expr min lq mean median uq max neval c(1L, diff(D)) 3.075 3.198 3.34396
2024 Nov 27
1
R Processing dataframe by group - equivalent to SAS by group processing with a first. and retain statments
On 11/27/24 08:30, Sorkin, John wrote: > I am an old, long time SAS programmer. I need to produce R code that processes a dataframe in a manner that is equivalent to that produced by using a by statement in SAS and an if first.day statement and a retain statement: > > I want to take data (olddata) that looks like this > ID Day > 1 1 > 1 1 > 1 2 > 1 2 > 1 3 > 1 3 >
2024 Nov 27
4
R Processing dataframe by group - equivalent to SAS by group processing with a first. and retain statments
Check out the dplyr package, specifically the mutate function. # Create new column based on existing column value df <- df %>% mutate(FirstDay = if(ID = 2, 5)) df Repeat as needed to capture all of the day/firstday combinations you want to account for. Like everything else in R, there are probably at least a dozen other ways to do this, between base R and all of the library packages
2012 Apr 29
1
CForest Error Logical Subscript Too Long
Hi, This is my code (my data is attached): library(languageR) library(rms) library(party) OLDDATA <- read.csv("/Users/Abigail/Documents/OldData250412.csv") OLDDATA$YD <- factor(OLDDATA$YD, label=c("Yes", "No"))? OLDDATA$ND <- factor(OLDDATA$ND, label=c("Yes", "No"))? attach(OLDDATA) defaults <- cbind(YD, ND) set.seed(47) data.controls
2024 Nov 27
1
R Processing dataframe by group - equivalent to SAS by group processing with a first. and retain statments
?s 16:30 de 27/11/2024, Sorkin, John escreveu: > I am an old, long time SAS programmer. I need to produce R code that processes a dataframe in a manner that is equivalent to that produced by using a by statement in SAS and an if first.day statement and a retain statement: > > I want to take data (olddata) that looks like this > ID Day > 1 1 > 1 1 > 1 2 > 1 2 > 1 3 >
2024 Nov 27
1
R Processing dataframe by group - equivalent to SAS by group processing with a first. and retain statments
Was wondering when this would be suggested. But the question was about getting the final dataframe... newdta <- olddta newdta$FirstDay <- ave(newdata$date, newdata$ID, FUN = \(x) x[1L]) On November 27, 2024 11:13:49 AM PST, Rui Barradas <ruipbarradas at sapo.pt> wrote: >?s 16:30 de 27/11/2024, Sorkin, John escreveu: >> I am an old, long time SAS programmer. I need to
2012 Mar 26
1
assigning vector or matrix sparsely (for use with mclapply)
Dear R wizards--- I have a wrapper on mclapply() that makes it a little easier for me to do multiprocessing. (Posting this may make life easier for other googlers.) I pass a data frame, a vector that tells me what rows should be recomputed, and the function; and I get back a vector or matrix of answers. d <- data.frame( id=1:6, val=11:16 ) loc <- c(TRUE,TRUE,FALSE,TRUE,FALSE,TRUE)
2017 Jun 09
2
Extremely slow du
Hi I have just moved our 400 TB HPC storage from lustre to gluster. It is part of a research institute and users have very small files to big files ( few KB to 20GB) . Our setup consists of 5 servers, each with 96TB RAID 6 disks. All servers are connected through 10G ethernet but not all clients. Gluster volumes are distributed without any replication. There are approximately 80 million files in
2017 Jun 09
2
Extremely slow du
Hi Vijay Thanks for your quick response. I am using gluster 3.8.11 on Centos 7 servers glusterfs-3.8.11-1.el7.x86_64 clients are centos 6 but I tested with a centos 7 client as well and results didn't change gluster volume info Volume Name: atlasglust Type: Distribute Volume ID: fbf0ebb8-deab-4388-9d8a-f722618a624b Status: Started Snapshot Count: 0 Number of Bricks: 5 Transport-type: tcp
2017 Jun 12
2
Extremely slow du
Hi Vijay I have enabled client profiling and used this script https://github.com/bengland2/gluster-profile-analysis/blob/master/gvp-client.sh to extract data. I am attaching output files. I don't have any reference data to compare with my output. Hopefully you can make some sense out of it. On Sat, Jun 10, 2017 at 10:47 AM, Vijay Bellur <vbellur at redhat.com> wrote: > Would it be
2017 Jun 09
0
Extremely slow du
Can you please provide more details about your volume configuration and the version of gluster that you are using? Regards, Vijay On Fri, Jun 9, 2017 at 5:35 PM, mohammad kashif <kashif.alig at gmail.com> wrote: > Hi > > I have just moved our 400 TB HPC storage from lustre to gluster. It is > part of a research institute and users have very small files to big files > ( few
2009 Feb 22
1
split/decompose lines
Dear R users, I have a very simple problem but I can't find the function in R to deal with it. I need to split (or decompose) one line into many lines using one field as a reference. I have a table with the following format: A B Frequency 23 3 2 24 2 5 25 1 3 And need to split each line into several lines according to the frequency to achieve something like this: A B
2001 Dec 07
2
question
Isn't anything in a data frame that is not explicitly numeric a *factor*? -Greg > -----Original Message----- > From: Peter Dalgaard BSA [mailto:p.dalgaard@biostat.ku.dk] > Sent: Friday, December 07, 2001 5:32 PM > To: Erich Neuwirth > Cc: r-devel@stat.math.ethz.ch > Subject: Re: [Rd] question > > > Erich Neuwirth
2014 Aug 13
1
adjust SOA record
Hi, We have outdated SOA information in our samba DNS. We used to have a DC1, and it is no more, however it's listed in our SOA records on both remaining DC's. I think this is not correct. I am under the impression that in order to get full failover support, all DC's need to have listed themselves as SOA. This is also what google tells me:
2010 Mar 08
1
confused by classes and methods.
Hello, I have a simple class that looks like: setClass("statisticInfo", representation( max = "numeric", min = "numeric", beg = "numeric", current = "numeric", avg = "numeric", obs = "vector"
2017 Jun 10
0
Extremely slow du
Would it be possible for you to turn on client profiling and then run du? Instructions for turning on client profiling can be found at [1]. Providing the client profile information can help us figure out where the latency could be stemming from. Regards, Vijay [1] https://gluster.readthedocs.io/en/latest/Administrator%20Guide/Performance%20Testing/#client-side-profiling On Fri, Jun 9, 2017 at
2017 Jun 16
0
Extremely slow du
Hi Vijay Did you manage to look into the gluster profile logs ? Thanks Kashif On Mon, Jun 12, 2017 at 11:40 AM, mohammad kashif <kashif.alig at gmail.com> wrote: > Hi Vijay > > I have enabled client profiling and used this script > https://github.com/bengland2/gluster-profile-analysis/blob/ > master/gvp-client.sh to extract data. I am attaching output files. I >