search for: column3

Displaying 20 results from an estimated 25 matches for "column3".

Did you mean: column
2010 Jul 26
4
using string variable as order() function argument
...a loop, which sorts the dataframe according to different columns, pointed by the string variable. id col1 col2 col3 1 10 0 4 8 2 11 1 2 2 3 12 0 8 3 4 13 0 5 5 Usually the order() function can be used like this: sorted = mytable**[order(column3) , ] which results in properly sorted table: ** id col1 col2 col3 2 11 1 2 2 3 12 0 8 3 4 13 0 5 5 1 10 0 4 8 **But when trying to use a string variable instead of "column3" name: columnname = "column3" **sorted = my...
2008 Feb 26
1
Split data.frames depeding values of a column
Hello to all is there a function wich splits a data.frame (column1,column2,column3,....) into data1 <-(column1,column3....) #column2 = 1 data2 <-(column1,column3....) #column2 = 2 data3 <-(column1,column3....) #column2 = 3 ... Regards Knut
2009 May 14
2
Function to read a string as the variables as opposed to taking the string name as the variable
I am writing a custom function that uses an R-function from the reshape package: cast. However, my question could be applicable to any R function. Normally one writes the arguments directly into a function, e.g.: result=cast(table1, column1 + column2 + column3 ~ column4, mean) (1) I need to be able to write this statement as follows: result=cast(table1, string_with_columns ~ column4, mean) (2) string_with_columns = group of functions that ultimately outputs: "column1 + column2 + column3" Statement 1 outputs the correct...
2010 Feb 27
1
New Variable from Several Existing Variables
...;, however if any one of the three existing variables is a "No", then then new variable should be a "No". I would then use that new variable as an exclusion for data in a new or existing dataset (i.e., if NewVariable = "No" then delete): Take this: Column1, Column2, Column3 Yes, Yes, Yes Yes, No, Yes No, No, No No, Yes, No Yes, Yes, No Generate this: Column1, Column2, Column3, NewVariable1 Yes, Yes, Yes, Yes Yes, No, Yes, No No, No, No, No No, Yes, No, No Yes, Yes, No, No And end up with this: Column1, Column2, Column3, NewVariable1 Yes, Yes, Yes, Yes Any suggestio...
2013 Mar 21
2
Displaying median value over the horizontal(median)line in the boxplot
...o be displayed as 7.6. Thank you so much for your help. I am very sorry for troubling you but I am very very new to this programming and to R as you can see. <quote author='arun kirshna'> Hi, Lines1<-readLines(textConnection("Column1 -1,2,3,4,5,6,6,7 COlumn2- 3,4,5,6,7,8,8 Column3-- 45,66,7,8,89, COlumn4-5,6,7,7,8,9 Column5 -5,6,7,8,8")) vec1<-unlist(strsplit(Lines1,"-")) dat1<-as.data.frame(t(read.table(text=vec1[grepl(",",vec1)],sep=",",fill=TRUE))) row.names(dat1)<-NULL colnames(dat1)<-tolower(gsub(" $","&quo...
2004 Oct 25
2
Reading sections of data files based on pattern matching
...to analyze plot etc. Since this will be used many people at the department I wanted to make sure that will do this in the best way. For instance I want to read a snippets of data from a text that look like this. ------------------------------- Lots of stuff ... @@Start Values@@ Column1 Column2 Column3 ... Row1 1 2 3 ... ... @@End Values@@ More stuff ... @@Start OtherValues@@ Column1 Column2 Column3 ... Row1 1 2 3 ... ... @@End OtherValues@@ I looked in the help files and found grep which operates on character strings, do I have to like this then? 1. Read file with readLines("foo.txt&q...
2006 Apr 06
1
reshape question
Hi, I have a data fram like this: date column1 column2 column3 value1 value2 value3 1-1 A B C 10 5 2 2-1 A B D 5 2 0 3-1 A B E 17 10 7 How can I reshape it to: date column1 column2 column3 v x 1-1 A B C value1 10 1-1 A B C value2 5 1-1 A B C value3 2 2-1 A B D value1 5 2-1 A B D value2 2 2-1 A B D value3 0 3-1 A B E value1 17 3-1 A B E value2 10 3-1 A B E va...
2010 May 15
1
conditional calculations per row (loop versus apply)
...ying formulas to a dataframe. In essence I have 3 lookup tables (Table A, B & C) and a dataframe with a variable Type.Code, which identifies the Lookup Table to which each record belongs. The lookup tables reference different sensor types for which I need apply a different formula to values in Column3 in each row to calculate a value for Column 4. I have no problem writing a for loop to handle this, but with over 1M rows in the df this is very slow. Is there a way to solve this using a function such as sapply or would I be better off just subsetting and applying each function separately on the...
2010 Feb 09
3
split strings in a vector and convert it to a data.frame
hi, I have a vector full of strings like; xy_100_ab xy_101_ab xy_102_ab xy_103_ab I want to seperate each string in three pieces and the separator should be the "_" at the end I want a data.frame like: column1 column2 column3 xy 100 ab xy 101 ab xy 102 ab xy 103 ab I tried strsplit but I couldn't figure out how to convert the list I get into a data.frame. I just need a function like read.table. But it seems that read.table only can handle files, not vectors...
2012 Jun 12
4
How to index a matrix with different row-number for each column?
here's my question: suppose I have a matrix: mt<-matrix(1:12,ncol=6) now I have a vector vt<-c(1,2,2,2,1,2) which means I want to get: the 1st row for column1; the 2nd row for column2; the 2nd row for column3; the 2nd row for column4; ... that what I want is this vector: 1,4,6,8,9,12 Does anyone know how to do this fast? I know I can use for-loop to travel all columns,but that's not what I want.
2012 Mar 16
5
How to Group Categorical data in R?
...K Z U Z M E V Z R Z U Z M E V P R I need to present my result in the following way. Colum3 C A B D X T K Column3 Z Z U M E V R Z U M Column3 P E V R How can i implement it? Thanks -- View this message in context: http://r.789695.n4.nabble.com/How-to-Group-Categorical-data-in-R-tp4477622p4477622.htm...
2006 Apr 20
0
parsing arguments of a function
Hi, I have a simple problem writing a function that is to be called like Myfunction( Column1 = low, Column2 = high, Column3 = all, Column4 = all, data = mydata) {. contourplot(z ~ mydata$Column3* mydata$Column3) . } Where Column1 and Column1 are the names of the dataframe mydata. How do I parse the arguments to obtain both, name and value of the argument. I tried strsplit(Column1, "=") which gives me two str...
2009 Jul 07
2
How to separate the string?
Hi everyone, Hi want to separate the string(column1) for example column1 column2 column3 column4 column5 column6 bear b e a r cat c a t tiger t i g e r I know how to do this in excel where using MID function. Now I want to solve it using R. The list of stri...
2008 Feb 29
1
can the matrix size limit be increased?
...: C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] rcompgen_0.1-17 So I seem to be hitting a limit on matrix size. First I read in my data into a list and it's OK: > mz <- scan("data.column3.txt", list(0)) Read 158991 records >mz > mz [[1]] [1] 0.000000e+00 0.000000e+00 1.003393e+01 3.651888e+00 0.000000e +00 [6] 0.000000e+00 3.067042e+00 1.277249e+00 1.984366e+00 3.644203e +01 [11] 1.172925e+02 1.933753e+02 2.020940e+02 1.570501e+02 8.990829e +01 ... But...
2009 Aug 03
2
Some SQL Challenges
...t of jobs using SQL Querries and some "if else" commands but im stucked in some steps. Could any of you give me some help? -in COLUMN1 change the format 20JAN2000:00:00:00 to 20JAN2000 and exclude every row that date is different from 20. -extract the first character in COLUMN2 and creat COLUMN3 with that value ex: COL2,COL3 135,1 461,4 247,2 -in every row in which COL3=5, value in COLUMN4=value in COLUMN5 -create COLUMN7 where if COLUMN6="north" then COLUMN7 value="N" else COLUMN7 value="X" Ill be grateful for any help, thnks -- View this message in context...
2006 May 09
9
Active Record HELP!!!!!
Hello, Can someone kindly tell what the heck creating a relationship does in active record? I understand the idea of joining the tables and such. But how do I use it? Is it available in a scaffold? How about when I want to view a record and want to see all the joined data from the other table? Do I have to manually code the data I want from the other table? Does this automatically make the
2008 Apr 04
0
Can''t get backgroundrb to work with rails plugin ''batched_sql_fu''
.../Users/jdonalds/Sites/3dial_ads/vendor/plugins/backgroundrb/ server/lib/master_worker.rb:166:in `initialize'' from script/backgroundrb:60:in `new'' from script/backgroundrb:60 ---SNIP-- The code in the worker works as expected when called directly.... Jonathan Donaldson: CTO at Column3, SMB VoIP Communications ASP contact | jonathan at column3.net - 617-507-6707 | yahoo - jonathan.donaldson -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080403/7b5c5153/attachment.html
2012 May 28
6
importing multiple file form folder
...Length (m) going up to 2000 ... Anyway...i just need the data from first two columns (length (m) and Temperature (C)), and no data before that... This Lenght (m) values are always the same. My final dataset should lokk like this : column 1 as Length(m) ; column 2 as Temperature from first file ; column3 as temperature from second file...and so on... I know how to import this manualy, but can seem to find a way to automate it...the problem is that the amout of files will be growing for quite quite some time, so automation is necessary. Any help is greatly apreciated. m -- View this message in co...
2009 Mar 13
1
Realtime dialplan application versus REALTIME dialplan function
...EXTEN}|cf_) exten => 326,n,GotoIf($["${cf_active}" = "yes" ]?:326|20) exten => 326,n,Goto(cfaccess,${cf_cfnum},1) Here is the 1.4 dialplan to accomplish the same thing: exten => 326,1,Set(row="${REALTIME(cfwd,exten,${EXTEN})}") exten => 326,n,Set(column3=${CUT(row,"|",3)}) exten => 326,n,Set(column4=${CUT(row,"|",4)}) exten => 326,n,Set(cf_cfnum=${CUT(column3,"=",2)}) exten => 326,n,Set(cf_active=${CUT(column4,"=",2)}) exten => 326,n,GotoIf($["${cf_active}" = "no" ]?:326|20...
2007 Oct 19
1
(no subject)
# Hello # I have a question regarding pairwise calculations of a matrix using a "for-loop." # Below I have a matrix "X" with 8 columns. These are Genotypic data so Column1 & Column2 is # a unit, Column3 & Column4 is a unit, Column5 & Column6 is a unit, and Coulmn7 & 8 is a unit. # I have a loop designed to calculate the number of times an individual in Column"i" & Column"j" # has the same value and the same individual has two values that are the same in Column&...