search for: dataframename

Displaying 13 results from an estimated 13 matches for "dataframename".

2012 Jun 22
3
dropping variables from a data frame inside a function
Why doesn't this work? #Drop a variable name from a data frame DropLikeSAS <- function(x,df) { df[[x]] <- NULL 0 } DropLikeSAS("VarName", DataFrameName) Try it. The column VarName will not be deleted from the data frame DataFrameName. But x <- "VarName" DataFrameName[[x]] <- NULL Works. [[alternative HTML version deleted]]
2005 Nov 09
2
Sort a dataframe
Dear All, How can I sort a data frame (using one of the column)? Thanks for your support. Regards. Abd. Rahman Kassim (PhD) Head Forest Ecology Branch Forest Management & Ecology Program Forestry and Conservation Division Forest Research Institute Malaysia Kepong 52109 Selangor, Malaysia ***************************************** Checked by TrendMicro Interscan Messaging Security. For any
2012 Nov 01
4
Loop over several variables
Hey everybody, I am looking for a way to loop commands over several variables in a dataframe. Basically I want to do something like this: ti1<-aggregate(dataframename$y1, by=data.frame(dataframename$aggregationvar), sum,na.rm=TRUE) This works fine as it is but i want to do it for several variables thereby generating several tix. I tried with a for-loop but the problem was that I could neither find a way combine my indexnumber i (1...
2016 Apr 23
2
Data Frame Column Name Attribute
...column to a data frame. Basically, adding a column called "newcol2" which are the stock closing prices from 1 day to the next. The one little hang up is the name of the column. There seems to be an additional data column name included in the attributes (dimnames?). So when i run HEAD(DATAFRAMENAME) i get the column name = "Open". but you can see below... it is called "newcol2 with some attribute called open. I did a lot of google searches but really could not find what i was looking for. Any help is greatly appreciated. Thank you! tdata[["newcol2"]] <- rbind...
2007 Sep 11
1
storing text and decimal values in a matrix form
...d a matrix of the necessary size (x row per y cols) with the command matrixname <- matrix(0,x,y) and proceeded to fill in the matrix with information drawn from a data frame. The problem is that the resulting matrix only has integers at the end of the filling process. When I ask: class(dataframename[i,j]) The answer is "factor" What is the best way of solving the problem. Should I use a data structure other than a matrix? Or should I make the elements be a different class (other than "factor") when I assign them to the matrix? Thanks for any help! G. [[alterna...
2008 Dec 10
2
converting multiple columns from POSIX* to Date
converting a POSIX class variable to a date class is easy. dates<-as.Date(x) #where X is of class POSIX How does one do that to all columns in a data frame that are of POSIX class and leave all the other columns (integers, factors) as is. Feel free to reply with just one or two buzzwords that I could then search for to find how to do it. Farrel Buchinsky
2007 Sep 11
0
Odp: storing text and decimal values in a matrix form
...with the command > > matrixname <- matrix(0,x,y) > > and proceeded to fill in the matrix with information drawn from a > data frame. > > The problem is that the resulting matrix only has integers at the end > of the filling process. > > When I ask: > class(dataframename[i,j]) > The answer is "factor" > > What is the best way of solving the problem. Should I use a data > structure other than a matrix? Or should I make the elements be a > different class (other than "factor") when I assign them to the matrix? > > Thanks f...
2010 May 12
2
sorting rows of dataframe
Hello: I have a dataframe, where the first column in a month: Month CATCHMENT_ med min max 1 Apr Alknda01 71.68080 11.9406600 196.2753 2 Apr Alknda02 69.44580 12.1065600 196.2753 3 Apr ArialKhan 39.89310 5.8598700 175.4433 4 Apr Arjun01 4.79652 0.0093336 55.7136 5 Apr Arjun02 4.79652 0.0093336 55.7136 6 Apr Arun01 52.42320 0.1571928
2005 Mar 15
0
Fwd: RODBC, sqlSave and sqlAppend
...gt; works extremely well with , most of the problems are due to the ODBC > mechanism only. > > Please find herewith some of the stupid things that I have learned in > the hard way. > > 1. In creating a dataframe, avoid variable such as 'variablename[n]' > or 'dataframename$component'. Using them collapse everything. > > 2. Dont create table description from SQL and pgAdmin or the like, > let R/RODBC create it thru sqlSave, using first 'append=FALSE' and > 'safer=FALSE' options > > 3. In pgAdmin, adjust cautiously the data t...
2006 Oct 21
2
object(s) are masked from package - what does it mean?
Hi, Sometime when I attach a dataset, R gives me the following message/warning:"The following object(s) are masked from package:datasets: column_name". Does anyone know what it means? Since it seems that the dataset was attached and I could manipulate the data from the dataset without problems, I am wondering what was R trying to tell me. Thanks, Tom [[alternative HTML version
2012 Jul 26
2
Passing arguments to SQL Query in R
Hello all, I am a newbie at R, with some experience in PERL. I have a database table that contains the following data: Name | Score ======= | ===== Sachin T | 25 Sachin T | 53 Sachin T | 57 Sachin T | 34 Rahul D | 38 Rahul D | 31 Rahul D | 53 Ricky P | 7 Ricky P | 45 Ricky P | 27 Ricky P | 17 Ricky P | 86 Ricky P | 48 Jacques K | 23 Jacques K | 86 Jacques K | 32 I
2009 Nov 05
4
collumn error when exporting to Excel
Dear all, I am attempting to export my results (data.frame) created with the help of a number of you to Excel. In the procedure my column structure is however lost and all results are placed together into the first Excel column. I have tried: write(), write.table(), write.matrix(), export() and have the same results. I Have checked the import/export FAQ and did a Google search to no avail. Any
2012 May 12
5
Help with writing data to csv
I am trying to write data to csv but I am having issues with the separations. Basically I have some results that I get with R that I copied and pasted into word and then saved as .txt I want to write the results to csv because it's easier to make tables in word (all I would have to do is copy and paste into a table, instead of typing everything out). I am able to write the data to the