similar to: Referencing a column using a function argument

Displaying 20 results from an estimated 1000 matches similar to: "Referencing a column using a function argument"

2006 Jul 02
4
is "label for" better?
I''ve noticed that it is common practise in forms to use: <label for="tablename","columnname"> ...Some column name</label> Why is the above construct better than just writting it this way? <label> Some column name</label> If there is not compelling reason, I''d prefer to use the second example and save on typing. -- Best Regards,
2007 Mar 01
2
Query about data manipulation
Hi Thanks much for the prompt response to my earlier enquiry on packages for regression analyses. Along the same topic(?), I have another question about which I could use some input. I am retreiving data from a MySQL database using RODBC. The table has many BLOB columns and each BLOB column has data in the format "id1 \t id2 \t measure \n id3 \t id4 \t measure...." (i.e. multiple rows
2004 Nov 02
2
A little more on R, mdbtools and Access databases
Hi again, I have played a little more with mdbtools and R. I downloaded the latest version of mdbtools from sourceforge (version 0.6pre1). Quickly scanning the mailing list suggests that ODBC seems to work with PHP but I have not been able to get it to work with R. I can make a connection to the database and when I do a query I get back the names of the rows but not the data. I must admit I have
2007 Apr 22
1
names( d$columnname )
dear R wizards --- would it make sense for names(d$columnname) to be "columnname"? I can preserve the columnname through x=subset(dataset, select="columnname"), of course, but it would seem that x=d$columnname could also do this. No? Sincerely, /iaw
2006 Apr 07
2
MSSQL activerecord uses bad syntax
Hi all, I''m trying to get rails up on mssql for a friend, does anyone have experience? We''re working on a Windows XP box with MSSQL 2000 (no service pak), and both rails (1.1) and MSSQL are on the same box. I''m running into a bug (I think) where activerecord is using this syntax: SELECT TOP 1 * FROM users WHERE (users.user = ''jbgnuumnbu'')
2009 Jun 25
2
variable driven summary of one column
Hello, how can I get a variable driven summary of one column of my data.frame? Usually I would do > summary(data$columnname) to get a summary of column named "columnname" of my data.frame named "data". In my case the columnname is not static but can be set dynamically. So I save the chosen columname in something like variable <- "columnname" but how can I
2012 Jan 13
2
question: how to select a column from a dataframe in a function
Hi, I am creating a function and ran into the problem of selecting a column from a dataset. It seems as though the $ function (as in data$columnname) does not apply in the function. In simplified version: This works: testf2<-function(data,columnnumber){print(data[,columnnumber])} But this doesn't: testf<-function(data,column){print(data$column)} Even though the first solution works,
2010 Jul 26
4
using string variable as order() function argument
Hello, In my script I would like to use 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: **
2006 Jul 03
1
difficult data manipulation question
hi everyone : suppose i have a matrix in which some column names are identical so, for example, TEMP "AAA", "BBB", "CCC", "DDD","AAA", "BBB" 0 2 1 2 0 0 2 3 7 6 0 1 1.5 4 9 9 6 0 1.0 6 10 11 3 3 I didn't even check yet
2012 Aug 07
2
What is this called? lapply(datum,"[[","ColumnName")
Hello R users I recently learned how to use this command: lapply(datum,"[[","ColumnName") Unfortunately, I don't know how exactly it works, what it's called (in particular the "[[" part], and what other things you can do with it (retrieve multiple columns?). Given datum is a list of dataframes with the same column, but different number of rows,
2000 Mar 08
2
possible BUG with as.data.frame() and/or [.data.frame
Here is a possible BUG with as.data.frame() and/or [.data.frame which broke Michael Lapsleys RODBC-Code. Can anyone confirm it is a bug or a 'feature' of the prototype? tablename <- "abc" a <- as.data.frame(cbind("abc", 1:3)) b <- as.data.frame(cbind(tablename, 1:3)) # ok > a V1 V2 1 abc 1 2 abc 2 3 abc 3 # missing column name > b tablename 1
2012 Jun 18
4
Problem with exists? method
Hi, I have a DB with table TABLENAME, column COLUMN and an active resource client trying to connect to the DB. When i do Tablename.find(:all) => i get all the entries from the table But Tablename.exists?(:column => value) always returns false I verified that the above command works from rails console. Dont understand why it always returns false even when there are valid records. And in
2007 Mar 23
6
Updating a worksheet in Excel file using RODBC
Hello! I have no problem reading Excel files (each worksheet in the file is a "table" which can be read - at least in my case). What I would like to do is to read such a table, change it (just the contents, not the format) and write it back, and this I can not do. I am getting the following error messages (3 slightly different attempts): > sqlSave(con, x, tablename =
2007 Jun 26
2
MySQL Where conditions automatic formatting
Hi, I''m having a problem with the automatic formatting of my mysql query. My code is this: Tablename.find(:all, :conditions => {:id => list}) Where list is a list of id''s (8,9,10) The problem is that the query is automatically formatted to this: SELECT * FROM Tablename WHERE (id in (''8,7,9'')) I need this query to run without the extra single quotes
2011 Dec 02
2
order function give back row name
Hello, I have a matrix results with dimension 1x9 double matrix XLB XLE XLF XLI 1 53.3089 55.77923 37.64458 83.08646 I'm trying to order this matrix > print(order(results)) [1] 3 1 2 4 how can the function order return the columnname XLF XLB XLE XLI instead of 3 1 2 4 any idea ? Thank you in advance --
2006 Mar 22
2
has_many, belongs_to
I have one table(profiles) where each row has many rows in another table(carriers). If I write profile.carriers I get a collection containing all carriers that belong to the current profile. My question is: how do I sort the collection profile.carriers? I would like to sort it on one of the columns (found in the table carriers). Can I override some method in the carrier model or somewhere
2018 Jan 24
1
Help with SQLsave
Hi all, I'm using RODBC library to connect to a database. I'm trying to read a table from a database and after manipulating it would like to write to the same database but with a different table P<-data.frame(sqlQuery(myconn,'select? *? from Demographics')) sqlSave(myconn,p,tablename="trial",rownames=FALSE) I'm gettng this error Version:1.0
2012 Apr 05
3
help in paste command
i have a character variable tablename="DressMaterials" var1=("red","blue","green","white") My output should be like select * from DressMaterialswhere colors in ("red","blue","green","white") i'm not able to get the where part. my code paste(select * from ", tablename , " where colors in
2004 May 10
3
sqlSave with underscores in table fieldname
Hi group, I try to write a frame to a table (RODBC). I use colnames(temp6) <- c("ind_id","ser_id","period_id","year","calc","mean") sqlSave(channel, temp6, tablename = "series_indices_test",append= TRUE, rownames=FALSE, verbose = FALSE, test = FALSE, nastring = -999999, fast = FALSE) This is giving me an error: Error in
2008 Oct 21
6
detecting width overflow in serialized column with mysql
So I''ve got an ActiveRecord model pointing to a MySQL db, with an auto-serialized column ("serialize :columnName"). Thing is, MySQL, depending on how it''s configured (like, by default), has a bad habit of just truncating your data if it''s too wide for the column, with no error raised. Yeah, I can probably reconfigure MySQL and/or my AR connection to it. But