Displaying 20 results from an estimated 500 matches similar to: "Prototype OOP example"
2006 Jun 18
2
Adding a instance method
Hi all,
I''d like to add a instance method to class String.
I should be fairly simple with
class String; def newmethod; do_something ; end; end
and it works perfectly if I test this independently with irb.
However if I add this to my application.rb I''ll get an error like
(undefined method `newmethod'' for "123456":String)
What''s wrong with that?
2013 Apr 09
1
sorting the VAR model output according to variable names??
I was wondering if one can have the coefficients of VAR model sorted
according to variable names rather than lags. If you notice below, the
output is sorted according to lags.
>VAR(cbind(fossil,labour),p=2,type="const")
VAR Estimation Results:
=======================
Estimated coefficients for equation fossil:
===========================================
Call:
fossil = fossil.l1
2011 Nov 03
2
query about counting rows of a dataframe
Dear R users,
I have got the following data frame, called my_df:
gender day_birth month_birth year_birth labour
1 F 22 10 2001 1
2 M 29 10 2001 2
3 M 1 11 2001 1
4 F 3 11
2009 Jan 19
1
reference category for factor in regression
Hi all,
I am struggling with a strange issue in R that I have not encountered
before and I am not sure how to resolve this.
The model looks like this, with all irrelevant variables left out:
LABOUR - a dummy variable
NONLABOUR = 1 - LABOUR
AGE - a categorical variable / factor
VOTE - a dummy variable
glm(VOTE ~ 0 + LABOUR + NONLABOUR + LABOUR : AGE + NONLABOUR : AGE,
2010 Jul 19
2
Grouping and stacking bar plot for categorical variables
Hi all,
I have a series of cateogiral variables that look just like this:
welfare=sample(c("less", "same", "more"), 1000, replace=TRUE)
education=sample(c("less", "same", "more"), 1000, replace=TRUE)
defence=sample(c("less", "same", "more"), 1000, replace=TRUE)
egp=sample(c("salariat",
2019 Feb 19
2
Cambiar el formato de datos
Después del "gather()" puedes hacer un "arrange()" que es una ordenación. Y
dentro de "arrange()" le indicas la variable por la que ordenas (no hacen
falta comillas)...
Lo ordenará alfabéticamente.
Saludos,
Carlos Ortega
www.qualityexcellence.es
El mar., 19 feb. 2019 a las 13:47, Antonio Rodriguez Andres (<
antoniorodriguezandres70 en gmail.com>) escribió:
2019 Mar 06
2
Crear una variable tipo factor a partir de un vector de caracteres
Si lo que quiero es crear una variable llamada por ejemplo region (del tipo
factor) con esos 5 valores
On Wed, 6 Mar 2019 at 15:41, Xavier-Andoni Tibau Alberdi <
xavitibau en gmail.com> wrote:
> No, No. Fíjate en el Ifelse(condición, valor si positivo, valor si
> negativo).
>
> Si, x %in% ca entonces el valor devuelto es "ca", un factor. En caso
> negativo, vamos
2019 Sep 04
3
Plot. window error- Usando R base. Gráfico
Carlos
Al especificar los limites, no me sale ningun error, aunque no consigue
graficar, nada,
# Look at the time series for each country for the time period, for
instance GDPPC
for (i in 1:length(countrylist)){
currcty <- countrylist[i]
filename <- paste("index",currcty,".png",sep="")
png(filename,width=800,height=600)
2019 Feb 19
2
Cambiar el formato de datos
> gather(pobla, key = year, value = totpop, year60:year63)
Country year totpop
1 Afghanistan year60 8996351
2 Albania year60 1608800
3 Algeria year60 11124888
4 Andorra year60 13411
Gracias Carlos
Antonio
On Tue, 19 Feb 2019 at 12:54, Carlos Ortega <cof en qualityexcellence.es>
wrote:
> Sí, tienes varias formas.
>
> Mira la función
2019 Sep 04
3
Plot. window error- Usando R base. Gráfico
Hola queridos usuarios de R
Estoy intentando hacer un gráfico de una variable en el tiempo para un
conjunto de países usando R base, con el comando plot. Tengo 40 países y
son 15 años. Lo quiero salvar como formato png, cada uno de ellos.
Tengo el siguiente código,
for (i in 1:length(countrylist)){
currcty <- countrylist[i]
filename <-
2019 Sep 04
2
Plot. window error- Usando R base. Gráfico
No me sale error pero no me imprime la linea, ni ningun gráfico por pais.
On Wed, 4 Sep 2019 at 18:42, neo <ericconchamunoz en gmail.com> wrote:
> podría ser el problema el tipo de dato en X y el tipo de gráfico que
> intentas hacer ?
>
> si Year es entero y estas pidiendo que el gráfico sea tipo "I", podría
> ser que quizá eso te produce el error ?
>
> si
2019 Mar 25
2
Uso de merge
Hola usuarios de R
Estoy tratando de usar merge, para dos data frame, sin embargo al usarlo me
da resultado correcto, en términos de emparejamiento de pais y año, pero lo
que me hace es que el dataframe *y* me hace como un append por filas. Las
variables comunes son país y año. Alguna sugerencia?
combine = merge(sub_kei, knowledge, by = common_col_names, all.x = TRUE,
all.y = TRUE)
Saludos
--
2019 Mar 06
3
Crear una variable tipo factor a partir de un vector de caracteres
Pero eso es para crear variables binarias tipo 0-1 si el pais pertence a un
determinado grupo. Lo que quiero es crear una variable de tipo factor con
esos 5 niveles, sabiendo que tengo en el dataframe una variable llamada
Country, con el nombre del pais.
Gracias
On Wed, 6 Mar 2019 at 15:27, Xavier-Andoni Tibau Alberdi <
xavitibau en gmail.com> wrote:
> Buenas,
>
> Para ello yo uso
2010 May 27
2
help calculating variable based on factor level of another
Dear colleagues,
I want to calculate the value of x2 based on the value of x1. x1 is a
factor with three separate levels. I want to make sure that missing
values remain as NA in X2, but non-missing values take on a value of
either 0 or 1 dependending on the value in x1.
This is the code I'm working with...Can any one help?
I've seen some other requests on a topic like this, but not
2011 Mar 31
1
Cluster analysis, factor variables, large data set
Dear R helpers,
I have a large data set with 36 variables and about 50.000 cases. The
variabels represent labour market status during 36 months, there are 8
different variable values (e.g. Full-time Employment, Student,...)
Only cases with at least one change in labour market status is
included in the data set.
To analyse sub sets of the data, I have used daisy in the
cluster-package to create
2017 Sep 01
4
Consejo
Estimados miembros de la comunidad de R
Me gustaria conocer dado que estoy trabajando con datos del World Values
Survey, y tengo que recodificar variables y manipularlas,
por donde podria empezar a estudiar el uso de R en grandes surveys. Que
podria comenzar a la leer.
Su respuesta sera bienvenida
saludos
Antonio
--
Member, Editorial Committee, *The Economic and Labour Relations Review* (a
2019 Oct 10
2
how to automatically create the home directory
>
> > If you're on a RedHat system with selinux (RHEL, CentOS, fedora), then
> > it looks like
> > <https://danwalsh.livejournal.com/69837.html> pam_oddjob_mkhomedir
> > will create the home directories for you and also ensure that the
> > correct selinux labels are applied. I have this on my todo list, as
> > I'm currently using the ADUC
2019 Mar 25
2
Uso de merge
Jose Luis
Column `Country` joining factors with different levels, coercing to
character vector
common_col_names <- intersect(names(sub_kei), names(knowledge))
> common_col_names
[1] "Country" "Year"
nrow(sub_kei) <- 132
nrow(knowledge) <- 3864
Tiene distinto numero de pais como de año, en el sub_kei aparecen 5 años y
en el otro dataset (knowledge) datos anuales
2024 Apr 01
2
NUT v2.8.2, the Easter Egg Edition
Hello all,
After a prolonged labour with a few re-issues of the tag and many pushes
during the day, NUT v2.8.2 was found in a strange egg by a bunny hopping
away from the April fools. All that - blessed under the shine of Polar
lights in the middle of the icy North Ocean.
A python module was released but slipped away with an earlier commit.
Other artifacts should follow shortly.
Jim Klimov
2024 Apr 01
2
NUT v2.8.2, the Easter Egg Edition
Hello all,
After a prolonged labour with a few re-issues of the tag and many pushes
during the day, NUT v2.8.2 was found in a strange egg by a bunny hopping
away from the April fools. All that - blessed under the shine of Polar
lights in the middle of the icy North Ocean.
A python module was released but slipped away with an earlier commit.
Other artifacts should follow shortly.
Jim Klimov