similar to: howto get the number of columns and column names of multiply data frames

Displaying 20 results from an estimated 300 matches similar to: "howto get the number of columns and column names of multiply data frames"

2013 Sep 05
2
binary symmetric matrix combination
Hi, May be this helps: m1<- as.matrix(read.table(text=" y1 g24 y1 0 1 g24 1 0 ",sep="",header=TRUE)) m2<-as.matrix(read.table(text="y1 c1 c2 l17 ?y1 0 1 1 1 ?c1 1 0 1 1 ?c2 1 1 0 1 ?l17 1 1 1 0",sep="",header=TRUE)) m3<- as.matrix(read.table(text="y1 h4??? s2???? s30 ?y1 0 1 1 1 ?h4 1 0 1 1 ?s2 1 1 0 1 ?s30 1 1 1
2004 Jun 25
3
String manipulation
Hi, let's see, if someone can help my with this one: I have the string as follows: > str<-("one","two","three") Now I want to concatenate the items to one string, seperateted by space or something else, >str >"one, two, three" If possible without a loop. My actual goal ist to create string like >str.names >"female = names1, male
2012 Jun 03
2
merging single column from different dataframe
Hi all, probably really simple to solve, but having no background in programming I haven't been able to figure this out: I have two dataframes like df1 <- data.frame(names1=c('aa','ab', 'ac', 'ad'), var1=c(1,5,7,12)) df2 <- data.frame(names2=c('aa', 'ab', 'ac', 'ad', 'ae'), var2=c(3,6,9,12,15)) Now I want merge
2011 Oct 27
2
help with paste
Hello gurus, I have some variables, and i am creating combinations for analysis in the end i need these variables to be displayed like "LEPTIN+SAA+PTH". currently i am using loop to perform this. I would appreciate any pointers to do it without the loop. > mols=c("LEPTIN","SAA","PTH","sEGFR") > samples=mols[1:3] > samples [1]
2011 Nov 08
2
match first consecutive list of capitalized words in string
Dear R-Helpers, this is my first post ever to a mailing list, so please feel free to point out any missunderstandings on my side regarding the conventions of this mailing list. My problem: Assuming the following character vector is given: names <- c("filia Maria", "vidua Joh Dirck Kleve (oo 02.02.1732)", "Bernardus Engelb Franciscus Linde j.u.Doktor referendarius
2009 Oct 30
2
Names of list members in a plot using sapply
Hi R users: I got this code to generate a graphic for each member of a lists. list1<-list(A=data.frame(x=c(1,2),y=c(5,6)),B=data.frame(x=c(8,9),y=c(12,6))) names1<-names(list1) sapply(1:length(list1),function(i) with(list1[[i]],plot(x,y,type="l",main=paste("Graphic of",names1[i])))) Is there a more elegant solution for not to use two separate lists? I would like to
2010 Jun 13
1
Boxplot intervals combining names
Hi R users, This seems like a simple problem but I have searched nabble for the answer and can't seem to find it. All I want to do is produce a boxplot where I have two boxes for one Individual but on the xaxis I only have one tick mark centred between the boxes so I can add the Individuals' name. I have 30 IDs and have shown the code I use below for a couple of IDs, I figure the data
2013 Feb 17
2
Loop
Hi all, I want to execute a loop of a program: for (u in Timeframemin:Timeframe){} Imagine that Timeframemin<-10 Timefram<-10000 Is it posible to execute the loop but only proving from 10 to 10000 but jumping 10 each time, for example, execute for 10,20,30.....to Timeframe. Other question is, when a program is "heavy" and has a lot of loops to execute (how can I know where
2016 Oct 10
8
Generate Register Indirect mode instruction
Hi All, I am new to llvm backend. I am trying out few examples to understand backend codegen. I have ported llvm LEG @ https://github.com/frasercrmck/llvm-leg to llvm 3.9 successfully. Currently, the LEG instructions are RISC load-store type instruction. I want to generate some instructions for register indirect mode, like following: IR: @a = local_unnamed_addr global i32 0, align 4 @b =
2008 Feb 21
3
applying a function to data frame columns
useR's, I want to apply this function to the columns of a data frame: u[u >= range(v)[1] & u <= range(v)[2]] where u is the n column data frame under consideration and v is a data frame of values with the same number of columns as u. For example, v1 <- c(1,2,3) v2 <- c(3,4,5) v3 <- c(2,3,4) v <- as.data.frame(cbind(v1,v2,v3)) uk1 <- seq(min(v1) - .5, max(v1) + .5,
2012 Aug 02
4
Subseting
Hi everyone I have banking data set in long format with 4 columns.One of these columns is bank name which consist of 49 banks and I want the data for only 40 banks out of these 49 so can anyone help me on how to get this 40 banks data My data looks like Year Name totalliabilties assets 1990 a 90 10 1991 a 89 48 1992 a 87
2006 Oct 03
1
Error in X11 (PR#9272)
Full_Name: Frank Sch?ffer Version: 2.3.1 OS: Ubuntu 6.10 (Edgy Eft) Submission from: (NULL) (86.56.0.173) frank at darwin:~$ R R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) ISBN 3-900051-07-0 R ist freie Software und kommt OHNE JEGLICHE GARANTIE. Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten. Tippen Sie 'license()'
2012 Dec 24
2
whats wrong in my codes???
Dear R family,i am trying to plot and save, simultaneously, about 1000. the name of each plot is contained in "names" file. when i run this loop, i get an error. "Error in plot.new() : Unable to open file 'C:/R/SAVEHERE/myplot_Tak.jpg' for writing". could you please correct the mistake in the loop? >names<-(names(sp)) >for(a in seq_along(names)){ >mypath
2009 Aug 06
1
problem with recording numeric output into another dataframe
dear all, I have two dataframes dataframe1 ID a b c dataframe2 ID value a;W 100 X;c 200 Y;Z 300 I wanted to match the IDs from the two dataframes and record the values into a new column of dataframe1 at the corresponding rows. This is what I expect: dataframe1 ID value a 100 b c 200 I tried doing it like this: for (i in seq(1:nrow(dataframe1))) {
2010 Feb 10
2
Subscripting
Dataframe1 contains a list of specific dates. Dataframe2 contains a large dataset, one element of which is Date. How do I create a subset of Dataframe2 that excludes the dates from Dataframe1? I know how to do it with a left outer join vs null in SQL, but I can't figure out how to do it more directly via the subcripts that already exist? Dateframe1 Date 1/1/2010 1/18/2010 Dataframe2 Date
2009 Sep 23
1
Best way to arrange data
Hello, I have the following data: gene Actual groups reps 1 1 213 1 2 2 2 123 2 3 3 3 2 1 2 4 4 12 2 3 5 1 0 1 1 6 2 34 2 2 7 3 123 1 1 8 4 12 2 2 I want to find the best way to
2008 Oct 22
3
Substitute problem
hello R users, I didn't find a solution for a special problem. I have two dataframes. dataframe1: X value row col ID 1 8.973498062 5512625 3460000 1 2 11.656658570 5501625 3464000 2 3 11.121777570 5495625 3473000 3 4 9.310465964 5508625 3477000 4 5 8.883483845 5515625 3496000 5 dataframe2: X value
2014 Jan 03
2
create mask for specific files
Is it possible to set a create mask and/or a force create mode with exceptions for specified file extensions? E.g. I want shell scripts (*.sh) with the executable bit set, but other files should not be executable. AFAIK, this is currently not possible, but maybe I'm wrong. Regards, Evert
2011 Aug 22
2
Extracting columns with specific string in their names
Hi, Let's say that I have a set of column names that begin with the string "Xyz". How do I extract these specific columns? I tried to do the following: dataframe1[,grep("Xyz",colnames(dataframe1))] But it does not work. What is wrong with my expression?
2011 Jun 14
1
[Resolved] combine the data frames into comma separated list.
Hi Thanks Gabor for your suggestion. I am posting the code that worked for me. dataframe1 = data.frame(cbind(Src = c(1,1,1,2,3), Target1 = c('aaa','bbb','ccc','aaa','ddd'))); #must be data frame dataframe2 = data.frame(cbind(Src = c(2,3,4,4,4), Target2 = c('aaaa','dddd','bbbb','eeee','ffff'))); dataframe3 =