Displaying 20 results from an estimated 9000 matches similar to: "Extracting the name of an object"
2009 Jun 12
3
Referencing data frames
Hi,
How do I use the string content of a string variable to reference a data frame of the same name? I want to do the typical tasks of 1) building a name with a string variable and using the string variable to create a data frame (or any object) whose name is the string value of the variable and 2) pass on a string to a function as a parameter, and then use that string to refer to an existing
2009 Sep 02
5
pruning data
Hello everyone,
I am trying to prune a data frame for partial least squares analysis.
I need to delete an entire row if one cell in the row contains a NA.
Presently, I am running a loop that is supposed to extract the rows
that are full of numbers into a second data frame and skips the rows
that contain a single NA value.
I want to know if there is a simple way to determine if a row
2009 Jun 11
3
Matrix manipulation
Hello everyone,
I have a couple of fairly simple questions (I hope) the answers to which I cannot find through the documentation at the moment.
1. I would like to delete the a row from a matrix if a certain elimination criterion is met. I am familiar with x <- x[-7,] (to remove row 7, for example). Are there any other means of removing an entire row?
2. Is there a single command that
2009 Aug 28
2
Pls package
Hi,
I have managed to format my data into a single datframe consisting of two AsIs response and predictor dataframes in order to supply the plsr command of the pls package for principal components analysis.
When I execute the command, however, I get this error:
> fiber1 <- plsr(respmat ~ predmat, ncomp=1, data=inputmat,validation="LOO")
Error in model.frame.default(formula =
2009 Jun 25
2
Placing text outside graph boundary
Hello,
Is possible to place a label on a multipanel figure outside the boundaries of any single one of the existing graphs in a panel?
Specifically, I have a function that creates a panel with quartz() and then fills it with 6 graphs consisting of exactly the same plot for 6 different groups. I would like to add one title for the entire figure at the top of the figure, but I cannot figure out
2009 Jun 15
2
Help with syntax error
Hi,
I have written boxplot commands of this form before, but I don''t quite understand why the function call is reporting a syntax error in this instance. All parameters passed to the function are strings.
Thanks in advance.
Payam
> simplevar <- function(wframe,column1,column2) {
+ tframe <- get(wframe)
+ x1 <- which(names(wframe)==column1)
+ x2 <-
2009 Jun 11
2
More basic question
I have encountered a more fundamental problem in my data set. I''m using read.csv, and all the data are imported as character. How do I do a string comparison in a line like this:
M10[ !sapply(1:10, function(x)666 %in% M10[x,]), ]
Alternately, how do I change the class type on a column in a data frame from character to numeric?
Thank you very much.
Payam
[[alternative HTML version
2009 Sep 21
2
How to handle missing values for the GeneMeta package?
Hello all,
It seems that the GeneMeta passage returns NA in the respective row if
any gene in the data sets to be synthesised are missing. Do you know
of a way to overcome this problem?
I tried using the 'impute' package to fill-in the missing values, but
R crashes if 'impute' and 'GeneMeta' packages are used together. I
have asked a separate question for that.
Thanks
2010 May 20
1
sqldf: issues with natural joins
Hello,
I'm having trouble discovering what's going wrong with my use of natural
joins via sqldf.
Following the instructions under 4i at http://code.google.com/p/sqldf/,
which discusses creating indices to speed joins, I have been only unreliably
able to get natural joins to work.
For example,
> Tid <- c('AES 01-01-02 10:58:00', 'AES 01-01-02 11:53:00', 'AES
2014 Jun 24
2
using C code to create data frame but always return as list
there is my code, expect return value is a data frame but R say it is list:
SEXP Julia_R_MD_NA_DataFrame(jl_value_t* Var)
{
SEXP ans,names,rownames;
char evalcmd[4096];
int i;
const char* dfname="DataFrameName0tmp";
jl_set_global(jl_main_module, jl_symbol(dfname), (jl_value_t*)Var);
//Get Frame cols
sprintf(evalcmd,"size(%s,2)",dfname);
jl_value_t*
2003 Jan 24
3
win98 & samba file server
Hello everybody,
it's a few minutes that i've subscribed in your mailing list.
nice to meat all of you.
I have samba on redhat 8 as a file server for a couple of "win98" &
"winXP"'s.It work's for my XP OS's but I don't know how to join the "win98" 's in.
please help me
thanks
payam.
2009 Nov 16
8
extracting the last row of each group in a data frame
Hi,
I would like to extract the last row of each group in a data frame.
The data frame is as follows
Name Value
A 1
A 2
A 3
B 4
B 8
C 2
D 3
I would like to get a data frame as
Name Value
A 3
B 8
C 2
D 3
Thank you for your suggestions in advance
Jeff
2009 Jun 15
0
books on Time serie
A time series text with a title that seems designed to hide its
wide scope is:
Forecasting with Exponential Smoothing
The State Space Approach
Hyndman, R.J., Koehler, A.B., Ord, J.K., Snyder, R.D.
Springer 2009.
This book is actually an excellent overview of time series theory,
ARIMA as well as state space. It is of course, in part, a manual
for the forecast and other packages in what has been
2001 Oct 30
2
extracting object names as strings
Hi,
I'm looking for a function which returns the name of the argument
object as a string:
>vect <- 1:3
>function(vect)
"vect"
I've looked at 'name', 'names', 'objects', none seem to do exactly what I
want. ls/objects comes close, but I can't figure out how to force it to
give me only one object name.
daver
2013 Jan 18
2
A smart way to use "$" in data frame
Hello all,
I have a data frame dataa:
newdate newstate newid newbalance newaccounts
1 31DEC2001 AR 1 1170 61
2 31DEC2001 VA 2 4565 54
3 31DEC2001 WA 3 2726 35
4 31DEC2001 AR 3 2700 35
The following gives me the balance of state AR:
2012 Nov 15
1
Extracting list names within a looped function
Hello all,
I have the following problem:
1) A list was defined as 'a'
a <- list("var1"=c(100:1), "var2"=c(1:100), "var3"=rnorm(100))
2) a function 'foo' was defined that extracts the variable name assigned to x using the deparse(substitute()) functionality. This name will then be used within the function to generate specific output files, etc.
2004 Sep 09
2
Handling the windows clipboard/32KB limit
(R 1.9.1; Windows 2000;)
I'm just comparing ease of use, speed, etc for methods of transferring data frames in the Excel, MySQL, R triangle. It turns out that going from Excel to R (when doing this carefully). Using the clipboard is actually quite fast and efficient (2 seconds for transferring 120 000 cells on a common desktop computer as compared to much longer for going the RODBC route,
2004 Dec 29
3
using get() in assign()
I'm trying to rename the columns in a list of data.frames using the
following...
for(i in 1:length(filenames)) {
assign(names(get(filenames[i])), c("name", "infood", "time") ) }
R returns no errors, but the names are unchanged in the data.frames.
The original names were things like
> names(get(filenames[2]))
[1] "Tc45w4.V1" "Tc45w4.V2"
2012 Aug 29
5
Extracting the name of a function (inverse of match.fun("myFun"))
Hi all,
is there a way to extract the name of a function, i.e. do the reverse
of match.fun applied to a character string? I would like to print out
the name of a function supplied to another function as an argument.
For example:
myFunc = function(x) { x+1 }
applyFunc = function(fnc, x)
{
fnc = match.fun(fnc)
fnc(x)
}
Is there a way to obtain "myFunc" from the argument fnc in
2008 Mar 03
3
looping through data frames in a workspace
All,
I have a workspace containing only data frame objects. I would like to
loop though each one and clean-up text columns in them. How can I have
R loop through the list? I have tried to find an answer in R help but
the closest solution I can find is to make a static list of data
frames, as illustrated in this recent post:
---------begin post
On Tuesday 19 February 2008 (19:51:15), TLowe wrote: