Questions tagged [levels]

491 questions
8
votes
2 answers

Levels function returning NULL

I'm hoping this is an easy fix. Whenever I run levels(df) am I given a NULL output. This isn't specific to my data frame as it occurs with any set of data that I use. I am thinking that there may be an issue with one of my packages. Has anyone…
Wyatt
  • 83
  • 1
  • 1
  • 3
7
votes
4 answers

Levels in R Dataframe

I imported data from a .csv file, and attached the dataset. My problem: one variable is in integer form and has 295 levels. I need to use this variable to create others, but I don't know how to deal with the levels. What are these, and how do I…
Thomas
  • 847
  • 4
  • 12
  • 21
7
votes
1 answer

ImageMagick - How do I flatten white levels to pure white?

I have a png image with a white background which I'd like to turn transparent. This is fairly simple with this command: $ convert image.png -transparent white image-trans.png However, if the white background is not completely white (i.e, #FFFFFF,…
sa125
  • 28,121
  • 38
  • 111
  • 153
6
votes
2 answers

Removing Specific factor level from factor variable

I have a data frame that has several variables that have 5 factor levels. I want to delete only one of those levels. First I assigned all instances of of that level to NA, and then used the droplevels command to get rid the empty levels. However…
user2460499
  • 151
  • 2
  • 3
  • 7
4
votes
1 answer

How to swap the column header in pandas pivot table?

Following up from this question I got a datframe after pivoting like this . AVG GrossProfit AVG PMV Loss% Sales ParentAuction Copart IAA Copart IAA Copart IAA Copart IAA Make …
Bharath M Shetty
  • 30,075
  • 6
  • 57
  • 108
4
votes
1 answer

Getting the keys out of a Multiindex?

I've got a MultiIndex with IDs and Dates, of the form: MultiIndex(levels=[[196003, 196005, 196007, 196009, 196012, 196103, 196105, 196107, 196109, 196112, 196203, 196205, 196207, 196209, 196212, 196303, 196305, 196307, 196309, 196312, 196403,…
cjm2671
  • 18,348
  • 31
  • 102
  • 161
4
votes
3 answers

Highcharts - Hide child labels in a multiple levels and multiple layouts treemap

On highcharts, I have a treemap with 2 levels, each with a different layout algorithm. Now I want to limit what we can see to the current level. It means that on level 1, I don't want to see the labels of level 2, which would only appear when…
Flyout91
  • 782
  • 10
  • 31
4
votes
3 answers

The paste() function and ordering levels of variables

I have two columns in the following data frame, and each column has levels according to a specific order: head(x1) soa congruency 1 200 9 2 102 2 3 68 1 4 68 9 5 34 9 6 68 …
ayalaall
  • 145
  • 2
  • 16
4
votes
2 answers

Change reference level for variable in R

I have a data set, (call it DATA) with a variable, COLOR. The mode of COLOR is numeric and the class is factor. First, I'm a bit confused by the "numeric" -- when printed out, the data for COLOR are not numeric -- they are all character values, like…
Mike L
  • 486
  • 5
  • 16
  • 33
4
votes
1 answer

JQuery Sortable strange behavior connectWith div

I'm trying to connect multiple boxes in multiple levels and sort them between the levels using JQuery Sortable. The problem is that my current solution have a strange behavior when I try to drop items inside another level. Does anybody know a good…
Flavio
  • 43
  • 6
4
votes
1 answer

R: grouping factors everytime n unique levels occur in data

I want a new grouping every time there's 5 unique levels Ex. varB is the desired result structure(list(varA = structure(c(2L, 2L, 3L, 5L, 4L, 1L, 1L, 2L, 3L, 5L, 4L, 4L, 1L), .Label = c("badger", "cat", "dog", "monkey", "turtle"), class =…
jose
  • 103
  • 5
4
votes
2 answers

Best practices for implementing levels in cocos2d games

I'm making a simple cocos2d adventure game, but have no clue how to implement any sort of levels. I've searched for tutorials, but can't find any. Is there anything I can use to figure out levels in cocos2D? Thanks
beakr
  • 5,709
  • 11
  • 42
  • 66
3
votes
3 answers

Error with levels using mlogit in R

I am having some trouble with levels... Running the following: library(mlogit) panel.datasm = data.frame( cbind( round(runif(100, min=1, max=6)), rep(1:20,each=5), runif(100, min=0, max=1), runif(100, min=0,…
mmann1123
  • 5,031
  • 7
  • 41
  • 49
3
votes
2 answers

How can I reclassify a categorical raster in terra using category names

I'd like to be able to merge two categories in a categorical raster. The only solution I've figured out so far uses the level index number, not the name of the category. How could I do this using the name of the category? library(terra) m <-…
canderson156
  • 1,045
  • 10
  • 24
3
votes
2 answers

How to perform conditional mutate on unspecified columns (e.g. matching regex)?

I have a nested data.frame - df_nested, there one of column contains df: df <- tibble(ID_Value = 1:8, xyz001 = c("text4", NA, NA, NA, NA, NA, NA, "text2"), xyz002 = c(NA, NA, NA, "text3", "text1", NA, NA, NA), …
1
2
3
32 33