similar to: Cross two dataframe

Displaying 20 results from an estimated 800 matches similar to: "Cross two dataframe"

2006 Oct 13
3
multiply two matrixes with the different dimension column by column
Dear all, I would like to multiply two matrixes with the different dimension column by column. Let make an example: If I have two matrixes "X" and "Y"as follow: X<- matrix(1:12, nrow=4, ncol=3, dimnames=list(c("A","B","C","D"), c("stage1","stage2","stage3"))) Y<- matrix(1:28, nrow=4, ncol=7,
2007 Feb 01
2
How can I calculate conditional mean in a large dataset including date data
Dear R users, I have a dataframe with two columns: first column is date data (e.g. 1/1/2000 with character format: daily data from 1/1/1970 till 31/12/2003) and second column is temperature value. Now I'd like to calculate mean for each month in a year (i.e. May 2001, June 1997) and mean for each month in all of years. As the number of days in some months is different from others I could
2010 Jan 14
2
paired repeated measurements
I have the following problem: I measured co2 on 6 paired sites (one grubbed and one non-grubbed fence per site -> grubbing = treatment). These measurements I repeated 15 times over 2 years. So, now my problem is how to analyze these data. I tried the following model: mod1_CO2<-lme(co2~treatment+time,random=~1|site,data=CO2_t1_t15) I think with the random effect I included the paired
2007 Jul 07
2
random sampling with some limitive conditions?
I want to gain thousands of random sampling data by randomizing the presence-absence data. Meantime, one important limition is that the row and column sums must be fixed. For example, the data "tst" is following: site1 site2 site3 site4 site5 site6 site7 site8 1 0 0 0 1 1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 1 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0
2005 May 07
3
converting NA/non-NA's to a binary variable
Dear R colleagues, I am trying to create a new column in a data frame, which converts values and NA's from another column into binary format. Essentially I need the NA's to become 1 and the rest to be 0. The code I wrote is returning the following error message: Error in if (mort[i, 4] != NA) mort[i, 8] <- 0 else if (mort[i, 4] == : missing value where TRUE/FALSE needed
2004 Dec 03
4
vector to matrix transformation
Dear, Some analysis (linear regression) can only be done from a vectorized dataset whereas others require a matrix (Mantel tests). I use the two analyses and thus need to format my data in matrix and vector. I spent some time trying to solve the problem and I just gave up. Did anyone knows how to transform a matrix into a vector and back-transform a vector into a matrix? Thanks by
2002 Sep 04
3
logical and NA
Hi there, (sorry Martin, ich habe den falschen Empfaenger erwischt :-( ) Is there a function in the base package or elsewhere which returns TRUE and not NA, even if NA is involved: (I did not find in the help system :-( ) if ( x==something & !is.na(something)) or if ( x==something & !is.na(x==something)) If "something" is complicated, a function would be handy. Thanks
2009 Dec 04
2
curve fitting to data
Hi to all This is the first time I am quoting a question and I hope, my question is not too basic... For the following data, I wish to draw a fitted curve. x <- c(123,129,141,144,144,145,149,150,158,159,163,174,183,187,242,248) y <- c(14.42,26.96,31.3,19.95,36.36,15.4,24.76,35.39,28.07,40.97,26.23,42.83,46.53,14.79,49.18,48.08) If I plot the data, it looks somehow that a logistic
2004 Mar 24
6
First Variable in lm
Hi all, I just cannot think of how to do it: I want to take the first variable (column) of a data frame and regress it against all other variables. bla <- function (dat) { reg <- lm(whateverthefirstofthevariablenamesis ~., data=dat) return(reg) } What kind of function do I have to take instead of the whateverthefirstofthevariablenamesis, eval(), substitute(), get(), ... to
2011 Dec 01
3
vector
Hi. Can you please answer to my questions about R ? 1.how can I write command for vector ? for exaple in this sample : I have this : a1 <- c (1:10) now how can I put in the vector ? bye for now, Thanks a lot. Majid. [[alternative HTML version deleted]]
1998 Dec 22
2
Problems with SMB.CONF (2nd)
Majid, On Wed, 23 Dec 1998 00:20:31 +1100, Majid Tajamolian wrote: >> >; hosts allow = *.bol.sharif.ac.ir >> >; hosts allow = .bol.sharif.ac.ir >> >; hosts allow = 194.225.42.* >> > hosts allow = 194.225.42. >> >2. As you see above, if I use a domain detector except with the format >> > "194.225.42." , clients on our LAN
2002 Nov 06
5
"chemical" plot
Hi all, May be there is a plot which shows 3 variables in a triangle, their sum being constant. I have forgotten its name, and a search in the engine using "plot" did not help. Does anyone know of such a procedure in R or S? Thank you --christian Dr.sc.math.Christian W. Hoffmann Mathematics and Statistical Computing Landscape Dynamics and Spatial Development Swiss Federal Research
2012 Jan 15
1
Correct Localized Numbers on Plots, related to glibc!
Dear R Helpers, I want to localize my plots, i.e. the numbers by x & y axis be Persian, using Persian numerals and Persian decimal separator. I change the locale to fa_IR.utf8, but nothing on plots change. I can change the numerals shaping to Persian ones (???? instead of 1234) using some non-standard fonts but the decimal point is a problem. I asked about that in Persian-Computing mailing
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
2003 Jun 03
3
(no subject)
Hi, I would like to know if it is possible to get printed output while a loop is taking place. Example: for(i in 1:10){ print(i) some long process } This will print the values of i only after the loop is finished, what I would like is to see them when the process enters the i-th iteration to keep track of how the program is running. Thank you, Gilda
2004 Sep 22
1
is.constant
>>x <- c(1, 2, NA) >>is.constant(x) > > [1] TRUE > > For data such as c(1, 1, 1, NA), I should think the safest answer should be > NA, because one really doesn't know whether that last number is 1 or not. > > Andy > My version is is.constant <- function(x) { if (is.numeric(x) & !any(is.na(x))) identical(min(x), max(x)) else FALSE }
2004 Jul 06
1
Samba 2.2.8.a for Solaris
Hi, I just downloaded and installed samba2.2.8.a on a sun4u sparc box running Solaris8. The installation process completed w/o errors and I can now confirm that by "$pkginfo -l samba". I can even start and stop samba by "/etc/rc3.d/S99samba.server start" and see that smbd and nmbd processes are running. However, I can not find the "configure" file in the source
2008 Dec 05
1
How to retrieve a method
Hi there, I am interested in the inner workings of wilcox.test: > wilcox.test function (x, ...) UseMethod("wilcox.test") <environment: namespace:stats> how can I get at the code, if it is R-code? For Methods one should be able to learn what extension to use, but here default or such do not help. Is there a wayplot.default to learn which different versions of
2004 Sep 30
4
Can't add new users
Hi all, I tried to add a new user to a Samba share, I did all the usual: made a Unix account on the Unix server for the user which was the same as the user's window's UID. Put her name as a valid user for that directory in server:/etc/opt/samba/smb.conf, and stopped and started server:/sbin/init.d/samba server; nothing worked. Interesting observations: 1- After performing the steps
2002 Jan 04
2
R CMD check (PR#1240)
SunOS fluke 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-Enterprise R-1.4.0 Running from the command line R CMD check chlib results in the log file 00check.log: * using log directory `/home/woodstock/hoffmann/R/Sources/chlib.Rcheck' * checking for file `chlib/DESCRIPTION' ... OK * checking package directory ... OK * checking for sufficient/correct file permissions ... WARNING *