similar to: problem formatting data frames

Displaying 20 results from an estimated 10000 matches similar to: "problem formatting data frames"

2002 Jun 26
3
Help with concatenation and arrays
Dear R-guRus: I have 2 questions 1) I have 2 variables, e.g. x<-5; y<-"Char" How do I create a new variable which would have both these values in a string (e.g. "5Char", or "5 Char", etc ) ?? 2) if i have an array x[1:100], and I do x[x==345.123], how do I get position j in the array of those x[j] which are equal to 345.123 ? Thank you very much, Vlad.
2010 Apr 26
1
Sweave: centering with echo=TRUE
In a .Rnw file I want to insert the R command pairs(mydataframe) and achieve the following effects 1. the command itseld is echoed into the tex document generated by Sweave <<fig=TRUE,echo=TRUE>>= 2. The graphics generated appears in the tex document, with the graphics centred. 3. The R command > pairs(mydataframe) is not centered. Sweave-manual.pdf gives the following code chunk
2002 Oct 21
2
overlaying plots
Dear R-gurus: How do I overlay 2 plots in the same frame in R? Or, if I have a histogram, and I want to plot a function in the same frame - how do I do it? Thank you very much, Vlad -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
2002 Jul 09
3
Assignment converts variable to factor
Hello, I would like to know if this behaviour in R is as expected. I have a data frame 'dat' with column var1 being character (and not factor). Then I create a new column 'var2' by: > dat[,"var2"] <- dat$var1; Column var2 is now a factor. But if I do: > dat$var2 <- dat$var1; Then column var2 is character (and not factor). I don't want to have
2014 Nov 02
1
drs replicate to Windows 2003 DC fails with WERR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT and WERR_DS_DRA_ACCESS_DENIED
My samba4.11 server will only replicate one way: windows -> samba. Replication from samba -> windows fails. Details follow. I have a Samba 4.11 domain controller (fs1) that was added to an existing domain that had a Windows Server 2003R2 domain controller (fs) and Windows Small Business Server 2011 (sbs). fs1 is running on Debian 7.6 My issues seems similar to
2002 Aug 03
2
variable scope
Dear R-guRus: I would like to pass variables to a function in R in "by reference", e.g Fortran style. For example, suppose I have the following code x<-c(1:10) y<-1 MyFunc<-function(x,y) {y<-sum(x); return(NULL)} MyFunc(x,y) print(y) in this case print(y) will produce "1" instead of 55 (which is sum(x)) - how do I make sure that afte the function is run, y
2002 Aug 03
2
variable scope
Dear R-guRus: I would like to pass variables to a function in R in "by reference", e.g Fortran style. For example, suppose I have the following code x<-c(1:10) y<-1 MyFunc<-function(x,y) {y<-sum(x); return(NULL)} MyFunc(x,y) print(y) in this case print(y) will produce "1" instead of 55 (which is sum(x)) - how do I make sure that afte the function is run, y
2011 Apr 07
3
Correlation Matrix
Listers, I have a question regarding correlation matrices. It is fairly straight forward to build a correlation matrix of an entire data frame. I simply use the command cor(MyDataFrame). However, what I would like to do is construct a smaller correlation matrix using just three of the variable out of my data set. When I run this: cor(MyDataFrame$variable1,
2002 Jul 01
1
a little statistics help
Dear R-guRus: I am stuck with the following problem in R: Let's say i have a data.frame with columns X,Y & Z. X is a column of numbers, Y is a column of N factors "A", "B", "C", "D", etc and Z is a column of n factors "a", "b", "c", etc if i do MyLm<-lm(X~Y*Z - 1) i get all N coefficients for Y-factors, but only
2009 Dec 08
1
problem with split eating giga-bytes of memory
I'm having trouble using split on a very large data-set with ~1400 levels of the factor to be split. Unfortunately, I can't reproduce it with the simple self-contained example below. As you can see, splitting the artificial dataframe of size ~13MB results in a split dataframe of ~ 144MB, with an increase memory allocation of ~10 fold for the split object. If split scales linearly, then my
2007 Oct 24
3
Partial aggregate on sorted data
Hi All, I'm looking for ways to compute aggregate statistics (with the aggregate function) but with an option for sorting and selecting a subset of the data frame. For example, I have would like to turn this : aggregate(myDataframe$TargetValue,list(SomeFactor = myDataframe$SomeFactor),mean) into something like aggregate(myDataframe$TargetValue,list(SomeFactor =
2010 Mar 11
2
Can't convert list to matrix properly
Hi guys, here is a list of names that I have: MyList: > myList<-list("A", "B","C","D") > myList [[1]] [1] "A" [[2]] [1] "B" [[3]] [1] "C" [[4]] [1] "D" I want to turn this list into a matrix of 1 row and 4 columns with those four components (A, B, C, D) so here is what I do: myDataFrame <-
2003 Nov 20
3
nls, nlrq, and box-cox transformation
Dear r-help members I posted this message already yesterday, but don't know whether it reached you since I joined the group only yesterday. I would like to estimate the boxcox transformed model (y^t - 1)/t ~ b0 + b1 * x. Unfortunately, R returns with an error message when I try to perform this with the call nls( I((y^t - 1)/t) ~ I(b0 + b1*x), start = c(t=1,b0=0,b1=0), data = mydataframe)
2006 Jan 26
1
construct a bundle, subdirs do not exist?
Hi, Sorry to bother, but I checked around and did not succed creating a bundle from six existing packages (which are checkable, installable, etc. individually). I carefully followed the procedure given in ch. 1.1.5 Package bundles. However, I am getting hoffmann at fluke:~/R/Sources >R CMD check cwhmisc * checking for working latex ... OK * using log directory
2010 Apr 26
1
help with code
I am new to R and have tried for a good while to figure out how to code this in R. The dataset below: FTIStandKey State County FTITract CoverType Ver_CT V_Origin V_SpGrp NAH6005-001 Texas Jasper NAH6005 PPLB-2000-U PPLB-2000-U P P NAH6005-002 Texas Jasper NAH6005 NHHX-1950-O NHHX-1950-I N H NAH6253-001 Texas Tyler NAH6253 PPLB-2001-U PPLB-2001-U P P
2011 Nov 07
1
DESeq
Hello, I have RNAseq data, which I am trying to analyze with DESeq. My file (tab delimited .txt) appears to be correct: >head(myfile) VZ_w13 VZ_w14a VZ_w14b VZ_w15a VZ_w15b VZ_w16a ENSG00000253101 0 0 0 0 0 0 ENSG00000223972 0 0 0 0 0 0... However, when I try to analyze the data with >cds <-
2012 Jul 19
2
problem with using apply for dataframe
Dear people, I am including an example of a dataframe: mydataframe<-data.frame(X=c(1:4),total_bill=c(16.99,10.34,21.01,23.68),tip=c(1.01,1.66,3.50,3.31),sex=c("Male","Male","Male","Female")) When I use the sapply function getting the information about the factors works: sapply(mydataframe,function(x)is.factor(x)) X total_bill tip
2010 Apr 29
2
understanding behavior of "merge"
I'm trying to bootstrap resample from a repeated measures dataset. I sample a vector of "ID"'s from my dataframe with replacement. Then I merge this back with my dataframe. I'm re-sampling subjects in the dataset rather than rows of the data. I thought I could use the left/right join features of the merge to select the records I want from the dataframe (mydataframe), like
2005 Apr 04
2
mysql retrive question
hello R-Users, I have this simple but not for me question: I do: > res<-dbSendQuery(con, "SELECT * FROM tabellaProva") > myDataFrame<-fetch(res) > myDataMatrix<-as.matrix(myDataFrame[,-1]) > namerows(myDataMatrix)<-as.character(myDataFrame[,1]) and I have: io tu io "0" "1" tu "1" "0" my problem is that the
2006 Oct 12
3
Cross two dataframe
Dear r-users! I would like to cross two data frame which have the same row number but different in the number of column. Can anybody help me for this case ? Thanks a lot in advance -------------------------------------------------------------------------------- Majid Iravani PhD Student Swiss Federal Research Institute WSL Research Group of Vegetation Ecology Z?rcherstrasse 111