similar to: how to use the switch statement

Displaying 20 results from an estimated 10000 matches similar to: "how to use the switch statement"

2007 Apr 03
5
converting a list to a data.frame
Hello, I have a list with n numerical components of different length (3, 4 or 5 values in each component of the list); I need to export this as a text file where each component of the list will be a row and where missing values should fill in the blanks due to the different lengths of the components of the list. I think that as a first step I should convert my list to a data frame, but this is
2006 Nov 09
1
Merge: how can I keep discarded values?
Good morning, I am merging two datasets and I would like to save the non-matching rows in a separate file. The problem is how to retrieve the non-matching rows in R. Example: DATASET A code nomi A1 Franco A2 Mario A3 Andrea A4 Sandro A5 Luca DATASET B code book A1 Guerra e Pace A1 Storia di Roma A2 La coscienza di Zeno A4
2004 Aug 26
3
plot.new?
Hi all, I am just beginning to use R and encountered a problem in trying to draw a regression line using the command "abline(coef(var)" and similar ones but got the error "plot.new has not been called yet". Does anybody know how can I call plot.new? Is this an additional package to be found somewhere on the web? Is it a functionality that I just have to "activate"
2007 Dec 03
3
overlapping labels
Good evening, I am trying to add labels to the point of a simple plot, using the text() function; the problem is that sometimes, if two points are too close to each other, labels overlap and are no longer readable. I was wondering whether there are options that I can use to prevent this overlapping (by, for example, placing labels alternatively above and below the plotted curve), or whether I
2004 Sep 30
1
tcl/tk
Hi all, I am already using R under Window and would like now to try and install it under Unix; I read I need tcl/tk installed so I connected to http://www.scriptics.com downloaded the file and extracted them to a directory tcltk beside R. I configured (./configure) both packages (tcl and tk) and compiled (make) them but I am not sure about how to proceed now: should I launch the command make
2013 Jan 08
1
problems when loading package GenABEL
Dear all, since yesterday, I have been experiencing problems with the package GenABEL. When I try to load the package (library(GenABEL)) I get the following error message: Loading required package: MASS Error : .onLoad failed in loadNamespace() for 'GenABEL', details: call: stringSplit[[1]] error: subscript out of bounds Error: package/namespace load failed for ?GenABEL? The funny
2004 Sep 06
1
R under Windows vs R under Unix/Linux
Hi all, I would like to know which are the main differences between R under Windos and R under Linux/Unix and where I can find, if something exists, some materials and infos on line on this topic. Thank you very much, Filippo Biscarini *************************** Filippo Biscarini, Research and Development ANAFI (Italian Holstein Association) Via Bergamo, 292 26100, Cremona, Italy
2005 Feb 15
1
matlab norm(h) command in R: sqrt(sum(h^2)) - use in an expression
Hi in matlab I defined a function (double gamma, parameters at the end of this mail) as h(i)=((t/d1)^a1)*exp(-(t-d1)/b1)-c*((t/d2)^a2)*exp(-(t-d2)/b2); h=h/norm(h); I do know that norm() in matlab is equal to: sqrt(sum(x^2)) in R so in R I do it like: #function (double gamama) h <- expression((t/d1)^a1*exp(-(t-d1)/b1)-c*(t/d2)^a2*exp(-(t-d2)/b2)) # plot it t <- seq(0, 20000,
2012 Jan 19
3
Establishing groups using something other than ifelse()
Hello all, This is one of those "Is there a better way to do this questions". Say I have a dataframe (df) with a grouping variable (z). This is my base data. Now I know that there is a higher order level of grouping that exist for my group variable. So what I want to do is create a new column that express that higher order level of grouping based on values in the sub-group (z in this
2005 Sep 26
3
dates are shown as X15.Feb.03
Why is R recognizing dates like this? Chris Buddenhagen, Botany Department, Charles Darwin Research Station, Santa Cruz,Galapagos. Mail: Charles Darwin Foundation, Casilla 17-01-3891 Avenida 6 de Diciembre N36-109 y Pasaje California Quito, ECUADOR ______________________________________________________________________ EL CONTENIDO DE ESTE MENSAJE ES DE ABSOLUTA RESPONSABILIDAD DEL
2005 Sep 20
2
Transform variable number of rows per subject to column variables?
Hello, I am very new to R, but I am having trouble with my dataset. I have a data frame where a subject has a variable number of multiple observations for each row, which I wish the transform these observations to column variables. An example of the data frame ID TEST.A TEST.B 1 10 1 1 13 2 1 11 1 2 15 2 2 17 3 And I wish to transform it to the following: ID TEST.A1 TEST.A2 TEST.A3 TEST.B1
2009 Jun 18
3
merging data.frames of different length
hi, I have two data.frames each with two columns; x1 1 4 1 3 1 6 2 9 2 2 2 5 3 6 3 7 3 4 x2 1 -3 1 -7 2 -3 2 -2 2 -8 3 -1 3 -2 3 -1 now I want to merge this data.frames to one data.frame. The problem is, that sometimes there is a different number of elements per category. (like above x1 has 3 values for the value 1 in the first row, but x2 has only 2 values for the value 1 in the
2006 Feb 08
2
2.0.3-pre2: Spurious UPS UPS@localhost battery is
Peter Selinger wrote: > Hm. I need more information, as NUT seems to garble the values even > before I can see them. I am not so worried about the date and > temperatures (although, strangely, the battery replacement date > appears to be Sept 25, 2001, which makes no sense). But the voltage is > definitely important. > > [...] > Thanks Peter - I'll send the new
2009 Mar 13
7
Weird Load and Battery Temp Readings
I've acquired and installed NUT 2.4.1 on a D-Link DNS323 NAS. With exception of Load and Battery Temp readings all works well. A upsc ups at localhost command returns; battery.charge: 100 battery.charge.low: 10 battery.charge.warning: 50 battery.date: 2001/09/25 battery.mfr.date: 2008/06/05 battery.runtime: 2122 battery.runtime.low: 120 battery.temperature: 3022999999999998800 battery.type:
2011 Jul 05
3
plotting survival curves (multiple curves on single graph)
Hello. This is a follow-up to a question I posted last week. With some previous suggestions from the R-help community, I have been able to plot survival (, hazard, and density) curves using published data for Siler hazard parameters from a number of ethnographic populations. Can the function below be modified, perhaps with a "for" statement, so that multiple curves (different line
2012 May 13
2
Discrete choice model maximum likelihood estimation
Hello, I am new to R and I am trying to estimate a discrete model with three choices. I am stuck at a point and cannot find a solution. I have probability functions for occurrence of these choices, and then I build the likelihood functions associated to these choices and finally I build the general log-likelihood function. There are four parameters in the model, three of them are associated to
2012 Apr 19
3
How to "flatten" a multidimensional array into a dataframe?
Hi, I have a three dimensional array, e.g., my.array = array(0, dim=c(2,3,4), dimnames=list( d1=c("A1","A2"), d2=c("B1","B2","B3"), d3=c("C1","C2","C3","C4")) ) what I would like to get is then a dataframe: d1 d2 d3 value A1 B1 C1 0 A2 B1 C1 0 . . . A2 B3 C4 0 I'm sure there is one function to do
2012 Sep 07
6
splitting character vectors into multiple vectors using strsplit
Hi folks, Suppose I create the character vector charvec by > charvec<-c("a1.b1","a2.b2") > charvec [1] "a1.b1" "a2.b2" and then I use strsplit on charvec as follows: > splitlist<-strsplit(charvec,split=".",fixed=TRUE) > splitlist [[1]] [1] "a1" "b1" [[2]] [1] "a2" "b2" I was wondering
2003 Nov 18
1
aov with Error and lme
Hi I searched in the list and only found questions without answers e.g. http://finzi.psych.upenn.edu/R/Rhelp02a/archive/19955.html : Is there a way to get the same results with lme as with aov with Error()? Can anybody reproduce the following results with lme: id<-c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)
2009 Nov 29
3
Plotting observed vs. Predicted values, change of symbols
Dear Wiz[R]ds, I am deeply grateful for the help from Duncan Murdoch, Gray Calhoun, and others. We are almost there. For whatever reason, I can't change the symbol from a circle to a triangle in the upright posture plots. Any ideas? I have included the problem in full. # tritiated (3H)-Norepinephrine(NE) disappearance from plasma # concentrations supine and upright # supine datasu <-